4

I was reading the solidity docs and I don't quite understand what the zero-account is.

They say: "If the target account is the zero-account (the account with the address 0), the transaction creates a new contract. As already mentioned, the address of that contract is not the zero address but an address derived from the sender and its number of transactions sent (the “nonce”). "

Does anyone have a different explanation?


From Introduction to Smart Contracts - Transactions:

Transactions

A transaction is a message that is sent from one account to another account (which might be the same or the special zero-account, see below). It can include binary data (its payload) and Ether.

If the target account contains code, that code is executed and the payload is provided as input data.

If the target account is the zero-account (the account with the address 0), the transaction creates a new contract. As already mentioned, the address of that contract is not the zero address but an address derived from the sender and its number of transactions sent (the “nonce”). The payload of such a contract creation transaction is taken to be EVM bytecode and executed. The output of this execution is permanently stored as the code of the contract. This means that in order to create a contract, you do not send the actual code of the contract, but in fact code that returns that code.

2

The "zero account" is really just the fake account associated with the address 0x00000...

Sending funds there doesn't actually transfer them to the account; instead, the miners interpret this as an instruction to create a new smart contract.

1

Paraphrase:

If the transaction does not supply a target address (ie it instead sends zeroes where the address would go), the transaction creates a new contract. As already mentioned, the address of that contract is an address derived from the sender and its number of transactions sent (the “nonce”). "

  • ` (ie it instead sends zeroes where the address would go)` is surprisingly clarifying. I was getting mixed up between address 0 and transaction output 0 in bitcoins – Daniel Kobe Mar 25 '17 at 22:28
0

Section 4.2 : The Transaction from the Ethereum Yellow Paper (p4-5) defines the "zero-address / zero-account" as an:

RLP empty byte sequence.

So it Ethereum or Solidity, it looks like:

0x0000000000000000000000000000000000000000    // "zero-address" = 20 bytes of '00'

As described below, there is a conditional check to see if the transaction intend to transfer funds or create a new contract:

  • If it's a 20-byte address hash, then it is a transfer of ethers.
  • If it's an RLP empty byte sequence, then it is a contract creation.

Zero address from the Ethereum Yellow Paper

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.