{"eip":2021,"title":"Payoutable Token","description":"An extension to the [ERC-20] standard token that allows Token wallet owners to request payout from their wallet, by calling the smart contract and attaching a payout instruction string.","authors":["Fernando Paris \u003cfer@io.builders\u003e","Julio Faura \u003cjulio@adhara.io\u003e","Daniel Lehrner \u003cdaniel@io.builders\u003e"],"status":"Stagnant","type":"Standards Track","category":"ERC","created":"2019-05-10","requires":[20,1066,1996],"discussionsTo":"https://github.com/ethereum/EIPs/issues/2106","repo":"ERCs","label":"ERC-2021","officialUrl":"https://eips.ethereum.org/EIPS/eip-2021","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-2021.md","url":"https://eips.huatuo.xyz/eip-2021/","tldr":{"en":"A proposed ERC-20 extension that lets holders of an issuer-backed token (such as a bank-issued stablecoin) request an off-chain payout on-chain, with a tracked lifecycle from order to burn or rejection.","ja":"発行者が裏付けを持つトークン（銀行発行のステーブルコインなど）の保有者が、オフチェーンでの払い出しをオンチェーンで依頼できるようにする ERC-20 拡張の提案。注文からバーンまたは拒否までのライフサイクルを追跡する。","ko":"발행자가 보증하는 토큰(은행이 발행한 스테이블코인 등)의 보유자가 오프체인 지급을 온체인에서 요청할 수 있게 하는 ERC-20 확장 제안. 주문부터 소각 또는 거절까지의 수명 주기를 추적한다.","zh":"一项 ERC-20 扩展提案：让发行方背书的代币（如银行发行的稳定币）的持有者在链上发起链下赎回请求，并跟踪从下单到销毁或拒绝的完整生命周期。"},"tags":["token","payout","stablecoin","e-money"],"explainers":{"en":{"lang":"en","tldr":"A proposed ERC-20 extension that lets holders of an issuer-backed token (such as a bank-issued stablecoin) request an off-chain payout on-chain, with a tracked lifecycle from order to burn or rejection.","tags":["token","payout","stablecoin","e-money"],"related":[20,1996,1066],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-2021/","markdown":"## What problem does it solve?\n\nFor tokens that represent money held by an issuer, cashing out (\"payout\" or redemption) usually starts outside the chain: the holder contacts the issuer, the issuer burns tokens and sends a bank transfer. The request itself, its status and its outcome are invisible on-chain.\n\nERC-2021 moves the start of that workflow on-chain. A holder (or someone they authorise) places a payout order on the token contract, funds are locked, and the issuer's operator moves the order through defined states until the tokens are burned or returned.\n\n## How it works\n\nActors:\n\n- **Token wallet owner:** holds the tokens and orders the payout.\n- **Orderer:** an address the owner authorised (`authorizePayoutOperator`) to order payouts on their behalf.\n- **Operator:** the token issuer or its agent, who processes requests.\n\nLifecycle of one payout, identified by a string `operationId`:\n\n1. `orderPayout(operationId, value, instructions)` or `orderPayoutFrom(...)` puts the funds on hold (using [ERC-1996](/eip-1996/) holds) and sets status **Ordered**. Reusing an `operationId` must revert.\n2. `processPayout` sets **InProcess**. From here the orderer can no longer cancel.\n3. `putFundsInSuspenseInPayout` executes the hold, moving funds to a suspense wallet: **FundsInSuspense**.\n4. The operator pays out off-chain, then `executePayout` burns the tokens: **Executed**.\n\nAlternatively the operator can `rejectPayout(operationId, reason)` (**Rejected**, funds released), or the orderer can `cancelPayout` while still **Ordered** (**Cancelled**). Reasons may use [ERC-1066](/eip-1066/) status codes. Every transition emits an event, and `retrievePayoutData` returns the wallet, amount, instructions and status.\n\n## Sample code\n\nOrdering and tracking a payout with ethers v6 (the destination details are referenced, not stored in plain text):\n\n```ts\nimport { Contract, Wallet, JsonRpcProvider, parseUnits } from \"ethers\";\n\nconst abi = [\n  \"function orderPayout(string operationId, uint256 value, string instructions) returns (bool)\",\n  \"function retrievePayoutData(string operationId) view returns (address walletToDebit, uint256 value, string instructions, uint8 status)\",\n];\nconst STATUS = [\"Nonexistent\", \"Ordered\", \"InProcess\", \"FundsInSuspense\", \"Executed\", \"Rejected\", \"Cancelled\"];\n\nconst wallet = new Wallet(process.env.PRIVATE_KEY!, new JsonRpcProvider(process.env.RPC_URL));\nconst token = new Contract(process.env.TOKEN!, abi, wallet);\n\nconst opId = `myapp-${crypto.randomUUID()}`;          // unique prefix avoids collisions\nawait (await token.orderPayout(opId, parseUnits(\"100\", 18), \"ref:encrypted-instruction-id\")).wait();\n\nconst [, , , status] = await token.retrievePayoutData(opId);\nconsole.log(STATUS[Number(status)]);                    // \"Ordered\"\n```\n\n## Things to know\n\n- Status is **Stagnant**, and it depends on [ERC-1996](/eip-1996/) and [ERC-1066](/eip-1066/), which are also Stagnant.\n- The spec explicitly warns against putting bank details or other payout instructions on-chain in plain text. Use private channels, or at most an encrypted value or reference.\n- Everything after the order relies on the operator: the standard records the workflow but cannot force the off-chain payment.\n- The spec text has inconsistencies (e.g. it names `isApprovedToOrderPayout` in prose but `isPayoutOperatorFor` in the interface), so check a concrete implementation's ABI.\n"},"ja":{"lang":"ja","tldr":"発行者が裏付けを持つトークン（銀行発行のステーブルコインなど）の保有者が、オフチェーンでの払い出しをオンチェーンで依頼できるようにする ERC-20 拡張の提案。注文からバーンまたは拒否までのライフサイクルを追跡する。","tags":["token","payout","stablecoin","e-money"],"related":[20,1996,1066],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-2021/","markdown":"## 何を解決するのか\n\n発行者が保有する資金を表すトークンでは、現金化（「ペイアウト」または償還）は通常チェーンの外で始まります。保有者が発行者に連絡し、発行者がトークンをバーンして銀行振込を行います。依頼そのもの、ステータス、結果はオンチェーンでは見えません。\n\nERC-2021 はこのワークフローの開始点をオンチェーンに移します。保有者（または保有者が許可した人）がトークンコントラクト上でペイアウト注文を出すと、資金がロックされ、発行者のオペレーターが、トークンがバーンまたは返却されるまで注文を定義された状態に沿って進めます。\n\n## 仕組み\n\n登場するアクター:\n\n- **トークンウォレットの所有者:** トークンを保有し、ペイアウトを注文する。\n- **Orderer（注文者）:** 所有者が（`authorizePayoutOperator` で）自分に代わってペイアウトを注文することを許可したアドレス。\n- **Operator（オペレーター）:** トークンの発行者またはその代理人で、依頼を処理する。\n\n文字列の `operationId` で識別される 1 件のペイアウトのライフサイクル:\n\n1. `orderPayout(operationId, value, instructions)` または `orderPayoutFrom(...)` が、（[ERC-1996](/eip-1996/) の hold を使って）資金を保留し、ステータスを **Ordered** にします。`operationId` を再利用した場合は revert しなければなりません。\n2. `processPayout` が **InProcess** にします。この時点から注文者はキャンセルできません。\n3. `putFundsInSuspenseInPayout` が hold を実行し、資金を仮受（suspense）ウォレットに移します: **FundsInSuspense**。\n4. オペレーターがオフチェーンで支払いを行い、その後 `executePayout` がトークンをバーンします: **Executed**。\n\nこれとは別に、オペレーターは `rejectPayout(operationId, reason)` を呼ぶことができ（**Rejected**、資金は解放）、注文者はまだ **Ordered** の間であれば `cancelPayout` できます（**Cancelled**）。理由には [ERC-1066](/eip-1066/) のステータスコードを使えます。すべての状態遷移でイベントが発行され、`retrievePayoutData` はウォレット、金額、instructions、ステータスを返します。\n\n## サンプルコード\n\nethers v6 でペイアウトを注文して追跡する例（送金先の詳細は平文で保存せず、参照のみを渡します）:\n\n```ts\nimport { Contract, Wallet, JsonRpcProvider, parseUnits } from \"ethers\";\n\nconst abi = [\n  \"function orderPayout(string operationId, uint256 value, string instructions) returns (bool)\",\n  \"function retrievePayoutData(string operationId) view returns (address walletToDebit, uint256 value, string instructions, uint8 status)\",\n];\nconst STATUS = [\"Nonexistent\", \"Ordered\", \"InProcess\", \"FundsInSuspense\", \"Executed\", \"Rejected\", \"Cancelled\"];\n\nconst wallet = new Wallet(process.env.PRIVATE_KEY!, new JsonRpcProvider(process.env.RPC_URL));\nconst token = new Contract(process.env.TOKEN!, abi, wallet);\n\nconst opId = `myapp-${crypto.randomUUID()}`;          // unique prefix avoids collisions\nawait (await token.orderPayout(opId, parseUnits(\"100\", 18), \"ref:encrypted-instruction-id\")).wait();\n\nconst [, , , status] = await token.retrievePayoutData(opId);\nconsole.log(STATUS[Number(status)]);                    // \"Ordered\"\n```\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** で、同じく Stagnant の [ERC-1996](/eip-1996/) と [ERC-1066](/eip-1066/) に依存しています。\n- 仕様は、銀行口座情報などのペイアウト指示を平文でオンチェーンに載せないよう明確に警告しています。非公開のチャネルを使うか、せいぜい暗号化した値か参照にとどめてください。\n- 注文後のすべてはオペレーターに依存します。この標準はワークフローを記録しますが、オフチェーンの支払いを強制することはできません。\n- 仕様の文面には不整合があります（例: 本文では `isApprovedToOrderPayout` と書かれていますが、インターフェースでは `isPayoutOperatorFor` です）。具体的な実装の ABI を確認してください。\n"},"ko":{"lang":"ko","tldr":"발행자가 보증하는 토큰(은행이 발행한 스테이블코인 등)의 보유자가 오프체인 지급을 온체인에서 요청할 수 있게 하는 ERC-20 확장 제안. 주문부터 소각 또는 거절까지의 수명 주기를 추적한다.","tags":["token","payout","stablecoin","e-money"],"related":[20,1996,1066],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-2021/","markdown":"## 어떤 문제를 해결하나요?\n\n발행자가 보유한 돈을 나타내는 토큰은 현금화(\"페이아웃\" 또는 상환)가 보통 체인 밖에서 시작됩니다. 보유자가 발행자에게 연락하면 발행자가 토큰을 소각하고 은행 송금을 합니다. 요청 자체, 상태, 결과는 온체인에서 보이지 않습니다.\n\nERC-2021은 이 워크플로의 시작을 온체인으로 옮깁니다. 보유자(또는 보유자가 승인한 사람)가 토큰 컨트랙트에 페이아웃 주문을 내면 자금이 잠기고, 발행자의 오퍼레이터가 토큰이 소각되거나 반환될 때까지 정해진 상태를 따라 주문을 진행시킵니다.\n\n## 어떻게 동작하나요?\n\n참여자:\n\n- **토큰 지갑 소유자:** 토큰을 보유하고 페이아웃을 주문합니다.\n- **Orderer(주문자):** 소유자가 (`authorizePayoutOperator`로) 자신을 대신해 페이아웃을 주문하도록 승인한 주소.\n- **Operator(오퍼레이터):** 토큰 발행자 또는 그 대리인으로, 요청을 처리합니다.\n\n문자열 `operationId`로 식별되는 페이아웃 한 건의 수명 주기:\n\n1. `orderPayout(operationId, value, instructions)` 또는 `orderPayoutFrom(...)`이 ([ERC-1996](/eip-1996/)의 hold를 사용해) 자금을 보류하고 상태를 **Ordered**로 설정합니다. `operationId`를 재사용하면 revert되어야 합니다.\n2. `processPayout`이 **InProcess**로 설정합니다. 이 시점부터 주문자는 더 이상 취소할 수 없습니다.\n3. `putFundsInSuspenseInPayout`이 hold를 실행해 자금을 가수금(suspense) 지갑으로 옮깁니다: **FundsInSuspense**.\n4. 오퍼레이터가 오프체인에서 지급한 뒤 `executePayout`이 토큰을 소각합니다: **Executed**.\n\n그 대신 오퍼레이터가 `rejectPayout(operationId, reason)`을 호출할 수도 있고(**Rejected**, 자금 해제), 주문자가 아직 **Ordered**인 동안 `cancelPayout`을 호출할 수도 있습니다(**Cancelled**). 사유에는 [ERC-1066](/eip-1066/) 상태 코드를 쓸 수 있습니다. 모든 상태 전이는 이벤트를 발생시키고, `retrievePayoutData`는 지갑, 금액, instructions, 상태를 반환합니다.\n\n## 샘플 코드\n\nethers v6로 페이아웃을 주문하고 추적하기(수취 정보는 평문으로 저장하지 않고 참조만 합니다):\n\n```ts\nimport { Contract, Wallet, JsonRpcProvider, parseUnits } from \"ethers\";\n\nconst abi = [\n  \"function orderPayout(string operationId, uint256 value, string instructions) returns (bool)\",\n  \"function retrievePayoutData(string operationId) view returns (address walletToDebit, uint256 value, string instructions, uint8 status)\",\n];\nconst STATUS = [\"Nonexistent\", \"Ordered\", \"InProcess\", \"FundsInSuspense\", \"Executed\", \"Rejected\", \"Cancelled\"];\n\nconst wallet = new Wallet(process.env.PRIVATE_KEY!, new JsonRpcProvider(process.env.RPC_URL));\nconst token = new Contract(process.env.TOKEN!, abi, wallet);\n\nconst opId = `myapp-${crypto.randomUUID()}`;          // unique prefix avoids collisions\nawait (await token.orderPayout(opId, parseUnits(\"100\", 18), \"ref:encrypted-instruction-id\")).wait();\n\nconst [, , , status] = await token.retrievePayoutData(opId);\nconsole.log(STATUS[Number(status)]);                    // \"Ordered\"\n```\n\n## 알아둘 점\n\n- 상태는 **Stagnant**이며, 마찬가지로 Stagnant인 [ERC-1996](/eip-1996/)과 [ERC-1066](/eip-1066/)에 의존합니다.\n- 명세는 은행 계좌 정보 등 페이아웃 지시를 평문으로 온체인에 올리지 말라고 분명히 경고합니다. 비공개 채널을 쓰거나, 많아야 암호화된 값이나 참조만 쓰세요.\n- 주문 이후의 모든 단계는 오퍼레이터에게 달려 있습니다. 이 표준은 워크플로를 기록할 뿐, 오프체인 지급을 강제할 수는 없습니다.\n- 명세 본문에는 불일치가 있습니다(예: 본문에는 `isApprovedToOrderPayout`이라고 되어 있지만 인터페이스에는 `isPayoutOperatorFor`가 있습니다). 구체적인 구현의 ABI를 확인하세요.\n"},"zh":{"lang":"zh","tldr":"一项 ERC-20 扩展提案：让发行方背书的代币（如银行发行的稳定币）的持有者在链上发起链下赎回请求，并跟踪从下单到销毁或拒绝的完整生命周期。","tags":["token","payout","stablecoin","e-money"],"related":[20,1996,1066],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-2021/","markdown":"## 它解决什么问题？\n\n对于代表发行方所持资金的代币，兑现（“赎回”或“提现”）通常从链外开始：持有者联系发行方，发行方销毁代币并发起银行转账。请求本身、状态和结果在链上都是不可见的。\n\nERC-2021 把这个流程的起点搬到链上。持有者（或其授权的人）在代币合约上提交赎回订单，资金被锁定，发行方的操作员按既定状态推进订单，直到代币被销毁或退回。\n\n## 它如何运作\n\n参与角色：\n\n- **代币钱包所有者：** 持有代币并下达赎回订单。\n- **Orderer（下单者）：** 所有者授权（`authorizePayoutOperator`）代其下达赎回订单的地址。\n- **Operator（操作员）：** 代币发行方或其代理，负责处理请求。\n\n一笔赎回的生命周期，由字符串 `operationId` 标识：\n\n1. `orderPayout(operationId, value, instructions)` 或 `orderPayoutFrom(...)` 会（使用 [ERC-1996](/eip-1996/) 的 hold）冻结资金，并将状态设为 **Ordered**。重复使用 `operationId` 必须 revert。\n2. `processPayout` 将状态设为 **InProcess**。从这一步起，下单者无法再取消。\n3. `putFundsInSuspenseInPayout` 执行 hold，把资金转入暂记（suspense）钱包：**FundsInSuspense**。\n4. 操作员在链下付款，然后 `executePayout` 销毁代币：**Executed**。\n\n另外，操作员可以调用 `rejectPayout(operationId, reason)`（**Rejected**，资金释放），下单者也可以在订单仍为 **Ordered** 时调用 `cancelPayout`（**Cancelled**）。原因可以使用 [ERC-1066](/eip-1066/) 状态码。每次状态转换都会触发事件，`retrievePayoutData` 返回钱包、金额、instructions 和状态。\n\n## 示例代码\n\n用 ethers v6 下达并跟踪赎回订单（收款详情只是引用，不以明文存储）：\n\n```ts\nimport { Contract, Wallet, JsonRpcProvider, parseUnits } from \"ethers\";\n\nconst abi = [\n  \"function orderPayout(string operationId, uint256 value, string instructions) returns (bool)\",\n  \"function retrievePayoutData(string operationId) view returns (address walletToDebit, uint256 value, string instructions, uint8 status)\",\n];\nconst STATUS = [\"Nonexistent\", \"Ordered\", \"InProcess\", \"FundsInSuspense\", \"Executed\", \"Rejected\", \"Cancelled\"];\n\nconst wallet = new Wallet(process.env.PRIVATE_KEY!, new JsonRpcProvider(process.env.RPC_URL));\nconst token = new Contract(process.env.TOKEN!, abi, wallet);\n\nconst opId = `myapp-${crypto.randomUUID()}`;          // unique prefix avoids collisions\nawait (await token.orderPayout(opId, parseUnits(\"100\", 18), \"ref:encrypted-instruction-id\")).wait();\n\nconst [, , , status] = await token.retrievePayoutData(opId);\nconsole.log(STATUS[Number(status)]);                    // \"Ordered\"\n```\n\n## 需要注意\n\n- 状态为 **Stagnant**，并且依赖同样处于 Stagnant 的 [ERC-1996](/eip-1996/) 和 [ERC-1066](/eip-1066/)。\n- 规范明确警告不要把银行账户信息或其他赎回指令以明文放到链上。请使用私密渠道，至多使用加密值或引用。\n- 下单之后的一切都依赖操作员：该标准记录了工作流程，但无法强制链下付款。\n- 规范文本存在不一致之处（例如正文中写的是 `isApprovedToOrderPayout`，而接口中是 `isPayoutOperatorFor`），所以请检查具体实现的 ABI。\n"}},"requiredBy":[2020]}
