ERC-1155 URI examples and the {id} placeholder
When an ERC-1155 metadata URI contains {id}, clients replace it with the token ID as lowercase hexadecimal, padded to 64 characters without 0x.
Worked example
| Input | Illustrative value | Meaning |
|---|---|---|
| Token ID | 42 | Decimal integer |
| Hexadecimal | 2a | Same value |
| Padded suffix | 000000000000000000000000000000000000000000000000000000000000002a.json | 64 hex digits before .json |
| Template | https://example.invalid/{id}.json | Reserved placeholder domain |
Work the substitution
Convert decimal 42 to hex 2a. Add 62 zero characters on the left, then replace the literal {id} in the URI. Do not insert decimal 42 or include a 0x prefix. The example.invalid URL is explanatory and is not a fetched metadata endpoint.
Interpret the response separately
The URI locates metadata; it is not an ownership record. A working response does not prove the contract is authentic. Read the contract and chain identity first, then inspect whether the metadata format matches the collection’s implementation.
Common pitfalls
- Not every URI contains an {id} substitution marker.
- Do not confuse a 64-character ID component with an EVM transaction hash.
Related references
Primary sources
Examples explain identifiers. They are not investment recommendations.