---
eip: 5791
label: ERC-5791
title: Physical Backed Tokens
status: Draft
type: Standards Track
category: ERC
created: 2022-10-17
requires: 191, 721
official: https://eips.ethereum.org/EIPS/eip-5791
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-5791.md
canonical: https://eips.huatuo.xyz/eip-5791/
lang: en
tldr: Ties an ERC-721 NFT to a secure chip in a physical item, so only someone holding the item can get the chip to sign a transfer of the token.
tags: [nft, physical, rwa, signatures]
---

# ERC-5791: Physical Backed Tokens

> Minimal interface for linking ownership of ERC-721 NFTs to a physical chip

**TL;DR:** Ties an ERC-721 NFT to a secure chip in a physical item, so only someone holding the item can get the chip to sign a transfer of the token.

## What problem does it solve?

NFTs that represent sneakers, art or collectibles usually have two problems: owning the NFT and owning the object are separate things, and proving the object is authentic relies on a trusted third party.

Physical Backed Tokens (PBT) bind the two. A chip embedded in the item holds a private key that cannot be extracted. Whoever physically has the item can make the chip sign a message, and that signature is what moves the NFT. No central authority is needed to verify authenticity.

## How it works

- Each token is paired with a **chip address** derived from the chip's public key. Pairing emits `ChipSet(tokenId, chipId)` so indexers can map chips to tokens. A token cannot be minted without being linked to a chip.
- The collection is **account-bound**: all normal [ERC-721](/eip-721/) transfer functions must revert. The only way to move a token is `transferToken`.
- `transferToken(to, chipId, chipSignature, signatureTimestamp, useSafeTransferFrom, extras)` checks an [ERC-191](/eip-191/) signature from the chip over the recipient, the chip address, a recent block timestamp and any extra data, then transfers the token to `to`.
- `tokenIdFor(chipId)` and `isChipSignatureForToken(tokenId, data, signature)` let anyone check that a chip backs a token.
- Contracts advertise support via [ERC-165](/eip-165/) interface id `0x4901df9f`.

Minting and how token ids get mapped to chips (preset by the owner, signed by a trusted party, a registry, first-come-first-served) are left to the implementation. Signature verification goes through the chip address, so chips are not limited to secp256k1.

## Sample code

The interface:

```solidity
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.20;

interface IERC5791 {
    event ChipSet(uint256 indexed tokenId, address indexed chipId);

    function tokenIdFor(address chipId) external view returns (uint256 tokenId);

    function isChipSignatureForToken(uint256 tokenId, bytes calldata data, bytes calldata signature)
        external view returns (bool);

    function transferToken(
        address to,
        address chipId,
        bytes calldata chipSignature,
        uint256 signatureTimestamp,
        bool useSafeTransferFrom,
        bytes calldata extras
    ) external returns (uint256 tokenId);
}
```

The reference implementation builds the digest the chip signs roughly like this:

```solidity
if (signatureTimestamp > block.timestamp) revert SignatureTimestampInFuture();
if (signatureTimestamp + maxDurationWindow < block.timestamp) revert SignatureTimestampTooOld();
bytes32 hash = keccak256(abi.encode(
    address(this), block.chainid, chipNonce[chipId], to, signatureTimestamp, keccak256(extras)
));
bytes32 digest = ECDSA.toEthSignedMessageHash(hash); // ERC-191
```

## Things to know

- Status is **Draft**; the interface may still change.
- Trust in "physical backing" is only as good as the chip. Whether chip addresses really belong to real chips, and whether the chip stays attached and undamaged, are explicitly out of scope.
- Including the recipient and a recent timestamp in the signed data prevents replay and stops someone from pre-signing transfers before handing the item over. A non-deterministic nonce is recommended.
- The item holder can send the NFT to someone else by giving them a chip signature; the spec treats this like lending, since the holder can reclaim the NFT at any time.


---

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