Skip to content

Use Local Exit Root in burn note serial number computation#2498

Closed
Copilot wants to merge 3 commits intopgackst-user-asset-key-valuefrom
copilot/sub-pr-2410
Closed

Use Local Exit Root in burn note serial number computation#2498
Copilot wants to merge 3 commits intopgackst-user-asset-key-valuefrom
copilot/sub-pr-2410

Conversation

Copy link
Contributor

Copilot AI commented Feb 23, 2026

Nothing prevents two valid B2AGG notes with the same serial number and same asset from producing identical burn note serial numbers. The fix incorporates the updated Local Exit Root — which changes with every bridge-out — into the serial number hash.

Changes

  • compute_burn_note_serial_num: Changed hash from hash(B2AGG_SERIAL_NUM, ASSET_KEY) to a two-step computation:
    partial = hash(B2AGG_SERIAL_NUM, ASSET_KEY)
    serial_num = hash(partial, LOCAL_EXIT_ROOT)
    
  • bridge_out: After add_asset_message, retrieves the updated Local Exit Root via mmr_frontier_keccak_get_root and stores its first word at LOCAL_EXIT_ROOT_MEM_PTR (address 44) for use downstream in serial number computation.
  • LOCAL_EXIT_ROOT_MEM_PTR=44: New constant for the temporary root storage slot between the MMR update and burn note creation.

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 23, 2026 16:10
…ness

Co-authored-by: mmagician <8402446+mmagician@users.noreply.github.com>
Co-authored-by: mmagician <8402446+mmagician@users.noreply.github.com>
Copilot AI changed the title [WIP] Update miden::protocol refactor for serial number uniqueness Use Local Exit Root in burn note serial number computation Feb 23, 2026
Copilot AI requested a review from mmagician February 23, 2026 16:11
@mmagician mmagician closed this Feb 23, 2026
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.

2 participants