ERC-5791 Physical-backed token (PBT) (Physical Backed Tokens)

Draft · NFTs & multi-token · created 2022-10-17

A minimal interface that links a security chip attached to a physical item with an ERC-721 NFT, so that whoever holds the physical item owns that NFT.

Why it is needed

Until now, there has been no standard for presenting physical assets as NFTs with verified authenticity and ownership. Existing approaches carry at least one of two problems. First, ownership of the physical item and ownership of the NFT can drift apart. The physical item may be sold while the NFT stays put, or the NFT alone may trade while the physical item remains with someone else. Second, verifying that a physical item is genuine requires the involvement of a trusted third party such as StockX. This standard embeds a security chip that is difficult to counterfeit into the physical item and requires that chip's signature to move the NFT, offering the simplest path to binding ownership of the physical item and the digital token together without a central authority.

What to implement

In depth

Requirements for the chip and contract

The physical item must have a security chip attached. The chip must be able to securely generate and store an asymmetric key pair, sign messages with that private key, expose the public key, and the private key must be unextractable and uncopyable by design. The contract must also use an account-bound ERC-721 implementation, meaning every ERC-721 function that performs a transfer must throw. This ensures that transferring and managing ownership of the NFT is only possible through the functions newly introduced by this standard, that is, only on the premise of owning the physical item.

Pairing chips and tokens

Each NFT is conceptually linked to one physical chip. When a chipId is paired with a tokenId, a ChipSet event is emitted, letting downstream indexers learn which chip address corresponds to which token. An NFT cannot be issued without its token id being linked to a specific chip. Since the tokenId may not yet exist at the time of the event, indexers can combine the ChipSet event with ERC-721's Transfer event to infer which tokens actually exist and are paired with a chip. How a token id is assigned to a chip address is outside the scope of this standard, and several approaches are possible: the contract owner can decide in advance before issuance, a pre-signed (tokenId, chipId) tuple from a trusted address can be passed to the issuance function, a trusted registry can be queried, or assignment can happen on a first-come, first-served basis at issuance time.

Signature specification for transferToken

transferToken transfers the NFT to the function caller when given a valid signature from the chip. A valid signature must follow ERC-191 and EIP-2 (s-value restriction), and the signed data consists of the recipient address (the function caller), the chip address, the block timestamp, and an extras parameter used for implementation-specific additional logic. This signature scheme is fixed so that aggregator-style products supporting transfers can emerge for any NFT implementing this standard. Taking chipId as an argument is also meant to let a smart contract verify the signature, allowing the chip to use various signature schemes such as P256 or BabyJubJub instead of being tied to secp256k1.

Design of lookup functions and interface identification

tokenIdFor(chipId) returns the tokenId corresponding to a chip address and reverts for an unpaired chipId. However, for minimalism, it does not revert when the tokenId does not exist. If checking token existence is needed, an external contract can call ERC721.ownerOf(tokenId) and check for success. isChipSignatureForToken follows the same principle, only determining whether the chip assigned to a tokenId produced the signature. A contract implementing this standard must return true when ERC-165's supportsInterface is called with interfaceID=0x4901df9f. The minting interface is left to the implementation, but the owner of a minted NFT must be the chip owner, which can be authenticated via the signature scheme defined in transferToken.

Out-of-scope issues and the loan interpretation

The problem of trusting whether a collection's chip address is actually a chip embedded in a physical item (rather than an arbitrary externally owned account impersonating a chip), chip damage or aging, and preventing the chip from detaching from the physical item are intentionally outside the scope of this standard and are being researched separately. Meanwhile, it is also possible for a physical item's owner to hand the chip signature to someone else, sending the NFT to that person's wallet. The source states that even in this case, ownership management remains tied to the physical item, so it is still considered physical-backed. Because the signing party, the physical item's owner, must always be involved, and because the physical owner can reclaim NFT ownership at any time, this can be interpreted as temporarily lending the physical item.

Compatibility with ERC-721

This proposal is backward compatible with ERC-721 at the API level. However, for a token to be physically backed, the contract must use an account-bound ERC-721 implementation so that all ERC-721 functions that perform transfers fail, and transfers must be made only through new functions that require a chip signature. In the reference implementation, signature verification fails if signatureTimestamp is later than the current block time, and fails as too old a signature if adding maxDurationWindow still does not reach the current time; after verification, it shows how chipNonce is updated by mixing it with the previous block hash.

Proposal status

The status of this document is Draft. Since the content may still change at this stage, check the latest original text before implementing or citing it.

Things to watch out for

Original ERC · ← ERCs