AZIP 4: Add L1 Block info to public and private context#13
AZIP 4: Add L1 Block info to public and private context#13joeandrews wants to merge 5 commits intoAztecProtocol:mainfrom
Conversation
This AZIP introduces L1 block roots into the Noir contract execution context, enabling trustless reads of L1 state, transactions, and receipts. It outlines the specification for accessing these roots and their implications for various stakeholders.
This AZIP proposal updates the context for accessing L1 block header data in Noir contracts, enhancing the ability to read Ethereum state without oracles. It introduces a new structure for L1 block header fields, optimizing the protocol for trustless reads and reducing gas costs.
Updated the 'discussions-to' field in the AZIP preamble to include a link to the relevant GitHub discussion.
critesjosh
left a comment
There was a problem hiding this comment.
Assigned as AZIP-4 and a couple of nits
|
|
||
| | `azip` | `title` | `description` | `author` | `discussions-to` | `status` | `category` | `created` | | ||
| | ------ | ---------------------- | ---------------------------------------------------------------------------------------- | --------------------------------------------- | ---------------------------------------------------------- | -------- | ---------- | ---------- | | ||
| | TBD | L1 Block Header Access | Make L1 block header data available to Noir contracts via a single Poseidon2 commitment. | Joe Andrews (@joeandrews, joe@aztec-labs.com) | https://github.com/AztecProtocol/governance/discussions/12 | Draft | Core | 2026-04-17 | |
There was a problem hiding this comment.
| | TBD | L1 Block Header Access | Make L1 block header data available to Noir contracts via a single Poseidon2 commitment. | Joe Andrews (@joeandrews, joe@aztec-labs.com) | https://github.com/AztecProtocol/governance/discussions/12 | Draft | Core | 2026-04-17 | | |
| | 4 | L1 Block Header Access | Make L1 block header data available to Noir contracts via a single Poseidon2 commitment. | Joe Andrews (@joeandrews, joe@aztec-labs.com) | https://github.com/AztecProtocol/governance/discussions/12 | Draft | Core | 2026-04-17 | |
|
|
||
| As Aztec is an Ethereum rollup. Every checkpoint already references an L1 block. This AZIP exposes that block's header to contracts, so any L1 state can be proven with a Merkle-Patricia trie proof in Noir, with no trust beyond L1 consensus. | ||
|
|
||
| Rather than adding six fields to `GlobalVariables` (six Fields in every `BlockHeader` hash, six AVM opcodes, six fields through the rollup circuits), we commit them behind a single Poseidon2 hash. Contracts provide the preimage as a witness and open it — one hash check. One Field, one opcode, and extensible: adding header fields later requires only a preimage struct update. |
There was a problem hiding this comment.
The template.md requires a Rationale section, distinct from Motivation. I think this line would make sense to include in the Rationale section
|
|
||
| New fields in `GlobalVariables`, `BlockHeader`, `CheckpointConstantData`, `CheckpointHeader`, and `ProposedHeader` break the block format. Upgrade via AZUP. Existing contracts unaffected. | ||
|
|
||
| ## Testing |
There was a problem hiding this comment.
| ## Testing | |
| ## Test Cases |
for consistency
|
I investigated the cost of doing an SSZ proof of an EL state root within an CL block hash https://github.com/just-mitch/ssz Looks like it is roughly 110k gates. Compared to basically a no-op "hello world" transaction (which models the case where the EL state root is provided in the global variables directly), the inclusion proof generation time is
Based on this, I think we ought to only include the beacon block hash. |
Draft AZIP to discuss adding L1 block info including storage roots to L2 private and public context.