Skip to content

Add network faucet & MINT & BURN notes.#1925

Merged
mmagician merged 90 commits intonextfrom
ajl-ntx-faucet
Oct 29, 2025
Merged

Add network faucet & MINT & BURN notes.#1925
mmagician merged 90 commits intonextfrom
ajl-ntx-faucet

Conversation

@partylikeits1983
Copy link
Copy Markdown
Member

This PR adds a network faucet component and two new notes for interacting with it: MINT and BURN.

Resolves: #1899 & #1891

Network Fungible Faucet (NTX faucet)

The network fungible faucet with note based authentication builds on top of the standard fungible faucet miden/faucet.masm, however, has a few key differences:

  1. Requires an extra storage slot to contain the OWNER_CONFIG, where OWNER_CONFIG is defined as [owner_prefix, owner_suffix, 0, 0]. The two empty Felts in the config word can be used to have different account ids for burn/mint privileges.
  2. Instead of exporting the distribute and burn procedures like the basic_fungible_faucet, the network faucet adds "wrapper" procedures around the distribute and burn procedures. These wrapper procedures check if the sender of the active note is the owner of the faucet.

This is what these wrapper procedures look like:

#! Inputs: [amount, tag, aux, note_type, execution_hint, RECIPIENT]
#! Outputs: [note_idx]
export.distribute
    exec.is_owner
    # => [is_owner, amount, tag, aux, note_type, execution_hint, RECIPIENT]

    assert.err=NOT_OWNER
    # => [amount, tag, aux, note_type, execution_hint, RECIPIENT]

    exec.basic_fungible::distribute
    # => [note_idx]
end

#! Inputs: [ASSET]
#! Outputs: [ASSET]
export.burn
    exec.is_owner
    # => [is_owner, ASSET]

    assert.err=NOT_OWNER
    # => [ASSET]

    exec.basic_fungible::burn
    # => [ASSET]
end

@partylikeits1983 partylikeits1983 self-assigned this Sep 23, 2025
@partylikeits1983 partylikeits1983 added the agglayer PRs or issues related to AggLayer bridging integration label Sep 23, 2025
@partylikeits1983 partylikeits1983 marked this pull request as ready for review September 25, 2025 16:27
@partylikeits1983 partylikeits1983 changed the title WIP: add network faucet & MINT & BURN notes. Add network faucet & MINT & BURN notes. Sep 25, 2025
Copy link
Copy Markdown
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Thank you! Looks good. Not a full review but I left some comments inline. Some of the, are more like open questions for the future which probably don't need to affect this PR. To summarize some of them:

  • Do we want the MINT and/or BURN notes to be generic - i.e., work for non-fungible assets as well?
  • Should we assume that the BURN note always carries 1 asset? This is somewhat related to the first question, but also may impact fee handling.

mmagician and others added 21 commits October 27, 2025 12:22
… in test (#2013)

* chore: explicitly try consume both authenticated and unauthenticated note

* chore: update test description
- Migrated documentation from mdbook to docusaurus
- Updated protocol_library.md with detailed formatting and resolved merge conflicts
- Added proper markdown links and structure
- Incorporated new procedures from next branch
- Added build and deployment workflows for docs
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
Co-authored-by: Philipp Gackstatter <PhilippGackstatter@users.noreply.github.com>
@partylikeits1983
Copy link
Copy Markdown
Member Author

Addressed all of @PhilippGackstatter's comments. Biggest change is the refactoring of NetworkFungibleFaucet to improve type safety and deduplication of logic between BasicFungibleFaucet & NetworkFungibleFaucet.

Now it looks like this:

pub struct NetworkFungibleFaucet {
    faucet: BasicFungibleFaucet,
    owner_account_id: AccountId,
}

Copy link
Copy Markdown
Contributor

@bobbinth bobbinth left a comment

Choose a reason for hiding this comment

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

Looks great! Thank you! I left just one small comment inline. After it is addressed, we are good to merge. 🎉

@mmagician mmagician merged commit 231b2a5 into next Oct 29, 2025
17 checks passed
@mmagician mmagician deleted the ajl-ntx-faucet branch October 29, 2025 13:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agglayer PRs or issues related to AggLayer bridging integration

Projects

None yet

Development

Successfully merging this pull request may close these issues.

AggLayer BURN note

9 participants