-
Notifications
You must be signed in to change notification settings - Fork 122
Description
This issue aims to extend the TokenMetadata required by Miden Confidential Token Standard. I’m also opening this issue as a response to the metadata section in the this discussion:
In addition, this issue and the related PR are aligned with the direction of the following conversation: #1949 and #1993
For the token standard, TokenMetadata currently covers:
token_supply: currently circulating tokensmax supply: maximum capsymbol: (12-character ASCII; see Increase max allowed characters inTokenSymbol#2406)decimals: since the value is stored as a felt, using 6 decimals is recommended. Higher decimals can make supplies and balances so small that they become impractical
Items to Discuss for the Token Standard:
description:
does not need to be defined as part of the standard.
name:
must be the part of the standard
contract_uri:
In the EIP for confidential fungible token standards, compliant tokens MUST implement contract_uri. In other words, this is not presented as an optional extension, it is part of the standard.
The primary motivation is to provide an additional mechanism for verifying critical public information associated with a token’s identity. From a compliant perspective, this acts as a complementary layer of validation. It is also offered as a standard feature on other chains such as Sui and Solana.
Therefore, contract_uri would be included as a mandatory part of the standard.
Related reference for contract-level metadata in EIPs: https://eips.ethereum.org/EIPS/eip-7572.
name
Length constraints:
- In EVM, name is a String do not enforce a strict character limit
- Solana and Algorand enforce 32-byte limits.
- In EVM, there are token names exceeding 32 bytes.
- If we choose 32 bytes, we can fit it into one storage slot, but using two storage slots enables a wider character set and longer names.
- 32 bytes → 1 storage slot (single storage value)
- 64 bytes → 2 storage slots (a double-word array may be a better fit)
Encoding:
- UTF-8
contract_uri
As noted above, contract_uri should be part of the standard.
Length constraints:
- On EVM, String implies effectively no strict limit.
- Solana uses 200 bytes, Algorand uses 96 bytes of fix contract_uri
- An unbounded URI may increase the DoS surface on Miden, so imposing a limit is reasonable. A practical bound could be 160–200 bytes, which corresponds to roughly 5–7 storage slots.
Encoding:
- UTF-8
Metadata Management
The metadata is controlled by the owner of the network accounts.
The set_contract_uri procedure is not inherently part of the standard and is opinionated. The following options should be considered:
- Do not implement it in the standard and users can implement it themselves if needed.
- Introduce an optional flag:
- Include a note indicating it is not part of the standard
- Use an explicit naming convention such as
optional_set_contract_uri - Use it with an optional flag as a part of the standard
#! Note
#! This procedure is not part of the Miden Confidential Token Standard.
#! It can be enabled optionally via a flag.
pub proc set_contract_uri
# exec.verify_owner
# set the new contract_uri
end