1

Is it the case that Ethereum requires the spender to provide the private key for an address so that it can prove ownership when spending ETH? If so, is there some mechanism where each spend actually creates a new address with a new private key, and invalidates the old address, to avoid someone else knowing the private key and taking the Ether?

I've googled for a while to look this up, but the search terms I'm using are probably not right, as I don't find any good hits. ("does spending ether expose the private key" and many variants.) Also, if this is already answered in this very SO, I'd love a link!

3

The private key isn't ever revealed, ownership is proven through a digital signature that proves that the owner knows the private key without actually revealing it.

Here is an overview:

  • Bob asks his wallet software to create a transaction from his address to Alice's
  • Bob's wallet software digitally signs his transaction with Bob's private key
  • Bob's wallet software publishes the signed transaction to another Ethereum node, which passes it on to another node, and so on until a mining node hears about it and includes it into a block.

The digital signature on Bob's transaction, crucially, allows everyone to verify that Bob's private key has "endorsed" the transaction, without him ever needing to reveal the private key itself.

  • Thank you; "using the public key to verify signature of private key" was the bit that escaped me. – Jon Watte Aug 27 '17 at 21:48
3

Done correctly, sending a signed transaction does not reveal the private key, so in theory there is no need to create a new address to prevent someone else taking the Ether.

The signed transaction does reveal the public key. As the name implies this is intended to be publicly shareable, but in some systems like Bitcoin the address is a hash of the public key (actually two hashes, using different algorithms), and in Ethereum part of the public key is thrown away when generating the address. This means that if you have never spent from an address, your money is safe even if the signature algorithm protecting it is broken.

There have also sometimes been bugs in signature implementations that have allowed people to recover the private key from a small number of existing signatures, like this issue with reused nonces. This is another kind of issue that you would have been safe from if didn't reuse addresses.

So creating a new address after you use an old one isn't necessary, but there are some situations where it will enhance your security.

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.