Skip to content

Token Metadata extension to form standard.#2439

Open
afa7789 wants to merge 28 commits into0xMiden:nextfrom
afa7789:oz/metadata_extension
Open

Token Metadata extension to form standard.#2439
afa7789 wants to merge 28 commits into0xMiden:nextfrom
afa7789:oz/metadata_extension

Conversation

@afa7789
Copy link
Contributor

@afa7789 afa7789 commented Feb 12, 2026

Unified metadata: One place for account/faucet metadata: token (symbol, decimals, max_supply), owner, name, and content URI. Slot names live under miden::standards::metadata::* (and ownable for owner).

Layout: Token metadata and owner in slots 0–1; name in 2 words (name_0, name_1); content URI in 6 words (content_uri_0..5). Same layout in Rust and MASM.

Faucets: Basic and network fungible faucets support optional name and content URI; both re-export metadata getters (get_name, get_content_uri, get_token_metadata, get_max_supply, get_decimals, get_token_symbol; network also get_owner).

Standalone Info: Non-faucet accounts can use the metadata Info component (name + content URI) for future use (e.g. NFTs).

Testing: Unit tests in miden-standards (metadata storage, recovery); integration tests in miden-testing (MASM getters, faucet + metadata).

@afa7789 afa7789 marked this pull request as ready for review February 12, 2026 20:12
@afa7789 afa7789 force-pushed the oz/metadata_extension branch from 9be0d29 to 55282e1 Compare February 14, 2026 12:46
  Replace the single StorageMap-based MetadataExtension with plain value
  slots for name (2 Words) and content URI (6 Words).

  - Define 8 value slot names (name_chunk_0..1, content_uri_0..5)
  - Update MetadataExtension struct to use [Word; 2] and [Word; 6]
  - Replace MASM `get` proc with `get_name` + `get_content_uri_0..5`
  - Use @Locals with loc_storew_be/loc_loadw_be to maintain call-frame
    stack depth of 16
  - Update BasicFungibleFaucet and NetworkFungibleFaucet accordingly
  - Rewrite integration tests for new value-slot access patterns
@afa7789 afa7789 force-pushed the oz/metadata_extension branch from 55282e1 to b1dba96 Compare February 14, 2026 12:48
account_storage_mode: AccountStorageMode,
auth_scheme: AuthScheme,
name: Option<TokenName>,
logo_uri: Option<TokenLogoURI>,
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we have both logo_uri & content_uri? we can rename it later for NFTs

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, renaming it, u right.

Copy link
Contributor

Choose a reason for hiding this comment

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

Thank you. contract_uri would be a better option.

@onurinanc
Copy link
Contributor

@afa7789 In the context of token metadata discussion #2423 : Let's keep the contractURI as optional.

Basically, instead of:

 name: Option<TokenName>,
 contract_uri: Option<TokenContractURI>

We need to have:

 name: TokenName,
 contract_uri: Option<TokenContractURI>

@onurinanc
Copy link
Contributor

We should also consider adding the corresponding metadata and the new constructor to the network fungible faucets: https://github.com/afa7789/miden-base/blob/f7426116833b1f76da3195738ccb838a52880f80/crates/miden-standards/src/account/faucets/network_fungible.rs#L93-L101

@onurinanc
Copy link
Contributor

@afa7789 we should also add a flag and procedure to change max_supply. It's basically similar to have we have done in optional_set_contract_uri

@afa7789
Copy link
Contributor Author

afa7789 commented Feb 17, 2026

@afa7789 we should also add a flag and procedure to change max_supply. It's basically similar to have we have done in optional_set_contract_uri

In this branch ? pr ?

- Updated all references from content URI to contract URI in metadata module.
- Adjusted related functions and tests to reflect the new naming convention.
- Modified BasicFungibleFaucet and NetworkFungibleFaucet to include TokenName.
- Ensured compatibility in tests for contract URI handling.
@onurinanc
Copy link
Contributor

@afa7789 we should also add a flag and procedure to change max_supply. It's basically similar to have we have done in optional_set_contract_uri

In this branch ? pr ?

Yes, it would be better if you can have this in this PR.

@afa7789 afa7789 changed the title Oz/metadata extension Token Metadata extension to form standard. Feb 19, 2026
@afa7789
Copy link
Contributor Author

afa7789 commented Feb 19, 2026

@bobbinth @mmagician this is ready for review :)

@mmagician mmagician added the pr-from-maintainers PRs that come from internal contributors or integration partners. They should be given priority label Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-from-maintainers PRs that come from internal contributors or integration partners. They should be given priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants