Skip to content

AZIP 4: Add L1 Block info to public and private context#13

Open
joeandrews wants to merge 5 commits intoAztecProtocol:mainfrom
joeandrews:main
Open

AZIP 4: Add L1 Block info to public and private context#13
joeandrews wants to merge 5 commits intoAztecProtocol:mainfrom
joeandrews:main

Conversation

@joeandrews
Copy link
Copy Markdown

@joeandrews joeandrews commented Apr 17, 2026

Draft AZIP to discuss adding L1 block info including storage roots to L2 private and public context.

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.
@joeandrews joeandrews requested a review from a team April 17, 2026 10:41
Copy link
Copy Markdown

@critesjosh critesjosh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Assigned as AZIP-4 and a couple of nits

Comment thread AZIPs/azip-4.md

| `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 |
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| 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 |

Comment thread AZIPs/azip-4.md

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.
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The template.md requires a Rationale section, distinct from Motivation. I think this line would make sense to include in the Rationale section

Comment thread AZIPs/azip-4.md

New fields in `GlobalVariables`, `BlockHeader`, `CheckpointConstantData`, `CheckpointHeader`, and `ProposedHeader` break the block format. Upgrade via AZUP. Existing contracts unaffected.

## Testing
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
## Testing
## Test Cases

for consistency

@just-mitch
Copy link
Copy Markdown
Contributor

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

backend hello_world verify_el_state_root delta ratio
wasm 16.0 s 16.8 s 744 ms 1.05x
native 7.1 s 7.7 s 571 ms 1.08x

Based on this, I think we ought to only include the beacon block hash.

@iAmMichaelConnor
Copy link
Copy Markdown

iAmMichaelConnor commented Apr 27, 2026

Based on this, I think we ought to only include the beacon block hash.

Cool exploration! I'm not sure I agree with the tradeoff though (yet) -- a 5%-8% slow-down for a slightly tidier design.

My mind might be swayed if:

  • Proving system optimisations in Q2 are fruitful
  • We realise that the design of copying-over ~6 L1 block header fields would slow down the rollup (I think the extra sha256 constraints in the parity circuits will not be a bottleneck, but that would need to be checked).

@just-mitch
Copy link
Copy Markdown
Contributor

Cool exploration! I'm not sure I agree with the tradeoff though (yet) -- a 5%-8% slow-down for a slightly tidier design.

No problem. I didn't know what any hard requirements were here. Are you saying that the EL state root must be available for free to applications? I would be willing to make applications that want to use the EL state root "pay" an additional second to save the protocol extra hashing and reduce the time to market and risk of bugs. If we found that users were making heavy use of this feature, we could always bring the hashing in-protocol later.

We probably ought to include a list of requirements we intend to meet at the top of these AZIPs, otherwise it will devolve into gut-checks of what individuals like more on a given day.

@iAmMichaelConnor
Copy link
Copy Markdown

@just-mitch I cc'd you on a refactored version of this AZIP, including a list of "cons" that need to be considered -- cons which are likely more of a sticking point than the above discussion.

Not actually sure of the most elegant way to incorporate those thoughts here. A PR into Joe's branch? Kind of ugly.

We probably ought to include a list of requirements we intend to meet at the top of these AZIPs

I think that's what the Motivation section is for.

@just-mitch
Copy link
Copy Markdown
Contributor

refactored version

👍 Thanks Mike

@mralj
Copy link
Copy Markdown

mralj commented Apr 29, 2026

@just-mitch I cc'd you on a refactored version of this AZIP, including a list of "cons" that need to be considered -- cons which are likely more of a sticking point than the above discussion.

Not actually sure of the most elegant way to incorporate those thoughts here. A PR into Joe's branch? Kind of ugly.

We probably ought to include a list of requirements we intend to meet at the top of these AZIPs

I think that's what the Motivation section is for.

Maybe we should close this PR and you, @iAmMichaelConnor, open the PR with updated AZIP-4 referencig this (would be closed PR)
I see your PR as an improved version/superset of @joeandrews version, so I don't think anything material would be lost.
And it wuld streamline giving feedback & future discussion :)

@iAmMichaelConnor
Copy link
Copy Markdown

@iAmMichaelConnor, open the PR with updated AZIP-4 referencig this (would be closed PR)

Good idea, I'll open a PR shortly

@joeandrews
Copy link
Copy Markdown
Author

joeandrews commented Apr 30, 2026

All good to close mine @iAmMichaelConnor. Thanks for refactoring. @just-mitch we also need to account for the mana cost of ssz, maybe its negligible but I imagine a lot of use cases will defer the SSZ to a public function to do. Maybe thats a good for fees though :D

@iAmMichaelConnor
Copy link
Copy Markdown

As per above, closing and continuing discussion here: #24

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants