---
eip: 1046
label: ERC-1046
title: tokenURI Interoperability
status: Final
type: Standards Track
category: ERC
created: 2018-04-13
requires: 20, 721, 1155
official: https://eips.ethereum.org/EIPS/eip-1046
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-1046.md
canonical: https://eips.huatuo.xyz/eip-1046/
lang: en
tldr: Gives ERC-20 tokens an ERC-721-style tokenURI pointing to JSON metadata (name, description, images, icons) and adds an interop field so wallets can tell ERC-20, ERC-721 and ERC-1155 metadata apart.
tags: [token, metadata, erc20, nft, wallet]
---

# ERC-1046: tokenURI Interoperability

> Extends ERC-20 with an ERC-721-like tokenURI, and extends ERC-721 and ERC-1155 with interoperability

**TL;DR:** Gives ERC-20 tokens an ERC-721-style tokenURI pointing to JSON metadata (name, description, images, icons) and adds an interop field so wallets can tell ERC-20, ERC-721 and ERC-1155 metadata apart.

## What problem does it solve?

[ERC-721](/eip-721/) NFTs have `tokenURI(id)`, which points to a JSON file with a name, description and image. [ERC-20](/eip-20/) tokens have nothing similar. Wallets and explorers end up relying on hand-maintained token lists to show a logo or a description, and they cannot easily tell from metadata alone what kind of token a contract is.

ERC-1046 brings the same metadata pattern to ERC-20, and adds a small shared `interop` object to ERC-20, ERC-721 and [ERC-1155](/eip-1155/) metadata so one parser can handle all three.

## How it works

**ERC-20 extension.** A compliant token adds one function with no arguments:

```solidity
function tokenURI() external view returns (string memory);
```

The URI must resolve to JSON with these fields:

- `interop` (required): `{ "erc1046": true }` marks this as ERC-20 metadata.
- `name`, `symbol`, `decimals`: optional. If the matching on-chain function exists and returns a value, the two must agree. `decimals` defaults to 18.
- `description`: one plain-text paragraph.
- `image` / `images`: images for the token. Bitmaps should be 320–1080 px wide.
- `icons`: square icons with a transparent background.

**ERC-721 and ERC-1155 extensions.** Their existing metadata JSON should gain an `interop` field set to `{ "erc721": true }` or `{ "erc1155": true }`. ERC-1155 contracts may also expose `tokenURI(uint256)`, which must return the same URI as `uri(id)`.

To save gas, the spec recommends that new tokens skip the on-chain `name()`, `symbol()` and `decimals()` and keep those values only in the metadata. It also recommends leaving `decimals` out of the JSON when it is 18.

## Sample code

An ERC-20 token's metadata file:

```json
{
  "interop": { "erc1046": true },
  "name": "Example Token",
  "symbol": "EXT",
  "description": "A sample token used to illustrate ERC-1046 metadata.",
  "image": "ipfs://<cid>/banner.png",
  "icons": ["ipfs://<cid>/icon-512.png"]
}
```

Reading it with ethers v6:

```ts
import { Contract, JsonRpcProvider } from "ethers";

const provider = new JsonRpcProvider(process.env.RPC_URL);
const token = new Contract(tokenAddress, ["function tokenURI() view returns (string)"], provider);

const uri: string = await token.tokenURI();
const url = uri.startsWith("ipfs://") ? `https://ipfs.io/ipfs/${uri.slice(7)}` : uri;
const meta = await (await fetch(url)).json();
if (meta.interop?.erc1046) console.log(meta.name, meta.icons?.[0]);
```

## Things to know

- The extension is optional and fully backward compatible. Existing ERC-20 tokens are unaffected, and many tools will not yet look for `tokenURI()`.
- Leaving out `name()`/`symbol()`/`decimals()` saves gas, but tools that only read those functions will then show nothing. Weigh that before following the recommendation.
- **Security:** fetching arbitrary URIs from a contract is a server-side request forgery risk. Wallets should allow only specific URI schemes and ports.
- The spec chose a JSON `interop` field over [ERC-165](/eip-165/) checks, so a client can learn the token type from the metadata alone without extra calls.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-1046
