EIP.tools

EIP.tools

⚠️ DraftStandards Track: ERC

ERC-8534: Redeemable Dual Nature Token Pair

Receipts, custody states and pluggable rules for ERC-7631 token pairs backed by redeemable assets.

Authors
Created2026-12-04
Discussion Linkhttps://ethereum-magicians.org/t/erc-8534-redeemable-dual-nature-token-pair/30639
Requires

Markdown

https://raw.githubusercontent.com/ethereum/ERCs/re...
Pull Request#2295PR open

EIP-GPT summary

Contents
AbstractMotivationSpecificationOverviewCustody StatesEscrow InterfaceDetachmentRedemptionBuybackReceipt InterfaceRule Module InterfaceMetadata ProviderRationaleCustody is standardized and lifecycle is notOpaque identifiersOne generic eventA separate receiptDiscovery starts at the escrowThe detachment call is not standardizedMetadata signatureBackwards CompatibilitySecurity ConsiderationsThe rule module is trusted with allocationCustody is an off-chain factPermanent removal of the unitBuyback pricingAsynchronous actionsReentrancyUntrusted metadataCopyright

Abstract

An ERC-7631 dual nature token pair can represent a pool of individually identifiable assets held in custody, such as graded collectibles, watches or bullion bars. This proposal defines the three contracts such a pair needs in order to be redeemable. An escrow separates one asset from the pool by locking one mirror ERC-721 token together with the ERC-20 amount that backs it, and issues a standalone ERC-721 receipt for the asset. The receipt can later be exchanged for delivery of the asset or sold back to the pool. A rule module decides which token may claim which asset and exposes its own token lifecycle through one opaque state query and one generic event. The proposal standardizes how these contracts are discovered, how the custody of an asset is queried, and which events report its transitions.

Motivation

In a dual nature token pair the ERC-721 tokens of an account are minted and burned automatically as its ERC-20 balance changes. This is what makes the pair liquid, and it is also what makes it unsuitable, on its own, for assets that exist outside the chain:

  • A claim on a specific asset must not disappear because its holder sells ERC-20 tokens. In an unmodified pair, the ERC-721 token that carries the claim is burned by an unrelated ERC-20 transfer.
  • While a claim on an asset is outstanding, the ERC-20 amount that backs it must not circulate. Otherwise the same asset is represented twice, once by the claim and once by the fungible supply.
  • Wallets, marketplaces and lending protocols need to know whether an asset still backs the fungible supply, is claimed by a specific account, or has left custody. Without a common query, each integration has to read the storage layout of each implementation.
  • The way an asset is allocated to a token differs between pools: a verifiable random draw, an auction, a direct pick by the holder. Encoding one such lifecycle as an enumeration in the token contract fixes one product into the interface and makes every other one incompatible with it.

This proposal separates the two concerns. The custody of an asset has exactly three states and is the same for every pool, so it is specified here. Everything a pool adds on top of custody is delegated to a rule module, which reports state and outcomes through identifiers that are opaque to the escrow and to integrators that do not know the rule set.

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.

Overview

A redeemable dual nature token pair consists of the following contracts.

  • The base and the mirror: an ERC-20 contract and an ERC-721 contract that form a dual nature token pair as defined in ERC-7631.
  • The escrow: holds the mirror token and the base tokens of every detached asset and settles receipts.
  • The receipt: an ERC-721 contract whose tokens are claims on detached assets.
  • The rule module: the only contract allowed to instruct the escrow to detach an asset.

The unit is the amount of base tokens that corresponds to one mirror token.

An asset is an item held in custody for the pool. It is identified by an assetId that is unique within the pool. How assets are registered, valued and stored is outside the scope of this proposal.

Custody States

Every asset is in exactly one of three custody states.

StateValueMeaning
Pooled0The asset backs the fungible supply. This is the state of an asset the escrow has never seen.
Detached1A receipt for the asset exists. One mirror token and one unit of base tokens are locked in the escrow.
Redeemed2The receipt was exchanged for delivery of the asset. The unit is permanently out of circulation.

The permitted transitions are:

  • Pooled to Detached, and Redeemed to Detached, by a detachment;
  • Detached to Redeemed, by a redemption;
  • Detached to Pooled, by a buyback.

The transition from Redeemed to Detached covers an asset that returned to custody after delivery and is claimed again.

Escrow Interface

The escrow MUST implement the following interface.

interface IRedeemablePairEscrow {
    enum CustodyState {
        Pooled,
        Detached,
        Redeemed
    }

    /// @dev MUST be emitted on every custody transition of `assetId`.
    /// `receiptId` is the receipt minted by a detachment,
    /// or the receipt burned by a redemption or a buyback.
    event CustodyStateChanged(
        uint256 indexed assetId,
        CustodyState indexed state,
        uint256 indexed receiptId
    );

    /// @dev Returns the base ERC-20 contract. The returned value MUST NOT change.
    function token() external view returns (address);

    /// @dev Returns the mirror ERC-721 contract. The returned value MUST NOT change.
    function mirror() external view returns (address);

    /// @dev Returns the receipt ERC-721 contract. The returned value MUST NOT change.
    function receipt() external view returns (address);

    /// @dev Returns the rule module, or the zero address if none has been set.
    /// Once a non-zero address has been returned, the returned value MUST NOT change.
    function ruleModule() external view returns (address);

    /// @dev Returns the custody state of `assetId`.
    /// MUST return `Pooled` for an `assetId` the escrow has never seen. MUST NOT revert.
    function custodyStateOf(uint256 assetId) external view returns (CustodyState);

    /// @dev Exchanges `receiptId` for delivery of its asset.
    /// MUST revert if the caller is not the owner of `receiptId`.
    function redeemPhysical(uint256 receiptId) external;

    /// @dev Sells the asset of `receiptId` back to the pool.
    /// MUST revert if the caller is not the owner of `receiptId`,
    /// or if the payout is lower than `minPayout`.
    /// Returns the amount paid to the caller.
    function instantBuyback(uint256 receiptId, uint256 minPayout) external returns (uint256 payout);

    /// @dev Returns the amount `instantBuyback` would currently pay for `receiptId`.
    /// MAY revert if the buyback is currently unavailable, for example because a price is stale.
    function quoteBuyback(uint256 receiptId) external view returns (uint256 payout);
}

Detachment

A detachment moves one asset out of the pool and into a receipt.

  • The escrow MUST reject a detachment that is not requested by the address returned by ruleModule().
  • The escrow MUST reject a detachment of an asset whose custody state is Detached.
  • The escrow MUST take ownership of exactly one mirror token from the holder, and MUST hold one unit of base tokens for it. In a pair where transferring a mirror token transfers one unit of base tokens with it, the ERC-721 transferFrom of the mirror token satisfies both requirements.
  • The escrow MUST mint exactly one receipt to the holder and MUST set the custody state of the asset to Detached.
  • While the asset is Detached, the escrow MUST NOT release the unit or the mirror token except through a redemption or a buyback of that receipt.
  • The escrow MUST NOT receive mirror tokens as a side effect of receiving base tokens. If the base contract implements IERC7631BaseNFTSkippable, getSkipNFT(escrow) MUST return true.

The call by which the rule module requests a detachment is not standardized. The rule module and the escrow of a pair are deployed together, and no third party calls it.

Redemption

redeemPhysical exchanges a receipt for delivery of the asset.

  • The escrow MUST burn the receipt and MUST set the custody state of the asset to Redeemed.
  • The escrow MUST remove the unit of the receipt from circulation permanently, either by burning it or by transferring it to an address from which it cannot be moved. If the unit is transferred, the recipient MUST NOT receive mirror tokens for it.
  • Delivery of the asset happens outside this interface. An implementation SHOULD emit an event that identifies the asset and the account that redeemed it, so that the custodian can act on it.

Buyback

instantBuyback sells the asset of a receipt back to the pool.

  • The escrow MUST burn the receipt and MUST set the custody state of the asset to Pooled.
  • The escrow MUST return the unit of the receipt to the caller.
  • The escrow MUST pay the caller at least minPayout, or revert. The currency of the payout and the way it is priced are defined by the implementation.
  • An escrow that does not offer buybacks MUST revert in instantBuyback and in quoteBuyback.

Receipt Interface

The receipt contract MUST implement ERC-721 and the following interface.

interface IRedeemablePairReceipt {
    /// @dev Returns the escrow that mints and burns receipts.
    /// Once a non-zero address has been returned, the returned value MUST NOT change.
    function escrow() external view returns (address);

    /// @dev Returns the asset `receiptId` is a claim on.
    /// MUST revert if `receiptId` does not exist.
    function assetIdOf(uint256 receiptId) external view returns (uint256);
}
  • Receipts MUST NOT be minted or burned by any account other than the escrow.
  • A receipt MUST NOT be minted, burned or transferred as a consequence of a transfer of base tokens or mirror tokens.
  • For every existing receipt, custodyStateOf(assetIdOf(receiptId)) MUST return Detached.
  • There MUST NOT be more than one receipt for a given assetId at any time.

Rule Module Interface

The rule module MUST implement the following interface.

interface IRedeemablePairRuleModule {
    /// @dev MUST be emitted when a rule action on `tokenId` has settled, that is,
    /// when its outcome is final.
    ///
    /// `tokenId` is the mirror token the action was applied to. An action that involves
    /// several mirror tokens is reported once, for the token that carries its outcome.
    /// `actor` is the account the action was executed for. For an asynchronous action,
    /// it is the account that requested it, not the account that delivered its result.
    /// `actionId` identifies the action. It is defined by the rule set.
    /// `requestId` correlates an asynchronous action with its request. It is zero for a
    /// synchronous action.
    /// `result` is the ABI-encoded outcome. Its layout is defined by the rule set.
    event RuleExecuted(
        uint256 indexed tokenId,
        address indexed actor,
        bytes32 indexed actionId,
        uint256 requestId,
        bytes result
    );

    /// @dev Returns the identifier of the rule set. The returned value MUST NOT change.
    function ruleSetId() external view returns (bytes32);

    /// @dev Returns the state of mirror token `tokenId` in the lifecycle defined by the rule set.
    /// MUST NOT revert for a `tokenId` that does not exist.
    function tokenState(uint256 tokenId) external view returns (bytes32);
}
  • A rule set is the combination of the action identifiers, the token states and the result layouts of a rule module. Two rule modules that return the same ruleSetId MUST use the same combination.
  • Action identifiers, token states and rule set identifiers SHOULD be the keccak256 hash of a human-readable string, for example keccak256("ACTION_REVEAL"), keccak256("SEALED").
  • The escrow and the receipt MUST NOT interpret action identifiers, token states or results.
  • A rule module MAY emit further events of its own in addition to RuleExecuted.
  • A rule module that has requested the detachment of a mirror token SHOULD report a distinct token state for that token for as long as its asset is Detached.

Metadata Provider

The mirror contract MAY delegate its ERC-721 metadata to another contract, typically the rule module, so that the metadata of a token can follow its state. A contract that serves this purpose MUST implement the following interface.

interface IRedeemablePairMetadata {
    /// @dev Returns the metadata URI of mirror token `tokenId`,
    /// or an empty string to let the mirror contract use its own URI.
    function tokenURI(uint256 tokenId) external view returns (string memory);
}

A mirror contract that delegates its metadata MUST fall back to its own metadata when the call to the provider reverts or returns an empty string.

Rationale

Custody is standardized and lifecycle is not

An earlier design of the reference implementation described a token with a single enumeration that mixed both concerns: sealed, opened, fused, detached. The first three values describe one product. A pool that allocates assets by auction has no use for them and would have to return values that mean nothing, or would be incompatible with the interface.

Custody is different. Whether an asset backs the fungible supply, is claimed, or is gone is a property of every pool of redeemable assets, and it is the property that integrators need: a marketplace lists a receipt only while its asset is Detached, and a lending protocol values the fungible supply against the assets that are Pooled. The proposal therefore fixes the three custody states and leaves the lifecycle to tokenState.

Opaque identifiers

tokenState, actionId and ruleSetId are bytes32 values and not enumerations or small integers. A numeric table has to be allocated by someone, and two independently written rule sets will assign different meanings to the same number. Hashes of descriptive strings do not collide in practice and need no registry. An integrator that knows a rule set decodes its states and results. An integrator that does not can still index every RuleExecuted event and display that a token changed.

One generic event

A rule set usually has a richer event of its own for each action. RuleExecuted does not replace these events. It exists so that an indexer can follow every pool with one event signature, and so that the outcome of an action is available in one place regardless of whether the action was synchronous or was completed later by an oracle. This is the reason for requestId and for defining actor as the requester.

A separate receipt

The claim on a detached asset is a token of a separate ERC-721 contract and not a flag on the mirror token. A mirror token is burned when the ERC-20 balance of its owner drops below a multiple of the unit, and it stays subject to that rule for as long as it is owned by an ordinary account. Moving the mirror token and its unit into the escrow, and issuing a token of a contract that has no link to ERC-20 balances, removes the claim from that mechanism entirely. It also lets the claim be traded on any ERC-721 marketplace without that marketplace being aware of dual nature token pairs.

Discovery starts at the escrow

The escrow returns the base, the mirror, the receipt and the rule module, and the receipt returns the escrow. The base and the mirror are not required to implement anything beyond ERC-7631. This keeps existing pairs compatible: an escrow, a receipt and a rule module can be deployed for a pair whose token contracts cannot be changed, provided the pair can exempt the escrow from automatic ERC-721 minting.

The detachment call is not standardized

The call from the rule module to the escrow carries the description of the asset, and that description differs between asset classes. No third party makes this call, so standardizing it would constrain implementations without enabling any integration. The observable result of the call is fully specified.

Metadata signature

The metadata provider uses the signature of tokenURI from the metadata extension of ERC-721. Existing tooling can read it, and a contract that already serves ERC-721 metadata can be used as a provider unchanged.

Backwards Compatibility

This proposal is compatible with ERC-20, ERC-721 and ERC-7631. It adds contracts next to a dual nature token pair and requires no change to the interfaces of the base and mirror contracts.

A pair whose base contract does not let an account opt out of automatic ERC-721 minting cannot satisfy the requirement that the escrow receives no mirror tokens as a side effect of receiving base tokens.

Security Considerations

The rule module is trusted with allocation

The escrow enforces that an asset has at most one receipt, that the unit of a receipt stays locked, and that only the owner of a receipt settles it. It does not verify that the asset named in a detachment exists or that the token was entitled to it. A malicious or faulty rule module can therefore issue receipts for assets that are not in custody. The rule module of a pair SHOULD be immutable once set, and users SHOULD treat the ruleSetId and the code behind it as part of what they are buying.

Custody is an off-chain fact

CustodyState describes what the contracts have recorded. It does not prove that the asset is physically held, authentic or deliverable. Implementations SHOULD make the custodian and the evidence of custody discoverable, and integrators SHOULD NOT treat Pooled or Detached as an attestation.

Permanent removal of the unit

If a redemption transfers the unit to a lock address instead of burning it, that address MUST be one from which the tokens cannot be moved, and it MUST be exempt from automatic ERC-721 minting. Otherwise each redemption creates a mirror token that is not backed by an asset.

Buyback pricing

A buyback pays out against a valuation of the asset. If that valuation or an exchange rate used to convert it is stale or can be manipulated, the pool can be drained through repeated detachments and buybacks. Implementations SHOULD bound the age of every price they use, SHOULD fund payouts from a dedicated budget, and MUST honour minPayout so that a receipt owner is protected against a change of valuation while the transaction is pending.

Asynchronous actions

When the outcome of an action is delivered later, for example by a randomness oracle, the token can be transferred or burned between the request and the result. A rule module MUST define what happens in that case and MUST NOT settle an action for a token whose state no longer matches the request. The callback that delivers the result SHOULD have a bounded gas cost, since it also emits RuleExecuted with an arbitrary result.

Reentrancy

Settlement burns a receipt, transfers base tokens and pays out. Implementations SHOULD update the custody state and burn the receipt before making external calls, and SHOULD guard settlement functions against reentrancy.

Untrusted metadata

A metadata provider is an external contract. A mirror contract MUST NOT let a reverting or misbehaving provider make its own tokenURI revert.

Copyright and related rights waived via CC0.

EIP.tools

EIP.tools

Search, read, and map Ethereum improvement proposals, ERCs, RIPs, and CAIPs from one focused interface.

Farcaster
by @apoorveth