4

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.

  • 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. – Thomas Jay Rush Jan 18 '17 at 19:00
  • @ThomasJayRush both use the same elliptic curve SECP256K1. – Waqar Lim Jan 18 '17 at 21:51
  • 1
    Please nominate this question for reopen as this question is not about the portability of private key. – Mikko Ohtamaa Jan 19 '17 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 '17 at 6:15
  • Looks, good, I'll write my comments up as a proper answer. – Edmund Edgar Jan 20 '17 at 7:00
3

A Bitcoin address is made by:

private key -> public key -> hash

An Ethereum address is made by:

private key -> public key -> 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.

  • 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 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.

  • 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. – Mikko Ohtamaa Jan 19 '17 at 7:20
  • Please nominate the question for reopening. – Mikko Ohtamaa Jan 19 '17 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. – Edmund Edgar Jan 19 '17 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? – Mikko Ohtamaa Jan 19 '17 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. – Edmund Edgar Jan 19 '17 at 14:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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