Hello everyone,
In this proposal, I’d like to propose a standard for onchain token metadata.
Motivation
The current Cardano token registry is held in a github repository, GitHub - cardano-foundation/cardano-token-registry. The challenge with managing token metadata off chain is it requires both centralization and a level of trust in both the managing party and the process by which new tokens are added to the registry. This approach creates potential opportunities for abuse.
Proposal
Instead of storing the metadata off chain, I propose that the metadata is stored on chain in a manner similar to the very successful NFT standard. I would propose a new metadata label:
-
transaction_metadatum_label
- 20 (as a hat tip to the ERC20 standard) -
description
- Token Metadata
To provide flexibility developers with respect to their minting scripts, the metadata can be associated with any transaction that mints the given policy id and does not require that the specific asset id be minted in the transaction.
The first valid occurrence of a policy id and asset name pair will be considered authoritative and immutable.
{
"20": {
"<policy-id>": {
"<asset-name>": {
"ticker": "SUNDAE",
"url": "https://dex.sundaeswap.finance",
"logo": "ipfs://ipfs/<ipfs-hash>",
"logo-<size>": "ipfs://ipfs/<ipfs-hash>",
"validation": "https://dex.sundaeswap.finance/assets/{policy-id}.{asset-name}",
"decimals": 6,
"version": "1.0",
<other properties>
}
}
}
}
-
ticker
- is an optional field and overrides the which is the default ticker -
url
- should point to the team url. allows external parties to take the reputation of the url into account when evaluating the trust worthiness of the token. As value of this trust wanes with time as token gains a history of on chain usage, it’s ok if this url is incorrect at some point in the future (because the team is defunct or changes urls) -
logo
- should be eitherhttps
,ipfs
, ordata
-
logo-<size>
- allows teams to optionally provide their logo in different sizes. the recommended values of size are 16, 32, 64, 96, 128. logos are assumed to be square so thatlogo-64
would refer to a 64x64 logo -
validation
- provides protection against malicious parties attempting to forge a token from a real time. -
decimals
- how many decimal places should the token support? For ADA, this would be 6 e.g. 1 ADA is 10^6 Lovelace -
version
- of this proposal
Off-chain Approach
Because of transaction size constraints, an off-chain approach is also supported:
{
"20": {
"<policy-id>": {
"<asset-name>": {
"offchain": "ipfs://ipfs/<ipfs-hash",
"version": "1.0",
}
}
}
}
-
offchain
- the ipfs url containing the metadata block (see below) -
version
- of this proposal
offchain metadata block
{
"ticker": "SUNDAE",
"url": "https://dex.sundaeswap.finance",
"logo": "ipfs://ipfs/<ipfs-hash>",
"logo-<size>": "ipfs://ipfs/<ipfs-hash>",
"validation": "https://dex.sundaeswap.finance/assets/{policy-id}.{asset-name}",
"decimals": 6,
"version": "1.0",
<other properties>
}