5

As far as I know Ethereum private keys are compatible with Bitcoin private keys, as described in Can I use the same private key for Ethereum and Bitcoin? .

HOWEVER

Can I derive an Ethereum public address from a Bitcoin public address? Without access to the private key. So that the same Bitcoin private key behind the address could be also used in Ethereum network.

5
  • 1
    Do you have a source for the claim that the private keys are compatible? I've not heard that before. Not saying that aren't, but I would be interested in learning that. Jan 18, 2017 at 19:00
  • @ThomasJayRush both use the same elliptic curve SECP256K1.
    – q9f
    Jan 18, 2017 at 21:51
  • 1
    Please nominate this question for reopen as this question is not about the portability of private key. Jan 19, 2017 at 7:19
  • 1
    I nominated for reopening but the title hasn't been updated and I think this is almost a duplicate of ethereum.stackexchange.com/questions/3542/… The answer is no you can't because you need the private key to derive the public key, and then derive the address. EDIT: @Edmund's comments are more complete: once bitcoins are spent it's public key is revealed and from that an Ethereum address can be derived.
    – eth
    Jan 20, 2017 at 6:15
  • Looks, good, I'll write my comments up as a proper answer. Jan 20, 2017 at 7:00

2 Answers 2

5

A Bitcoin address is made by:

private key -> public key -> hash

An Ethereum address is made by:

private key -> public key -> hash -> throw some of it away and keep the rest

This means that the address alone is not enough to give you the address from the other system, but if you have the public key, you can create both the Bitcoin address and the Ethereum address.

The problem is getting the public key.

The public key cannot be deduced from the address in either Bitcoin or Ethereum. However, in both Bitcoin and Ethereum, making a transaction has the effect of publishing the public key on the network you are transacting with: In Ethereum, it is recoverable from the signature. In bitcoin, although it is recoverable from the signature, it is also explicitly sent as part of the transaction spending. (Bitcoin transactions are bigger than they need to be; Satoshi was probably not that big on cryptography.) So once a user has sent a transaction from an address on either the Bitcoin network or the Ethereum network, you can retrieve the public key from their spending transaction and use that to derive the address for the other network.

If the goal is to send the owner of a Bitcoin address assets on the Ethereum network, you also have another option: You can make a contract that is able to verify ownership of the Bitcoin address, once the owner gives it their public key. That way rather than needing the public key to send the user assets on the Ethereum network, you can defer the need to get hold of the public key until the user tries to spend the assets. Effectively, you are making a contract so that you can use a Bitcoin address on the Ethereum network. However, retrieving the funds will require the recipient to do non-standard things like sending this special contract their public key, at which point the contract will verify first that the public key supplied matches the specified bitcoin address, and then that the spender is able to provide a correct signature for that public key.

1
  • So, if I have a Ethereum signature (from web3.personal.sign) of some message (and I know which message it is), I can get public key of address. And if I then know Ethereum public key, I can get Bitcoin address from it. Also, if I have Bitcoin signature of some message, I can also get Bitcoin public key and convert it back to Ethereum address. Is this correct? How to do this? I want to do this with off-chain methods, so just signing some known message.
    – Filip Š
    Jul 8, 2019 at 21:40
2

I believe both Bitcoin and Ethereum use the same elliptic curve (SECP256K1) for public key creation - so you should be able to directly port over your Bitcoin private key and use it to create the same address on the Ethereum blockchain.

That being said, in the next "release" of Ethereum (Metropolis), users will be able to "define their own security model", so if this is something that you want to protect against in some way, I believe you will be able to - though I'm not sure why that would be the case.

5
  • I know you can port the private key, but this question is not about the private key. It is about if there is possible to create a Ethereum address based on Bitcoin address without seeing the private key. Jan 19, 2017 at 7:20
  • Please nominate the question for reopening. Jan 19, 2017 at 7:20
  • 2
    Answering here because mistakenly closed: If you only have a bitcoin address (hashed public key), no. You need the public key to make an Ethereum address. Once it's been used to spend bitcoin you can get the public key from the blockchain and make an Ethereum address. Also, even if you can't get the public key to make an Ethereum address, you can make a contract that will check a bitcoin address and have people send funds to a bitcoin address that way. However, retrieving the funds will require the recipient to do non-standard things like sending this special contract their public key. Jan 19, 2017 at 7:46
  • Thank you @EdmundEdgar - Does it work to the other direction too - if I know Ethereum transaction I can generate a Bitcoin public address for the private key that sent the transaction? Jan 19, 2017 at 14:17
  • Yes, it's basically the same: If all you have is an Ethereum address then you can't make a bitcoin address, because you don't have the whole public key. (Ethereum doesn't hash the public key to make an address, but it throws away part of it.) However, sending a signed transaction to the Ethereum network allows its public key to be recovered. (Ethereum is more efficient than bitcoin here: In bitcoin you have to send the public key, but in fact it's recoverable from the signature, something Ethereum takes advantage of to save space.) Once you have the public key, you can make a bitcoin address. Jan 19, 2017 at 14:27

Your Answer

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

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