ERC-6956 · Review · ERC · 2023-04-29
ERC-6956: Asset-bound Non-Fungible Tokens
Binds an NFT one-to-one to a physical or digital asset, and lets whoever proves control of that asset (attested by a trusted oracle) mint, transfer, approve or burn the NFT, without the current owner's signature.
What problem does it solve?
NFTs are often used to represent real things: sneakers, collectibles, car parts, a house. With plain ERC-721, the link is weak: an asset identifier sits in mutable, off-chain metadata, and the NFT moves only when its current holder signs. If you sell the sneakers but the old owner keeps (or loses access to) the NFT, the token and the object drift apart.
ERC-6956 flips the source of truth. Control of the asset decides who controls the NFT. If you can prove you hold the object, you can claim its token, even if the previous holder is uncooperative or has lost their keys.
How it works
Key terms from the spec:
- Anchor — a unique
bytes32id of the asset (for physical goods, typically a hashed serial number), mapped 1:1 to a token id viatokenByAnchor/anchorByToken. Token id0and anchor0x0are invalid. - Oracle — a trusted signer that verifies proof of control, for example that a phone specifying the
toaddress is physically next to a tamper-resistant tag on the object. - Attestation —
abi.encode(to, anchor, attestationTime, validStartTime, validEndTime, signature), where the oracle signskeccak256(to, anchor, attestationTime, validStartTime, validEndTime).
Anyone may submit an attestation; neither sender nor receiver has to sign, and the gas can be paid by a third party such as the brand:
transferAnchor(attestation)— moves the token toto, or mints it if the anchor has no token yet.approveAnchor(attestation)andburnAnchor(attestation)— allowed only ifapproveAuthorization()/burnAuthorization()includeASSET.decodeAttestationIfValid(attestation, data)— checks the signer is a trusted oracle, the time window is valid and the attestation is unused, without changing state.
Each attestation can be used only once (AttestationUse event, attestationsUsedByAnchor). Ordinary ERC-721 transfers are blocked unless the anchor is released, and batch transfers are not allowed.
Optional extensions: AttestationLimited (cap how many times an anchor can move), Floatable (temporarily allow ordinary transfers without attestation, e.g. trading a pre-order) and ValidAnchors (a Merkle root of valid anchors, maintained by a role separate from the oracle).
Sample code
Oracle creating an attestation after verifying the user is at the object (ethers v6):
import { AbiCoder, getBytes, solidityPackedKeccak256, Wallet } from "ethers";
async function makeAttestation(oracle: Wallet, to: string, anchor: string) {
const now = Math.floor(Date.now() / 1000);
const validStart = 0;
const validEnd = now + 15 * 60; // 15 minutes
const hash = solidityPackedKeccak256(
["address", "bytes32", "uint256", "uint256", "uint256"],
[to, anchor, now, validStart, validEnd],
);
const sig = await oracle.signMessage(getBytes(hash));
return AbiCoder.defaultAbiCoder().encode(
["address", "bytes32", "uint256", "uint256", "uint256", "bytes"],
[to, anchor, now, validStart, validEnd, sig],
);
}
// any account (e.g. the issuer's gas payer) can submit it
await abnft.connect(gasPayer).transferAnchor(await makeAttestation(oracle, alice, anchor));
Things to know
- Status: Review.
- Theft follows the object. If the asset is stolen, the thief can claim the NFT; the oracle attests control, not legal ownership. Combine with a lock mechanism (e.g. ERC-5192) where that matters.
- Gas draining. If the issuer pays gas for every attestation, an attacker holding one object can keep generating attestations to new addresses. The AttestationLimited extension is the recommended defence.
- Everything rests on the oracle and the anchor technology. Easily copied tags (barcodes, ordinary NFC chips) are explicitly not recommended.
- Hash serial numbers rather than using them directly, so token data does not reveal production volumes.
- Related approaches: ERC-4519 and ERC-5791, which rely on assets with their own signing chips.