MIP-0018

On-chain token
metadata

Events for token metadata

Proposed Standards Requires MIP-0002

Today

A wallet sees this

contract-issued UTXO

0x9f3c7a1e
...b204e1

or

contract token

nothing

MIP-0018

A dual proposal

Token metadata fields

what a token says about itself

+

Transport

how it says it, on chain

The contract says what its token is

contract the issuer emit event 256 bytes name, symbol, decimals indexer network calls wallet A ACME 6 decimals 1234.56

No protocol change

Goals

1

Good UI,
for humans (and robots)

name, ticker, decimals, logo
from an indexer alone

2

Safe

authoritative
on chain

3

A base for
other MIPs

new keys, same transport

Why events

Bound to its emitter
Append-only
Not consensus state
Ships today (soon)

Getters need execution. Registries need registration.

One asset, three forms

kindrepresentationcolor
1shielded UTXOyes
2unshielded UTXOyes
3contract tokenno

Each form is described on its own

Example

1 · MIP-0011native shielded token
2 · MIP-0014native unshielded token
3 · MIP-0004fungible token, converts to UTXOs

What metadata attaches to

from the event, never the payload network contractAddress domainSep kind one contract, many tokens one token, many forms

people group them by symbol →

What a person sees

kind 1 ACME kind 2 ACME kind 3 ACME A ACME one row in the wallet

defined by domainSep + kind

grouped by symbol + contract address

Six fields

namestring, 64SHOULD
symbolstring, 12SHOULD
decimalsuintSHOULD
standardsstringMAY
imageURIMAY
image_sha25632 bytesMAY

NOT SERVED   description · url · bridge · supply · localization

valid to emit, ignored by default

Future MIPs add keys

1 the token emits standards = "mip-yyyy mip-zzzz" 2 the MIPs define keys mip-yyyy issuer, jurisdiction mip-zzzz animation, collection 3 indexers and wallets implement the standards the keys are served one transport, unchanged mip-0018:token-metadata[v1]

new keys, no new version

served while the token declares the standard

What goes elsewhere

Off chain

supply
prices
images

Registry

which ACME
is real

Protocol

NIGHT
DUST

Circuits
(future)

complex rules
execution

The event

Misc { name: pad(32, "mip-0018:token-metadata[v1]") payload: Bytes<256> }
other name: ignore bad payload: reject all

256 bytes

domainSep 32 kind 1 records zeros 0 32 33 256 one record, repeated with no gaps keyLen key valType valLen value 1 byte keyLen bytes 1 byte 1 byte valLen bytes

0 bytes · 1 string · 2 uint · 3 JSON · 4 URI · 5 null

33 04 6e616d65 01 0a 41636d6520546f6b656e name = "Acme Token" 50 06 73796d626f6c 01 04 41434d45 symbol = "ACME" 63 08 646563696d616c73 02 01 06 decimals = 6 75 09 7374616e6461726473 01 08 6d69702d30303034 standards = "mip-0004"

All four fields: 95 of 256 bytes

COST 219-byte values one token per event no multipart big content off chain