Tokens & markets3 min read

ERC-20 vs ERC-721 vs ERC-1155 Data Models

Compare fungible, unique and multi-token asset records, including balance keys, token IDs and the events a data integration must preserve.

Editorial illustration accompanying erc-20 vs erc-721 vs erc-1155 data models.

Overview

When translating these concepts into an integration, keep the scope described by the wallet history api with the result. The examples in wallet transaction history and smart contract event logs show how the same distinction affects neighbouring data questions.

Token standards describe different identity and balance models. A universal asset table can support them, but only if it preserves the distinctions rather than squeezing every record into a fungible balance.

Choose the correct balance key

An ERC-20 holding is usually keyed by network, contract and wallet. ERC-721 ownership additionally depends on token ID. ERC-1155 balances also require token ID and can include several units of one ID. Store token IDs exactly; their size and leading representation should not be reduced to an ordinary floating-point number.

Worked example: one contract, two IDs

An ERC-1155 contract gives a wallet five units of ID 7 and one unit of ID 8. Aggregating only by contract produces six units of an undefined asset. Keep two holdings. A batch transfer must likewise expand into distinct ID-and-quantity movements while preserving its shared event identity.

Validate interfaces and evidence

Use appropriate interface checks where available, then validate actual behaviour and events. Treat metadata as descriptive rather than an ownership record. Test burns, mints, batch events and IDs with no metadata. A generic token symbol should not decide which accounting or display model applies.

A practical acceptance test

Store one fungible holding, one unique token and two balances under an ERC-1155 contract. Assert that the shared contract does not collapse the two token IDs into one asset. Include a very large token ID and verify exact round-trip identity. The portfolio may present familiar cards, but its underlying balance keys must retain each standard’s dimensions.

Questions about the topic

Frequently asked questions

Can ERC-1155 represent multiple copies of an ID?

Yes. Its model includes an amount for each token ID.

Is an NFT identified by token ID alone?

No. Include network and contract identity.

Standards & technical documentation

Further reading

{{TODO: author name}}

Practical explanations of blockchain data, software integration and the context behind a record.

About Indexbase
← Back to all articles

Build with better context.

Get an update when private beta opens.

Form setup in progress. Nothing entered here is sent or saved. {{TODO: endpoint}} See the full form and email alternative.