EIPs Explained

ERC-7291 · Final · ERC · 2023-06-24

ERC-7291: Purpose bound money

Purpose Bound Money wraps a stablecoin-like ERC-20 token inside an ERC-1155 token that can move freely but only releases the underlying money to approved merchants, enabling programmable vouchers and conditional payouts.

What problem does it solve?

Many payments come with strings attached: government vouchers that can only be spent at approved shops, learning grants released only after a course, or escrow payouts tied to construction milestones. Building these on-chain usually means a bespoke contract per program, which wallets and payment systems then have to integrate one by one.

ERC-7291 defines a common interface for Purpose Bound Money (PBM): a digital voucher that holds real digital money underneath and carries the rules for how it may be spent. The goal is interoperability across wallets, payment rails and issuers instead of walled gardens.

How it works

A PBM has two layers:

  • sovToken (store of value): an ERC-20 compatible token such as a stablecoin, tokenized deposit or CBDC token. This is the actual money.
  • PBM Wrapper: an ERC-1155 contract that locks the sovToken and attaches conditions. Each ERC-1155 token id is a PBM type with immutable details: name, faceValue, expiry and uri.

The lifecycle:

  1. Wrap / mint: the issuer approves the wrapper to pull sovTokens, then calls safeMint. The sovToken is locked and a TokenWrap event is emitted.
  2. Transfer: PBMs are bearer instruments and can be passed between wallets with normal ERC-1155 transfers. Rules about who may hold them can be enforced here.
  3. Unwrap: when a PBM is sent to an address that a compliance guard reports as a whitelisted merchant/redeemer and not blacklisted, the PBM is burned and the underlying sovToken is released to that merchant (TokenUnwrapForTarget). The merchant receives plain money with no further restrictions, just like a paper voucher being exchanged for cash.
  4. Revoke: after expiry, the creator can call revokePBM to recover sovTokens locked in unused PBMs.

The architecture is modular: core logic (whitelist, unwrap, mint/burn), optional plugins (extra functionality like usage tracking) and hooks (extra checks like spending limits or expiry). An optional extension (PBMRC2) supports "empty" PBMs that are loaded with money later via load / unload.

Sample code

The compliance guard and a few core calls, trimmed from the spec:

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

interface IComplianceGuard {
    function isBlacklisted(address _address) external returns (bool);
    function isMerchant(address _address) external returns (bool);
    event MerchantList(string action, address[] addresses, string metadata);
    event Blacklist(string action, address[] addresses, string metadata);
}

interface IPBMRC1Core {
    function initialise(address _sovToken, uint256 _expiry, address _pbmWrapperLogic) external;
    function safeMint(address receiver, uint256 tokenId, uint256 amount, bytes calldata data) external;
    function safeTransferFrom(address from, address to, uint256 id, uint256 amount, bytes memory data) external;
    function revokePBM(uint256 tokenId) external;

    event TokenWrap(address from, uint256[] tokenIds, uint256[] amounts, address sovToken, uint256 sovTokenValue);
    event TokenUnwrapForTarget(address from, address to, uint256[] tokenIds, uint256[] amounts, address sovToken, uint256 sovTokenValue);
}

Issuing a voucher (ethers v6):

// 1. let the PBM contract pull the backing tokens
await sovToken.approve(pbmAddress, totalBacking);
// 2. mint 100 vouchers of type 0 to a recipient
await pbm.safeMint(recipient, 0, 100, "0x");
// later, the holder pays a merchant: if `merchant` passes the compliance guard,
// the PBM is burned and the underlying sovToken goes to the merchant
await pbm.connect(holder).safeTransferFrom(holder.address, merchant, 0, 1, "0x");

Things to know

  • Status is Final.
  • Both a whitelist and a blacklist are mandatory; the spec explains that a whitelist alone makes banning one address expensive, and a blacklist alone cannot express "approved merchants only".
  • What counts as a valid purpose is deliberately left to implementers. Two PBM contracts can share the interface yet enforce very different rules, so read and audit the business logic.
  • Minting, burning and revocation permissions are security-critical. A leaked mint role means unbacked vouchers; careless unwrap logic invites reentrancy and double spending.
  • Fee-on-transfer or unusual ERC-20 tokens used as sovToken can break accounting between PBM supply and locked collateral.

#token #payments #stablecoin #erc1155 #programmable-money

Details

Authors
Orchid-Dev (@proj-orchid-straitsx), Victor Liew (@alcedo), Wong Tse Jian (@wongtsejian), Jacob Shan (@Jacobshan429), Chin Sin Ong (@chinsinong), Praveen Kumar (@veenkumarr)
Status
Final
Type
Standards Track / ERC
Created
2023-06-24
Requires
Required by

Machine-readable: Markdown · JSON