EIP-689 Contract creation fails on address collision (Address Collision of Contract Address Causes Exceptional Halt)
No call decision · EVM & execution · EIP status Stagnant · created 2017-08-15
Clarifies the rule that when creating a contract, if the target address already has code or a nonzero nonce, the creation must be treated as a failure.
Why it is needed
The Ethereum Yellow Paper specified that when creating a new contract, even if the target address already had code or a nonzero nonce, the creation process would restart from empty code and an initial nonce. Such address collisions only actually occur when a keccak256 hash collision happens, so they effectively never occur on mainnet, but the consensus test suite contained test cases covering this scenario, and client behavior differed. This EIP simplifies the rule so that creation simply fails on collision, removing the need for clients to separately implement logic to revert code overwrites, and establishing the invariant that once code is created it is never modified.
What changes
Today
- The Yellow Paper specified that even on address collision, creation restarts from empty code and an initial nonce
- Clients each had to implement their own handling to revert code overwrites
- Discrepancies in client behavior were found in the consensus test suite
After EIP-689
- If creation is attempted at an address with a nonzero nonce or non-empty code, it is treated as an exceptional halt, failing the creation
- Clients no longer need to implement logic to revert code overwrites
- The invariant that non-empty code is never modified now holds
Who is affected
- Client development teams: Implementation is simplified, since there is no longer a need to implement unused functionality just to pass tests.
- Testers and researchers: Discrepancies between clients in the consensus test suite are resolved and reasoning is simplified.
- Ordinary users: Since this change is only exposed when a keccak256 hash collision occurs, it has no practical impact on mainnet.
In depth
Scope
This rule applies both to contract creation transactions and to creation triggered by the CREATE opcode. If the target account already has a nonzero nonce or non-empty code, the creation is treated as failed, in the same way as if init code execution had caused an exceptional halt.
Applicable conditions
The specification states that this rule applies at every block where block.number >= 0. In other words, it is a rule retroactively applied to the entirety of Ethereum's history, not one that applies only from a specific fork onward.
Background of the issue
Under the existing Yellow Paper rules, creation should restart from empty code and an initial nonce on an address collision, but differences between clients emerged when actually implementing and testing this behavior. A blockchain test in the consensus test suite named createJS_ExampleContract_d0g0v0_EIP158 exposes this discrepancy.
Why the practical impact is minimal
An address collision only occurs when keccak256 hash values coincidentally match, which realistically does not happen on mainnet. The author explicitly states that this EIP has no practical relevance to mainnet history.
Relationship with EIP-86
After the Constantinople fork, EIP-86 incorporates the change proposed by this EIP, so this EIP itself has no separate effect after Constantinople.
Backward compatibility
This EIP is backward compatible on mainnet. It does not affect existing chain data or behavior.
Current status
This EIP is in Stagnant status, not an actively discussed state like Draft or Review. However, since its content has been incorporated into EIP-86 after Constantinople, there is little practical benefit in separately contesting its adoption.