Giter VIP home page Giter VIP logo

ethereum-mnemonic-utils's Introduction

Ethereum Mnemonic Key Utils

Script to convert Ethereum mnemonic keys into regular private keys that can be consumed by regular wallets. Default parameters work for Ledger ETH wallets, but it should be able to support any wallet that uses BIP32 HD and BIP39 seed standards.

Modularity and extensibility were sacrificed to keep the code as simple and linear as possible. That way it should much easier for you to review this before running it :)

Logic adapted from https://github.com/satoshilabs/slips/blob/master/slip-0010/testvectors.py and https://github.com/trezor/python-mnemonic.

Requirements

pip install base58 ecdsa

Examples

Mnemonic key > private key

$ echo "legal winner thank year wave sausage worth useful legal winner thank yellow" > myfile
$ ./mnemonic_utils.py myfile

Mnemonic key > private key #2

from mnemonic_utils import mnemonic_to_private_key
private_key = mnemonic_to_private_key("legal winner thank year wave sausage worth useful legal winner thank yellow")

Private key > Mist keystore using eth-keyfile module

import binascii
import eth_keyfile
json_keyfile = eth_keyfile.create_keyfile_json(binascii.unhexlify(private_key), b"any password")

Private key > Mist keystore using web3.py module

import binascii
from web3.auto import w3
json_keyfile = w3.eth.account.privateKeyToAccount(binascii.unhexlify(private_key)).encrypt(b"any password")

ethereum-mnemonic-utils's People

Contributors

vergl4s avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

ethereum-mnemonic-utils's Issues

BTC private key to address and balance check

I just stumbled on these your GitHub repo I was looking for a program that will help me convert my compressed Bitcoin private key to address and check the balance. Could you please help me update or create a python program that will help me convert my compressed private key to address and check the balance. The reason I needed this was to scan through a massive private key txt file and see if I can find my missing 6 characters private key. Please help me if I recover the wallet I will donate some BTC to you. Thanks

AttributeError: 'mpz' object has no attribute 'to_bytes'

Hello, I'm having a problem converting the seed phrase to a private key:

Traceback (most recent call last):
  File "mnemonic_utils.py", line 162, in <module>
    private_key = mnemonic_to_private_key(mnemonic)
  File "mnemonic_utils.py", line 147, in mnemonic_to_private_key
    private_key, chain_code = derive_bip32childkey(private_key, chain_code, i)
  File "mnemonic_utils.py", line 66, in derive_bip32childkey
    key = key.to_bytes(32, byteorder='big')
AttributeError: 'mpz' object has no attribute 'to_bytes'

Python 3.8.3
base58==2.1.1
ecdsa==0.18.0

Mac OS: 12.6.2

Any help appreciated

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.