Skip to content

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

Draft
benesjan wants to merge 2 commits into
merge-train/spartanfrom
jb/rename-l1-to-l2-message-fields
Draft

refactor!: rename L1->L2 message content/secret to public_content_hash/private_content#25374
benesjan wants to merge 2 commits into
merge-train/spartanfrom
jb/rename-l1-to-l2-message-fields

Conversation

@benesjan

@benesjan benesjan commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Implements the rename agreed in governance discussion #52. The Inbox data model is unchanged; the names now describe what the fields are:

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")

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. TS↔Noir test vectors regenerated.
  • 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: 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 / send_l1_to_l2_message_from_private_content_hash. Applied to both aztec-nr and the aztec_sublib copy. FeeJuice.claim / TokenBridge.claim_* keep their secret params (used as the message's private content).
  • Aztec.js / stdlib: 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 store schema bumped.
  • CLI: get-l1-to-l2-message-witness --private-content. claimSecret= payment arg and generate-secret-and-hash unchanged (hash values differ).

Migration notes added. Out of scope: L2→L1 messages (L2ToL1Msg.content etc.), TransparentNote.secret_hash (app-level; only its compute_private_content_hash call updated), versioned docs.

Labs submodule

The labs components (yarn-project, aztec-nr, noir-contracts, docs) are built from the labs/ submodule, so the labs side of the rename is carried as labs-patches/0004-refactor-rename-L1-L2-message-content-secret-to-publ.patch (the same diff as the in-tree copies, minus the already-removed generate-secret-and-hash CLI command). It needs to be upstreamed to aztec-node (labs-patches/bootstrap.sh upstream 4).

Testing

  • forge test for Inbox, buckets, fee portal, portals, rollup suites: green.
  • nargo test for protocol constants_tests (derives the new separator) and aztec-nr hash vector: green.
  • yarn build in yarn-project: clean. Unit tests in stdlib (hash/messaging), bot, txe: green.
  • Relying on CI for PXE private_execution.test.ts L1→L2 cases, TXE-backed l1_to_l2_messages.nr tests and the cross-chain e2e suites.

@benesjan
benesjan marked this pull request as ready for review September 1, 2026 10:59
@benesjan
benesjan removed request for a team, LeilaWang, just-mitch and nventuro September 1, 2026 11:00
… a patch

The labs components (yarn-project, aztec-nr, noir-contracts, docs) are built
from the labs/ submodule, not the in-tree copies, so the rename has to reach
them through the labs-patches series. Patch 0004 is the labs side of this
change; the in-tree copies remain updated for consistency.
@benesjan
benesjan marked this pull request as draft September 1, 2026 13:49
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