Skip to content

Commit

Permalink
Specify initcode hashing to allow hashing once
Browse files Browse the repository at this point in the history
  • Loading branch information
pdobacz committed Dec 7, 2023
1 parent e3ed7cc commit 7d7870c
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions spec/eof.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,22 @@ EIP-3860 and EIP-170 still apply, i.e. `MAX_CODE_SIZE` as 24576, `MAX_INITCODE_S

Legacy creation transactions (any tranactions with empty `to`) are invalid in case `data` contains EOF code (starts with `EF00` magic).

### Signature

Given the definitions of transaction fields from [EIP-1559](https://eips.ethereum.org/EIPS/eip-1559), for an `InitcodeTransaction` the signature values `y_parity`, `r`, and `s` are calculated by constructing a secp256k1 signature over the following digest:

```
keccak256(INITCODE_TX_TYPE || rlp([chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, to, value, data, access_list, initcode_digest]))
```

where `initcode_digest` is a hash of the concatenation of hashes of `initcodes`.

```
keccak256([keccak256(initcode) for initcode in initcodes])
```

This hashing construction allows clients to hash `initcodes` once to cover both transaction hashing and `initcode` lookup (see `CREATE4`).

## Execution Semantics

Code executing within an EOF environment will behave differently than legacy code. We can break these differences down into i) changes to existing behavior and ii) introduction of new behavior.
Expand Down

0 comments on commit 7d7870c

Please sign in to comment.