How to get private key from ethereum wallet?

See original GitHub issue

This package is good to me. Using this package, I generated ethereum wallet. Here, private key is as follow. 0488ade4039c7ed931800000009f85cde1810467f199d7e0b6b2edaa6bc2f960b66ea61af9e35477c50e2243da00494c713bd615f7bef54adca9292cbd86e9f077e6a0ee33553258a2d961793a4e

But when I send transaction using web3.py, required private key has 32 bytes long. Above key is too long. I can’t use this. How can I get private key to be required to send transaction? Help me.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
hurlenkocommented, Nov 15, 2018

Had the same issue, install this library and use the code below to get the actual private key:

from crypto import HDPrivateKey, HDKey, PrivateKey


def decode(pkey_hex):
    assert len(pkey_hex) == 156
    pkey = HDPrivateKey.from_hex(pkey_hex)
    keys = HDKey.from_path(pkey, '{change}/{index}'.format(change=0, index=0))
    private_key = keys[-1]
    public_key = private_key.public_key
    print('  Private key (hex, compressed): 0x' + private_key._key.to_hex())
    print('  Address: ' + private_key.public_key.address())


def main():
    keys = [
        '0488ade4039c7ed931800000009f85cde1810467f199d7e0b6b2edaa6bc2f960b66ea61af9e35477c50e2243da00494c713bd615f7bef54adca9292cbd86e9f077e6a0ee33553258a2d961793a4e'
    ]
    for k in keys:
        decode(k)


if __name__ == '__main__':
    main()

0reactions
hurlenkocommented, Dec 19, 2018

Hi @henrytom1703, I used python 3.6, worked for me. Create new virtual environment, git clone this repo, run pip install -r requirements.txt then try again

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Create an Ethereum Wallet Address From a Private Key?
Ethereum Wallets are controlled through a password or a private key that allows users to send or receive funds or transactions within the ......
Read more >
Accessing your Ether wallet's Private Keys on Blockchain.info
Step #1: Login into your Blockchain.info account. · Step #2: Click on “Ether” (left side of your screen). · Step #3: Select the...
Read more >
https://support.blockchain.com/hc/en-us/articles/1...
No information is available for this page.
Read more >
How to steal the key of Ethereum wallet? (Part1)
Ethereum uses a cryptographic method of elliptic curves to generate a public/private key pair. A point on the secp256k1 ECDSA curve is calculated...
Read more >
How to get private key from account address and password?
Private key is often required to import your account in a different wallet. Even Metamask needs a private key to import the account....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found