--- eip: 8544 title: Custodied Physical Asset Redemption description: ERC-721 extension for custodied physical assets with async redemption, ERC-5192 locking, and optional prepaid custody fees author: deucalionn (@deucalionn) discussions-to: https://ethereum-magicians.org/t/draft-erc-custodied-physical-asset-redemption-erc721custodied/30611 status: Draft type: Standards Track category: ERC created: 2026-12-05 requires: 165, 721, 4906, 5192 --- ## Abstract This proposal defines a modular extension to [ERC-721](./eip-721.md) for unique physical assets held under third-party custody (vaulted wine, graded collectibles, watches, certified gemstones, artworks). It introduces: 1. **Core (`IERC721Custodied`)**: an asynchronous redemption state machine (`ACTIVE -> CLAIM_REQUESTED -> IN_PROGRESS -> FULFILLED`) with strict event-driven [ERC-5192](./eip-5192.md) transfer locking during redemption, optional on-chain asset commitment (`assetCommitment`), off-chain claim commitments (`bytes32`), custodian-configurable fulfillment (burn or permanently locked Soulbound certificate), and a holder self-cancellation timeout in `CLAIM_REQUESTED`. 2. **Optional Extension (`IERC721CustodyFee`)**: prepaid multi-token custody fees (`paidUntil`, `isCustodyOverdue`) that block transfers, secondary sales, and redemption claims when overdue without requiring manual expiration transactions or violating ERC-5192 event semantics. ## Motivation Physical assets held in vaults or bonded warehouses are frequently traded on-chain as transferable title tokens without moving physically, until a final holder redeems the underlying item (by carrier delivery or in-person vault pickup). Existing standards address adjacent flows but do not standardize this asynchronous custody-to-redemption lifecycle: - [ERC-5560](./eip-5560.md) defines a minimal synchronous `redeem()` without a multi-step fulfillment state machine or transfer locking while logistics are underway. - [ERC-7498](./eip-7498.md) standardizes single-transaction burn or trait-change redemption campaigns (where eligibility or shipping checks can be verified via off-chain signatures prior to redemption), rather than keeping the transferable title token in the holder's wallet in a locked state across asynchronous shipping, customs clearance, or pickup cancellation. - **Secondary-market safety**: without a standardized lock during redemption, a holder could request physical withdrawal and simultaneously sell the token on a marketplace. Likewise, if a redeemed token is retained as a historical certificate rather than burned, leaving it unlocked puts secondary-market buyers at risk of purchasing an asset that has already left custody. - **Heterogeneous custody fee models**: some custodians include storage in the initial sale price or bill off-chain, while others charge recurring on-chain fees in [ERC-20](./eip-20.md) tokens. Separating `IERC721CustodyFee` from `IERC721Custodied` via [ERC-165](./eip-165.md) keeps the core minimal and broadly adoptable. ## Specification The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174. ### Core Interface (`IERC721Custodied`) Compliant contracts MUST implement [ERC-721](./eip-721.md), [ERC-165](./eip-165.md), [ERC-5192](./eip-5192.md), and `IERC721Custodied`. - `supportsInterface(0x2d8d6eb0)` MUST return `true` for `IERC721Custodied`. - `supportsInterface(0xb45a3c0e)` MUST return `true` for `IERC5192`. ```solidity // SPDX-License-Identifier: CC0-1.0 pragma solidity ^0.8.24; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {IERC5192} from "./IERC5192.sol"; /// @title IERC721Custodied /// @dev ERC-165 interfaceId: 0x2d8d6eb0 interface IERC721Custodied is IERC721, IERC5192 { enum RedemptionState { ACTIVE, CLAIM_REQUESTED, IN_PROGRESS, FULFILLED } /// @notice Emitted at mint when an optional physical asset commitment (serial, seal, certificate hash) is set. event AssetCommitted(uint256 indexed tokenId, bytes32 assetCommitment); /// @notice Emitted when a holder requests physical redemption. event ClaimRequested(uint256 indexed tokenId, address indexed holder, bytes32 claimDataHash); /// @notice Emitted when the custodian marks a claim as in progress (e.g., shipped or scheduled for pickup). event ClaimInProgress(uint256 indexed tokenId, bytes32 referenceHash); /// @notice Emitted when physical redemption is finalized. event ClaimFulfilled(uint256 indexed tokenId, bytes32 proofHash, bool burned); /// @notice Emitted when a pending claim is cancelled and the token returns to ACTIVE. event ClaimCancelled(uint256 indexed tokenId, address indexed cancelledBy); /// @notice Returns the current redemption state of `tokenId`. Reverts for never-minted tokens. function redemptionState(uint256 tokenId) external view returns (RedemptionState); /// @notice Returns the optional physical asset commitment set at mint (`bytes32(0)` if unset). function assetCommitment(uint256 tokenId) external view returns (bytes32); /// @notice Holder requests physical redemption. /// @param tokenId The token to redeem. /// @param claimDataHash Non-zero salted hash/commitment of off-chain claim details (no plaintext PII). function requestClaim(uint256 tokenId, bytes32 claimDataHash) external; /// @notice Custodian marks a pending claim as in progress. /// @param tokenId The token being redeemed. /// @param referenceHash Hash/commitment of tracking or pickup reference. function markInProgress(uint256 tokenId, bytes32 referenceHash) external; /// @notice Custodian finalizes redemption (burns token or leaves it as a permanently locked FULFILLED certificate). /// @param tokenId The redeemed token. /// @param proofHash Hash/commitment of handover or delivery proof. function fulfillClaim(uint256 tokenId, bytes32 proofHash) external; /// @notice Cancels a pending claim and returns the token to ACTIVE. function cancelClaim(uint256 tokenId) external; } ``` #### Core Rules 1. **State Transitions & Existence Checks:** - Newly minted custodied tokens MUST start in `ACTIVE`, unless minted via an immediate-redemption flow (`CLAIM_REQUESTED`). An optional `assetCommitment` MAY be recorded at mint (`bytes32(0)` when no specific physical unit is bound at mint time); when non-zero, `AssetCommitted` MUST be emitted. - `redemptionState(tokenId)` and `assetCommitment(tokenId)` MUST revert for tokens that have never been minted, and MUST continue returning `FULFILLED` / the recorded commitment if a fulfilled token was burned. - `requestClaim` MUST revert if the caller is not the token owner, if `claimDataHash == bytes32(0)`, or if `redemptionState(tokenId) != ACTIVE`. On success, it MUST clear any single-token approval (`approve(address(0))` with `Approval` emitted), transition the state to `CLAIM_REQUESTED`, emit `ClaimRequested`, and emit `Locked(tokenId)`. - `markInProgress` MUST be restricted to an authorized custodian role and MUST revert if `redemptionState(tokenId) != CLAIM_REQUESTED`. On success, it MUST transition the state to `IN_PROGRESS` and emit `ClaimInProgress`. Custodians SHOULD call `markInProgress` before physically dispatching the asset from custody so the holder cannot cancel while the item is in transit. - `fulfillClaim` MUST be restricted to an authorized custodian role and MUST accept both `CLAIM_REQUESTED` (for direct in-person handover) and `IN_PROGRESS`. On success, it MUST transition the state to `FULFILLED`, emit `ClaimFulfilled`, and either burn the token or keep it permanently locked (`locked(tokenId) == true`, MUST NOT emit `Unlocked(tokenId)`). - `cancelClaim` MUST revert if the state is neither `CLAIM_REQUESTED` nor `IN_PROGRESS`. An authorized custodian MAY cancel at any time before `FULFILLED`. Implementations SHOULD allow the token holder to self-cancel if the token remains in `CLAIM_REQUESTED` past a configured `claimTimeout`. On success, it MUST transition the state back to `ACTIVE`, emit `ClaimCancelled`, and emit `Unlocked(tokenId)`. 2. **Strict ERC-5192 Transfer Locking:** - `locked(tokenId)` MUST revert for non-existent tokens (per ERC-5192) and MUST return `true` whenever `redemptionState(tokenId)` is `CLAIM_REQUESTED`, `IN_PROGRESS`, or `FULFILLED` (when retained as a certificate). - Every transition of `locked(tokenId)` MUST be accompanied by `Locked(tokenId)` or `Unlocked(tokenId)`. - Transfers between non-zero addresses (`from != address(0) && to != address(0)`) MUST revert while `locked(tokenId)` is `true`. 3. **Metadata Refresh ([ERC-4906](./eip-4906.md)):** - Implementations that use dynamic or off-chain updatable metadata (especially collections retaining `FULFILLED` certificates with `burnOnFulfill == false`) SHOULD implement [ERC-4906](./eip-4906.md) and emit `MetadataUpdate(tokenId)` on redemption state transitions so existing wallets and marketplaces refresh `tokenURI` and clearly display redeemed tokens (name/image/attributes) as no longer sellable. ### Optional Extension (`IERC721CustodyFee`) Contracts implementing on-chain prepaid custody fees MUST implement `IERC721Custodied` and `IERC721CustodyFee`. - `supportsInterface(0x9c736799)` MUST return `true` for `IERC721CustodyFee`. ```solidity // SPDX-License-Identifier: CC0-1.0 pragma solidity ^0.8.24; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; /// @title IERC721CustodyFee /// @dev ERC-165 interfaceId: 0x9c736799 interface IERC721CustodyFee is IERC165 { /// @notice Emitted at mint to expose the initial prepaid custody timestamp to indexers. event CustodyPaidUntilInitialized(uint256 indexed tokenId, uint64 paidUntil); /// @notice Emitted when custody fees are paid for `tokenId`. event CustodyFeePaid( uint256 indexed tokenId, address indexed payer, address indexed token, uint256 amount, uint64 paidUntil ); /// @notice Emitted when an accepted ERC-20 payment token rate is configured. event PaymentTokenUpdated(address indexed token, uint256 feePerPeriod); /// @notice Returns the Unix timestamp until which custody is prepaid for `tokenId`. function paidUntil(uint256 tokenId) external view returns (uint64); /// @notice Returns true if `tokenId` is ACTIVE and `block.timestamp > paidUntil(tokenId)`. function isCustodyOverdue(uint256 tokenId) external view returns (bool); /// @notice Returns the overdue custody fee due for `tokenId` denominated in `token`. function custodyFeeDue(uint256 tokenId, address token) external view returns (uint256 amount); /// @notice Pays all overdue periods plus `extraPeriods` in advance using `token`. function payCustodyFee(uint256 tokenId, address token, uint256 extraPeriods) external; } ``` #### Custody Fee Rules 1. **Timestamp-Based Overdue Enforcement (Separate from ERC-5192 `locked()`):** - Because passive timestamp expiration emits no on-chain transaction, overdue custody fees MUST NOT alter ERC-5192's `locked(tokenId)` return value. Instead, `isCustodyOverdue(tokenId)` exposes the overdue status, and indexers track exact expiration timestamps via `CustodyPaidUntilInitialized` and `CustodyFeePaid`. - `paidUntil(tokenId)`, `isCustodyOverdue(tokenId)`, and `custodyFeeDue(tokenId, token)` MUST revert for non-existent tokens. - Transfers between non-zero addresses and `requestClaim` MUST revert whenever `isCustodyOverdue(tokenId)` is `true`. 2. **Prepaid Settlement:** - `payCustodyFee` MUST revert for unsupported payment tokens, non-existent tokens, `FULFILLED` tokens, or zero total periods. - On payment, `paidUntil(tokenId)` MUST advance strictly past `block.timestamp` (including when elapsed overdue time is an exact multiple of `periodDuration`), plus any `extraPeriods`, and emit `CustodyFeePaid`. - `custodyFeeDue(tokenId, token)` MUST return `0` once the token is `FULFILLED` or when `block.timestamp <= paidUntil(tokenId)`. ## Rationale - **Timestamp-based `paidUntil` + separate `isCustodyOverdue`**: continuous per-second accrual causes secondary marketplace orders (e.g., Seaport) to revert between blocks because dust fees accrue every block. A prepaid `paidUntil` timestamp (analogous to [ERC-4907](./eip-4907.md)'s `expires`) guarantees clean transfer windows without manual keeper transactions, while keeping `isCustodyOverdue` separate from `locked()` preserves strict ERC-5192 event compliance. - **Soulbound `FULFILLED` certificates + ERC-4906 recommendation**: if `burnOnFulfill` is `false`, keeping the fulfilled token permanently locked prevents secondary buyers on standard ERC-721 marketplaces from purchasing an already-redeemed asset. Recommending (`SHOULD`, rather than `MUST`) ERC-4906 `MetadataUpdate(tokenId)` lets existing wallets that do not yet support `IERC721Custodied` refresh the token's name/image to clearly indicate "redeemed", without imposing dynamic metadata on collections that burn tokens or use immutable IPFS URIs. - **Optional `assetCommitment`**: allows serial/seal/certificate provenance at mint when units are uniquely assigned, while permitting `bytes32(0)` for fungible-vintage vault allocations assigned at withdrawal. - **No `mint()` in interfaces**: following ERC-721, minting policies depend on each project's commercial model (public sale, dedicated `Sale` contract, [EIP-712](./eip-712.md) vouchers, or custodian-only minting) and belong in concrete implementations. - **Holder timeout only in `CLAIM_REQUESTED`**: mitigates unresponsive custodians prior to dispatch while preventing double-spend cancellation once an item is physically in transit (`IN_PROGRESS`). ## Backwards Compatibility This ERC is fully backwards compatible with ERC-721, ERC-165, and ERC-5192. Standard ERC-721 wallets and marketplaces continue to operate on `ACTIVE` tokens, while ERC-5192-aware platforms reliably track redemption and Soulbound certificate locks via `Locked` / `Unlocked` events. ## Reference Implementation Minimal abstract contracts implementing `IERC721Custodied` and `IERC721CustodyFee` using OpenZeppelin Contracts v5 (`ERC721`, `Ownable2Step`, `ReentrancyGuard`, `SafeERC20`): ```solidity // SPDX-License-Identifier: CC0-1.0 pragma solidity ^0.8.24; import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol"; import {Ownable2Step} from "@openzeppelin/contracts/access/Ownable2Step.sol"; import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol"; import {IERC721Custodied} from "./IERC721Custodied.sol"; import {IERC5192} from "./IERC5192.sol"; abstract contract ERC721Custodied is ERC721, Ownable2Step, IERC721Custodied { uint64 public immutable claimTimeout; bool public immutable burnOnFulfill; mapping(uint256 tokenId => RedemptionState) internal _states; mapping(uint256 tokenId => uint64) internal _claimRequestedAt; mapping(uint256 tokenId => bytes32) internal _assetCommitments; error TokenLocked(uint256 tokenId); error InvalidState(uint256 tokenId, RedemptionState current); error InvalidClaimData(); error NotTokenHolder(uint256 tokenId); error UnauthorizedCancel(uint256 tokenId); constructor( string memory name_, string memory symbol_, address custodian_, uint64 claimTimeout_, bool burnOnFulfill_ ) ERC721(name_, symbol_) Ownable(custodian_) { claimTimeout = claimTimeout_; burnOnFulfill = burnOnFulfill_; } function redemptionState(uint256 tokenId) public view returns (RedemptionState) { RedemptionState state = _states[tokenId]; if (_ownerOf(tokenId) == address(0) && state != RedemptionState.FULFILLED) { revert ERC721NonexistentToken(tokenId); } return state; } function assetCommitment(uint256 tokenId) public view returns (bytes32) { if (_ownerOf(tokenId) == address(0) && _states[tokenId] != RedemptionState.FULFILLED) { revert ERC721NonexistentToken(tokenId); } return _assetCommitments[tokenId]; } function locked(uint256 tokenId) public view virtual returns (bool) { _requireOwned(tokenId); RedemptionState state = _states[tokenId]; return state == RedemptionState.CLAIM_REQUESTED || state == RedemptionState.IN_PROGRESS || state == RedemptionState.FULFILLED; } function requestClaim(uint256 tokenId, bytes32 claimDataHash) public virtual { if (ownerOf(tokenId) != msg.sender) revert NotTokenHolder(tokenId); if (claimDataHash == bytes32(0)) revert InvalidClaimData(); if (_states[tokenId] != RedemptionState.ACTIVE) { revert InvalidState(tokenId, _states[tokenId]); } _approve(address(0), tokenId, address(0), true); _states[tokenId] = RedemptionState.CLAIM_REQUESTED; _claimRequestedAt[tokenId] = uint64(block.timestamp); emit ClaimRequested(tokenId, msg.sender, claimDataHash); emit Locked(tokenId); } function markInProgress(uint256 tokenId, bytes32 referenceHash) external onlyOwner { if (_states[tokenId] != RedemptionState.CLAIM_REQUESTED) { revert InvalidState(tokenId, _states[tokenId]); } _states[tokenId] = RedemptionState.IN_PROGRESS; emit ClaimInProgress(tokenId, referenceHash); } function fulfillClaim(uint256 tokenId, bytes32 proofHash) external onlyOwner { RedemptionState state = _states[tokenId]; if (state != RedemptionState.CLAIM_REQUESTED && state != RedemptionState.IN_PROGRESS) { revert InvalidState(tokenId, state); } _states[tokenId] = RedemptionState.FULFILLED; if (burnOnFulfill) { _burn(tokenId); } emit ClaimFulfilled(tokenId, proofHash, burnOnFulfill); } function cancelClaim(uint256 tokenId) external { RedemptionState state = _states[tokenId]; if (state != RedemptionState.CLAIM_REQUESTED && state != RedemptionState.IN_PROGRESS) { revert InvalidState(tokenId, state); } bool isCustodian = msg.sender == owner(); bool isHolderAfterTimeout = msg.sender == ownerOf(tokenId) && state == RedemptionState.CLAIM_REQUESTED && block.timestamp >= _claimRequestedAt[tokenId] + claimTimeout; if (!isCustodian && !isHolderAfterTimeout) revert UnauthorizedCancel(tokenId); _states[tokenId] = RedemptionState.ACTIVE; _claimRequestedAt[tokenId] = 0; emit ClaimCancelled(tokenId, msg.sender); emit Unlocked(tokenId); } function supportsInterface(bytes4 interfaceId) public view virtual override(ERC721, IERC165) returns (bool) { return interfaceId == type(IERC721Custodied).interfaceId || interfaceId == type(IERC5192).interfaceId || super.supportsInterface(interfaceId); } function _mintCustodied(address to, uint256 tokenId, bytes32 commitment) internal { _safeMint(to, tokenId); _states[tokenId] = RedemptionState.ACTIVE; if (commitment != bytes32(0)) { _assetCommitments[tokenId] = commitment; emit AssetCommitted(tokenId, commitment); } } function _update(address to, uint256 tokenId, address auth) internal virtual override returns (address) { address from = _ownerOf(tokenId); if (from != address(0) && to != address(0) && locked(tokenId)) { revert TokenLocked(tokenId); } return super._update(to, tokenId, auth); } } ``` ## Security Considerations - **Custodian Trust, Finality & Key Governance**: physical custody inherently relies on a trusted off-chain custodian. Redemption finality is attested by the custodian's signature (`fulfillClaim`), not the holder's, to prevent holder griefing after physical receipt. If the custodian key is lost or compromised after `markInProgress`, affected tokens remain locked on-chain and recourse is off-chain. Production deployments SHOULD use `Ownable2Step` or role-based access control backed by a multisig, separate operational roles (fulfillment vs fee administration), and consider fee caps or timelocks on `setPaymentToken` to prevent abusive retroactive fee hikes. Implementations SHOULD prevent disabling the last active payment token so overdue tokens cannot be permanently bricked. - **Dispatch Ordering**: custodians SHOULD call `markInProgress` before physically handing an asset to a carrier so the holder cannot self-cancel while the asset is in transit. - **Collection-Wide Approvals (`setApprovalForAll`)**: `requestClaim` clears single-token approvals (`approve(address(0))`), but cannot revoke collection-wide marketplace operator approvals (`setApprovalForAll`) without affecting other tokens held by the user. Users SHOULD cancel open marketplace orders before claiming. - **ERC-20 Token Quirks & Reentrancy**: `payCustodyFee` SHOULD use reentrancy protection (`ReentrancyGuard`) and update `_paidUntil` before calling `SafeERC20.safeTransferFrom` (Checks-Effects-Interactions). Custodians MUST only whitelist standard non-rebasing, non-fee-on-transfer ERC-20 tokens (e.g., USDC, DAI) and consider blacklist/freeze risks on centralized stablecoins. - **Privacy (PII)**: `claimDataHash`, `referenceHash`, and `proofHash` MUST be salted hashes (e.g., including `tokenId`, `holder`, and a random nonce) to prevent rainbow-table correlation on-chain. - **Burnable Extensions**: collections combining `ERC721Custodied` with `ERC721Burnable` MUST check `!locked(tokenId)` inside user-callable `burn()` functions so holders cannot burn tokens mid-redemption. ## Copyright Copyright and related rights waived via [CC0](../LICENSE.md).