fix(nft)!: align note-hashing with upstream aztec-nr scheme - #37
Merged
alejoamiras merged 1 commit intoSep 29, 2026
Merged
Conversation
This was referenced Aug 19, 2026
alejoamiras
force-pushed
the
stack/closeout-nft-notehash
branch
from
August 19, 2026 16:16
d17b64d to
252c352
Compare
This comment has been minimized.
This comment has been minimized.
BREAKING: changes NFTNote hashes, so a fixed contract deploys under a new class id. Existing on-chain NFT notes were created under the old scheme and will not match; in-flight partial notes must be drained or abandoned before upgrading code at an existing address, and PXE/wallet note databases must use the artifact matching each deployed class. nft_note.nr used a pre-refactor hashing scheme that diverged from both upstream and this repo's own multitoken_note.nr: - compute_partial_commitment used the generic DOM_SEP__NOTE_HASH; now uses the dedicated DOM_SEP__PARTIAL_NOTE_COMMITMENT. - compute_complete_note_hash hand-rolled the preimage with the storage slot in the middle ([commitment, storage_slot, token_id]); now calls aztec-nr's compute_note_hash(storage_slot, [commitment, token_id]), which fixes the slot first (preventing cross-slot collisions). Both the direct note-hash path and the partial-note completion path route through the same two functions, so directly-created and completed-partial notes remain indistinguishable. Ported upstream's note_hash_matches_completed_partial_note_hash test to lock that invariant, and corrected two comments that wrongly claimed the partial commitment includes the storage slot. Validated: nft_contract 65 Noir tests, NFT TS integration suite 9/9 against a local sandbox (proving PXE note discovery works with the new scheme), aztec compile OK. Codex adversarial review: matches upstream, correct, internally consistent. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
alejoamiras
force-pushed
the
stack/closeout-nft-notehash
branch
from
September 28, 2026 14:00
252c352 to
c6a4513
Compare
alejoamiras
removed this pull request from stack #39
September 28, 2026 14:01
alejoamiras
added this pull request to stack #40
September 28, 2026 14:02
alejoamiras
marked this pull request as ready for review
September 28, 2026 14:02
Benchmark Comparison
Contract: escrow
Contract: logic
Contract: multitoken
Contract: nft
Contract: token
Contract: vault
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
zac-williamson
self-requested a review
September 29, 2026 14:56
zac-williamson
approved these changes
Sep 29, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A fixed contract deploys under a new class id. Existing on-chain
NFTNotes were created under the old scheme and will not match. Practically:What changed
nft_note.nrused a pre-refactor hashing scheme that diverged from upstream and from this repo's ownmultitoken_note.nr— two custom notes in one repo disagreeing for no reason:compute_partial_commitmentDOM_SEP__NOTE_HASHDOM_SEP__PARTIAL_NOTE_COMMITMENTcompute_complete_note_hash[commitment, storage_slot, token_id](slot in the middle)compute_note_hash(storage_slot, [commitment, token_id])— the aztec-nr util, slot firstBoth the direct note-hash path and the partial-note completion path route through these two functions, so directly-created and completed-partial notes stay indistinguishable. Ported upstream's
note_hash_matches_completed_partial_note_hashtest to lock that invariant, and corrected two comments that wrongly claimed the partial commitment includes the storage slot.Validation
nft_contract65 Noir tests · NFT TS integration 9/9 against a local sandbox — the load-bearing proof that PXE note discovery works under the new scheme ·aztec compileOK.Codex adversarial review: "matches upstream, correct, internally consistent."