Metadata and decimals
Optional metadata fields, how to treat them, and the exact rule about decimals that prevents an entire class of accounting bug.
Protocol behavior Verified 2026-08-31
Describes the Atomicals protocol itself at the pinned reference revision. It does not promise that any product exposes it.
- Page ID
-
protocol/arc20/metadata-and-decimals - Normative authority
- Atomicals reference implementation
- Networks
- mainnet
- Documentation version
- 2026.08
- Audience
- everyone, developer
- Owner
- bitcoin-universe-docs
- Sources
-
- Atomicals protocol guide
at
unversioned - Atomicals ElectrumX
at
v1.5.2.0
- Atomicals protocol guide
at
Это содержимое пока не доступно на вашем языке.
ARC-20 metadata is an optional JSON object supplied by the minter. Common fields are name,
desc, image, decimals, links, and legal.
Treat all of it as untrusted
Section titled “Treat all of it as untrusted”Metadata is arbitrary content written by whoever minted the token. It is never checked. See metadata trust boundaries for the renderer and interface rules.
| Field | What it does | What it proves |
|---|---|---|
name |
A display label | Nothing |
desc |
A description | Nothing |
image |
A media reference | Nothing about rights or origin |
links |
Social or site links | Nothing about affiliation |
legal |
Legal text | Nothing enforceable is created by writing it |
decimals |
Display formatting | Nothing about the unit model |
The decimals rule
Section titled “The decimals rule”decimals is presentation metadata. It never creates sub-satoshi units.
Native ARC-20 quantities are integers, always. A token with decimals of 8 and 100 000 000 native
units may be displayed as 1.00000000. On chain there are 100 000 000 coloured satoshis.
The bug this prevents
Section titled “The bug this prevents”A product reads decimals of 8, divides every native quantity by 100 000 000 for display, and
then feeds a formatted figure back into a transfer builder. The builder now asks for a fraction of
a satoshi, or rounds to something the user did not intend.
The rule that prevents it
Section titled “The rule that prevents it”- Store and compute in native integer units only.
- Format for display at the last moment, in the view layer.
- Never parse a formatted figure back into a quantity.
- Never let a formatted figure reach a transaction builder.
- Treat a missing
decimalsas zero, not as a default of eight.
Sanitisation
Section titled “Sanitisation”Before displaying any metadata field:
- escape it, always;
- strip or refuse markup;
- validate that link targets are absolute HTTP or HTTPS URLs;
- mark external links as external and do not follow them automatically;
- check the name for confusable characters against tokens the user already holds.