According to the EVM documentation, all values are initialized. This means to
will contain the 0
address, as null
is not a recognized state. The 0
address links to an external account (which we all know contains a trove of ether and tokens). So, how does ethereum distinguish a contract creation request from a value transfer request originating from sender to address 0x0..0?
Does the payload content of the data property then determine whether this is a contract creation request, e.g., parser sees to == 0x0 && data == 0x0
and results in value transfer to account 0x0..0.
1 Answer
Thanks to @Ismael who clarified how the RLP encoding handles data during contract initialization. It seems the encoding protocol can distinguish between empty byte array and address. The rules of the EVM are then different and irrelevant here.
Implementations can choose to handle payloads differently. For example, javascript web3 address entries of 0
& 0x0
no longer send value to the genesis address through web3, but are unfortunately interchangeable with undefined due to the behavior of JS. This change was made to web3 fairly recently... https://github.com/ethereum/web3.js/blob/59aae306c1c31ef6a65b9196e7f03af74c69e059/lib/web3/formatters.js#L274
This answers my own question, but thought it would be useful to post, since discussions of these finer points seem to be lacking in posts re: accidental payments to the genesis block address.