Skip to content

refactor!: rename L1->L2 message content/secret to public_content_hash/private_content - #25773

Open
benesjan wants to merge 2 commits into
nextfrom
jb/rename-l1-to-l2-message-fields-next
Open

benesjan wants to merge 2 commits into
nextfrom
jb/rename-l1-to-l2-message-fields-next

Conversation

@benesjan

@benesjan benesjan commented Nov 6, 2026 •

Copy link
Copy Markdown
Contributor

Implements the rename agreed in governance discussion #52.

This is a pure rename fixing stale terminology (Aztec.nr also uses the new terminology).

Concept Old Solidity / TS Noir
hashed public payload content publicContentHash public_content_hash
L2-side preimage secret privateContent (Fr[]) private_content ([Field; N])
its commitment secretHash privateContentHash private_content_hash
hash helper computeSecretHash / compute_secret_hash computePrivateContentHash compute_private_content_hash
domain separator DOM_SEP__SECRET_HASH ("secret_hash") DomainSeparator.PRIVATE_CONTENT_HASH DOM_SEP__PRIVATE_CONTENT_HASH ("private_content_hash")

How this is split

L1 and Noir protocol changes live here; everything in aztec-node goes upstream.

  • This PR (foundation): l1-contracts (Inbox, FeeJuicePortal, interfaces, errors, test portals and tests), noir-projects/fnd (the domain separator in constants.nr and its test, the aztec_sublib copy of the L1→L2 helpers, FeeJuice), the regenerated genesis constants, and the labs side carried as labs-patches/0015-refactor-rename-L1-L2-message-content-secret-to-publ.patch so this tree's labs build and tests run against the renamed ABI and separator.
  • aztec-node: the same labs diff, rebased on aztec-node main, is refactor!: rename L1->L2 message content/secret to public_content_hash/private_content aztec-labs-eng/aztec-node#689. It can only go green once aztec-node's foundation pin (BB_VERSION in labs-aztec-toolchain/bootstrap.sh) moves to a foundation release that includes this PR. When it merges and this repo bumps the labs gitlink past it, patch 0015 drops out of the series.

Breaking changes

  • Protocol: the domain separator string was renamed, so the private content hash value changes. Pending L1→L2 messages whose hash was computed with the old helper cannot be consumed with the new one. FeeJuice hashes with it, so its class id rotates and the genesis constants move (regenerated with noir-projects/fnd/scripts/regenerate_genesis_constants.sh --fixtures; nothing hand-edited).
  • L1: Inbox.sendL2Message(_recipient, _publicContentHash, _privateContentHash), L1ToL2Msg struct / MessageSent event fields, Inbox__PublicContentHashTooLarge / Inbox__PrivateContentHashTooLarge (new selectors), FeeJuicePortal.depositToAztecPublic(..., _privateContentHash) and its event, reference TokenPortal / UniswapPortal.
  • Aztec.nr (aztec-node): consume_l1_to_l2_message(public_content_hash, private_content, sender, leaf_index), compute_private_content_hash, compute_l1_to_l2_message_{hash,nullifier} params, TXE send_l1_to_l2_message(public_content_hash, private_content: [Field; N], ...) / send_l1_to_l2_message_from_private_content_hash (TXE oracle version bumped). The aztec_sublib copy here follows the same names. FeeJuice.claim / TokenBridge.claim_* keep their secret params (used as the message's private content).
  • Aztec.js / stdlib (aztec-node): L1ToL2Message.{publicContentHash,privateContentHash}, computePrivateContentHash(privateContent: Fr[]) (mirrors Noir; computeSecretHash took a single field), computeFeeJuiceMessageNullifier / getNonNullifiedL1ToL2MessageWitness take privateContent: Fr[]. generateClaimSecret removed — use Fr.random() + computePrivateContentHash. L2Claim.claimSecret / claimSecretHash keep their names.
  • Bot (aztec-node): crosschain seeds and the inbox bot's persisted messages use the new field names; BotStore.SCHEMA_VERSION 2 → 3, so older stores are discarded on startup.
  • CLI (aztec-node): get-l1-to-l2-message-witness --private-content.

Out of scope: L2→L1 messages (L2ToL1Msg.content etc.), TransparentNote.secret_hash (app-level; only its compute_private_content_hash call updated), versioned docs, and this repo's docs/ (pinned to aztec-node's v6 line, which does not carry the rename).

Expected failures

  • labs/yarn-project/aztec/src/{mainnet,testnet}_compatibility.test.ts pin what the live networks were deployed with; the FeeJuice class id rotation breaks them until the corresponding governance upgrade. They only run on release branches and were deliberately not touched.

…h/private_content

Implements the rename agreed in governance discussion #52. The Inbox data model
is unchanged; the names now describe what the fields are: `content` is the
public content hash, `secret` is the private content and `secretHash` its hash.

- L1: `Inbox.sendL2Message(_recipient, _publicContentHash,
  _privateContentHash)`, the `L1ToL2Msg` struct and `MessageSent` event
  fields, `Inbox__PublicContentHashTooLarge` /
  `Inbox__PrivateContentHashTooLarge`, `FeeJuicePortal.depositToAztecPublic`
  and its event, the reference test portals.
- Protocol: `DOM_SEP__SECRET_HASH` ("secret_hash") becomes
  `DOM_SEP__PRIVATE_CONTENT_HASH` ("private_content_hash"), so the private
  content hash value changes. The `aztec_sublib` L1->L2 helpers follow the
  new names. FeeJuice hashes with the separator, so its class id rotates:
  genesis constants, the C++ seed vector and the L1 checkpoint fixtures were
  regenerated with regenerate_genesis_constants.sh --fixtures.
- Labs: the aztec-node side is carried as labs-patches/0015 until it lands
  upstream.

This branch has not been deployed

No deployments
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.

1 participant