Abstract
This proposal defines a modular extension to ERC-721 for unique physical assets held under third-party custody (vaulted wine, graded collectibles, watches, certified gemstones, artworks). It introduces:
- Core (
IERC721Custodied): an asynchronous redemption state machine (ACTIVE -> CLAIM_REQUESTED -> IN_PROGRESS -> FULFILLED) with strict event-driven ERC-5192 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 inCLAIM_REQUESTED. - 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 defines a minimal synchronous
redeem()without a multi-step fulfillment state machine or transfer locking while logistics are underway. - ERC-7498 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 tokens. Separating
IERC721CustodyFeefromIERC721Custodiedvia ERC-165 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, ERC-165, ERC-5192, and IERC721Custodied.
supportsInterface(0x2d8d6eb0)MUST returntrueforIERC721Custodied.supportsInterface(0xb45a3c0e)MUST returntrueforIERC5192.
// 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
- State Transitions & Existence Checks:
- Newly minted custodied tokens MUST start in
ACTIVE, unless minted via an immediate-redemption flow (CLAIM_REQUESTED). An optionalassetCommitmentMAY be recorded at mint (bytes32(0)when no specific physical unit is bound at mint time); when non-zero,AssetCommittedMUST be emitted. redemptionState(tokenId)andassetCommitment(tokenId)MUST revert for tokens that have never been minted, and MUST continue returningFULFILLED/ the recorded commitment if a fulfilled token was burned.requestClaimMUST revert if the caller is not the token owner, ifclaimDataHash == bytes32(0), or ifredemptionState(tokenId) != ACTIVE. On success, it MUST clear any single-token approval (approve(address(0))withApprovalemitted), transition the state toCLAIM_REQUESTED, emitClaimRequested, and emitLocked(tokenId).markInProgressMUST be restricted to an authorized custodian role and MUST revert ifredemptionState(tokenId) != CLAIM_REQUESTED. On success, it MUST transition the state toIN_PROGRESSand emitClaimInProgress. Custodians SHOULD callmarkInProgressbefore physically dispatching the asset from custody so the holder cannot cancel while the item is in transit.fulfillClaimMUST be restricted to an authorized custodian role and MUST accept bothCLAIM_REQUESTED(for direct in-person handover) andIN_PROGRESS. On success, it MUST transition the state toFULFILLED, emitClaimFulfilled, and either burn the token or keep it permanently locked (locked(tokenId) == true, MUST NOT emitUnlocked(tokenId)).cancelClaimMUST revert if the state is neitherCLAIM_REQUESTEDnorIN_PROGRESS. An authorized custodian MAY cancel at any time beforeFULFILLED. Implementations SHOULD allow the token holder to self-cancel if the token remains inCLAIM_REQUESTEDpast a configuredclaimTimeout. On success, it MUST transition the state back toACTIVE, emitClaimCancelled, and emitUnlocked(tokenId).
- Newly minted custodied tokens MUST start in
- Strict ERC-5192 Transfer Locking:
locked(tokenId)MUST revert for non-existent tokens (per ERC-5192) and MUST returntruewheneverredemptionState(tokenId)isCLAIM_REQUESTED,IN_PROGRESS, orFULFILLED(when retained as a certificate).- Every transition of
locked(tokenId)MUST be accompanied byLocked(tokenId)orUnlocked(tokenId). - Transfers between non-zero addresses (
from != address(0) && to != address(0)) MUST revert whilelocked(tokenId)istrue.
- Metadata Refresh (ERC-4906):
- Implementations that use dynamic or off-chain updatable metadata (especially collections retaining
FULFILLEDcertificates withburnOnFulfill == false) SHOULD implement ERC-4906 and emitMetadataUpdate(tokenId)on redemption state transitions so existing wallets and marketplaces refreshtokenURIand clearly display redeemed tokens (name/image/attributes) as no longer sellable.
- Implementations that use dynamic or off-chain updatable metadata (especially collections retaining
Optional Extension (IERC721CustodyFee)
Contracts implementing on-chain prepaid custody fees MUST implement IERC721Custodied and IERC721CustodyFee.
supportsInterface(0x9c736799)MUST returntrueforIERC721CustodyFee.
// 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
- 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 viaCustodyPaidUntilInitializedandCustodyFeePaid. paidUntil(tokenId),isCustodyOverdue(tokenId), andcustodyFeeDue(tokenId, token)MUST revert for non-existent tokens.- Transfers between non-zero addresses and
requestClaimMUST revert wheneverisCustodyOverdue(tokenId)istrue.
- Because passive timestamp expiration emits no on-chain transaction, overdue custody fees MUST NOT alter ERC-5192's
- Prepaid Settlement:
payCustodyFeeMUST revert for unsupported payment tokens, non-existent tokens,FULFILLEDtokens, or zero total periods.- On payment,
paidUntil(tokenId)MUST advance strictly pastblock.timestamp(including when elapsed overdue time is an exact multiple ofperiodDuration), plus anyextraPeriods, and emitCustodyFeePaid. custodyFeeDue(tokenId, token)MUST return0once the token isFULFILLEDor whenblock.timestamp <= paidUntil(tokenId).
Rationale
- Timestamp-based
paidUntil+ separateisCustodyOverdue: continuous per-second accrual causes secondary marketplace orders (e.g., Seaport) to revert between blocks because dust fees accrue every block. A prepaidpaidUntiltimestamp (analogous to ERC-4907'sexpires) guarantees clean transfer windows without manual keeper transactions, while keepingisCustodyOverdueseparate fromlocked()preserves strict ERC-5192 event compliance. - Soulbound
FULFILLEDcertificates + ERC-4906 recommendation: ifburnOnFulfillisfalse, keeping the fulfilled token permanently locked prevents secondary buyers on standard ERC-721 marketplaces from purchasing an already-redeemed asset. Recommending (SHOULD, rather thanMUST) ERC-4906MetadataUpdate(tokenId)lets existing wallets that do not yet supportIERC721Custodiedrefresh 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 permittingbytes32(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, dedicatedSalecontract, EIP-712 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):
// 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 aftermarkInProgress, affected tokens remain locked on-chain and recourse is off-chain. Production deployments SHOULD useOwnable2Stepor role-based access control backed by a multisig, separate operational roles (fulfillment vs fee administration), and consider fee caps or timelocks onsetPaymentTokento 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
markInProgressbefore physically handing an asset to a carrier so the holder cannot self-cancel while the asset is in transit. - Collection-Wide Approvals (
setApprovalForAll):requestClaimclears 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:
payCustodyFeeSHOULD use reentrancy protection (ReentrancyGuard) and update_paidUntilbefore callingSafeERC20.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, andproofHashMUST be salted hashes (e.g., includingtokenId,holder, and a random nonce) to prevent rainbow-table correlation on-chain. - Burnable Extensions: collections combining
ERC721CustodiedwithERC721BurnableMUST check!locked(tokenId)inside user-callableburn()functions so holders cannot burn tokens mid-redemption.
Copyright
Copyright and related rights waived via CC0.
