1

I am reading the ethereum yellow paper, chapter 7, on contract creation. There it mentions how the address a of the created contract is derived and then describes the state after the creation. Namely, it says that the newly created contract's balance is v+v' (where v is the endowment and v' is

the acount's pre-existing value, in the event it was previously in existence

)

I wonder, in what case is it possible that account existed before its creation? (Or did I get something completely wrong?)

2

It looks like you are reading the paper correctly, and indeed it is bemusing. My understanding was that a contract address can never be duplicated given how it is defined:

"The address of the new account is defined as being the rightmost 160 bits of the Keccak hash of the RLP encoding of the structure containing only the sender and the nonce."

I suspect it is stated like that for completeness. Consider for example that in your Genesis file (on a private chain) you specify that a particular contract address has an initial endowment of Ether..

Because contract addresses are not random you could pre-emptively discern what a contract address will be and give it a pre-existing value.

  • I suppose it's also covering the (extremely unlikely) case of a hash collision with an account with a private key. – carver Aug 12 '17 at 2:48

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.