0

We suppose that I have a private key I used to sign my data with it before the comming of ethereum. is't possible to create an ethereum address based on my existent public key ?

3 Answers 3

2

Can we create an ethereum address with a public key of my choice?

Yes, but...

An Ethereum private key is just 256 random bits. You can generate those 256 bits in any way you like, including seeding it from an existing key (which is just a source of entropy).

If the key you already have isn't a 256-bit number, you'll either need to create a 256-bit representation of it (using a hash function), or find another way to deterministically map your existing key to those 256 bits. (e.g. If the key is greater than 256 bits, just truncate it to 256 bits, etc.)

Note that in your question title you said public key. If you're using your existing public key to seed your new Ethereum private key, you'd better ensure that your mapping from public key -> 256-bit seed is difficult for an attacker to work out. (Because your existing public key is public... )

(If what you're actually asking is "I have an existing key pair, can I use it in Ethereum?", then the answer is probably not. Unless it uses the exact same hashing functions and elliptic curve.)

You can then feed the resulting key into a (Ethereum-based) tool of your choice to create a public key (via ECDSA) and address (the last 20 bytes of a keccak256() hash of the X/Y coordinates of the public key).

1

You can create a private key and can create ethereum address using that. For more details, refer: https://docs.ethers.io/ethers.js/html/api-wallet.html

Hope it helps!

2
  • I already have a private key since 2014. I want use it to create an ethereum wallet is't possible ?
    – maroodb
    Commented May 3, 2018 at 9:42
  • you can import that private key in any existing wallet like Myetherwallet
    – Aniket
    Commented May 3, 2018 at 9:47
0

Address is the last 20 bytes of the hash of your public key.

In Ethereum, Your private key and public key are used to sign and verify.

In interactions you are only using your private key and address but internally Ethereum keeps using them to validate transactions.

1
  • you didn't answer my question
    – maroodb
    Commented May 3, 2018 at 12:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.