{"eip":7573,"title":"Conditional-upon-Transfer-Decryption for DvP","description":"A Protocol for Secure Delivery-versus-Payment across two Blockchains","authors":["Christian Fries (@cfries)","Peter Kohl-Landgraf (@pekola)"],"status":"Draft","type":"Standards Track","category":"ERC","created":"2023-12-05","discussionsTo":"https://ethereum-magicians.org/t/eip-7573-conditional-upon-transfer-decryption-for-delivery-versus-payment/17232","repo":"ERCs","label":"ERC-7573","officialUrl":"https://eips.ethereum.org/EIPS/eip-7573","sourceUrl":"https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7573.md","url":"https://eips.huatuo.xyz/eip-7573/","tldr":{"en":"A delivery-versus-payment protocol across two blockchains: the asset is locked under two hashed keys, and a stateless decryption oracle reveals the right key depending on whether the payment on the other chain succeeded.","ja":"2 つのブロックチェーンにまたがる DvP（引渡し対支払い）プロトコル。資産は 2 つのハッシュ化された鍵でロックされ、ステートレスな復号オラクルが、もう一方のチェーンでの支払いが成功したかどうかに応じて正しい鍵を明かす。","ko":"두 블록체인에 걸친 DvP(인도 대 지급) 프로토콜. 자산은 해시된 두 개의 키 아래 잠기고, 상태 없는 복호화 오라클이 다른 체인의 지급이 성공했는지에 따라 알맞은 키를 공개한다.","zh":"一种跨两条区块链的券款对付（DvP）协议：资产被锁定在两个经哈希的密钥之下，一个无状态的解密预言机根据另一条链上的付款是否成功来揭示正确的密钥。"},"tags":["dvp","cross-chain","settlement","finance","oracle"],"explainers":{"en":{"lang":"en","tldr":"A delivery-versus-payment protocol across two blockchains: the asset is locked under two hashed keys, and a stateless decryption oracle reveals the right key depending on whether the payment on the other chain succeeded.","tags":["dvp","cross-chain","settlement","finance","oracle"],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7573/","markdown":"## What problem does it solve?\n\nIn finance, *delivery versus payment* (DvP) means the asset is delivered if and only if it is paid for. That is easy when both legs live on the same ledger, but often the asset (say a tokenised bond) is on one chain and the cash is on another chain or payment system. Existing approaches rely on API bridges between the systems, or on hash time-locks whose timeouts are hard to get right.\n\nERC-7573 proposes a scheme with no trusted intermediary holding funds: the asset chain locks the asset, the payment chain attempts the payment, and a **stateless decryption oracle** attached to the payment chain releases exactly one of two keys that decides where the locked asset goes.\n\n## How it works\n\nTwo contracts, one per chain:\n\n- **`ILockingContract`** (asset chain). The seller calls `inceptTransfer` with a hash and an encryption of *their* key; the buyer calls `confirmTransfer` with the same trade data and a hash and encryption of *their* key, which locks the asset. Later, `transferWithKey(id, key)`: if `key` hashes to the buyer's value, the asset goes to the buyer (`TokenClaimed`); if it matches the seller's, it returns to the seller (`TokenReclaimed`).\n- **`IDecryptionContract`** (payment chain). The payment is set up with two encrypted keys: `keyEncryptedSuccess` (the buyer's key) and `keyEncryptedFailure` (the seller's key). `transferAndDecrypt(id)` attempts the payment and emits `TransferKeyRequested` with the success key if it worked, or the failure key if it did not. `cancelAndDecrypt` requests the failure key if no transfer was attempted.\n\nThe oracle decrypts the requested key and calls `releaseKey` on the payment contract, which emits `TransferKeyReleased`. Anyone can then present that key to the locking contract to settle the asset.\n\nKeys are encrypted with the oracle's public key. To keep the oracle stateless, the plaintext key document embeds the address of the contract allowed to receive it; the spec proposes an XML format and an oracle `verify` function that returns hashes without revealing keys. Trade data must match exactly across incept/confirm, and each `id` may be used only once.\n\nThe spec also covers asynchronous key generation, callback interfaces for oracle proxies (strict vs best-effort fulfilment) and multi-party DvP, where several legs settle atomically.\n\n## Sample code\n\nThe locking side, as defined in the spec (events omitted):\n\n```solidity\ninterface ILockingContract {\n    function inceptTransfer(uint256 id, int amount, address from, address to,\n        bytes memory transaction, bytes memory keyHashedSeller, bytes memory keyEncryptedSeller) external;\n    function confirmTransfer(uint256 id, int amount, address from, address to,\n        bytes memory transaction, bytes memory keyHashedBuyer, bytes memory keyEncryptedBuyer) external;\n    function cancelTransfer(uint256 id, int amount, address from, address to,\n        bytes memory transaction, bytes memory keyHashedSeller, bytes memory keyEncryptedSeller) external;\n    function transferWithKey(uint256 id, bytes memory key) external;\n}\n```\n\nThe overall flow as pseudocode:\n\n```text\nasset chain:   seller.inceptTransfer(id, ..., H(Ks), E(Ks))\nasset chain:   buyer.confirmTransfer(id, ..., H(Kb), E(Kb))        -\u003e asset locked\npayment chain: incept/confirm payment with E(Kb) as success, E(Ks) as failure\npayment chain: transferAndDecrypt(id)\n                 payment ok?  -\u003e TransferKeyRequested(E(Kb))\n                 payment fail -\u003e TransferKeyRequested(E(Ks))\noracle:        decrypt, call releaseKey(id, K)  -\u003e TransferKeyReleased(K)\nasset chain:   transferWithKey(id, K)   -\u003e to buyer if K == Kb, back to seller if K == Ks\n```\n\n## Things to know\n\n- Status is **Draft**, and the specification has been revised substantially; check the latest text before implementing.\n- The asset leg must be locked for the duration of the trade. The spec treats this as a feature, since locking is what makes multi-party atomic settlement possible.\n- Security rests on the decryption oracle: it must decrypt only for the contract named in the key document, and the parties must trust its key handling and availability.\n- The key, encrypted key and hashed key are opaque `bytes`, so the encryption scheme is implementation-defined and should be inferable from the encrypted key itself.\n- `amount` is a signed `int`, unlike most token standards.\n"},"ja":{"lang":"ja","tldr":"2 つのブロックチェーンにまたがる DvP（引渡し対支払い）プロトコル。資産は 2 つのハッシュ化された鍵でロックされ、ステートレスな復号オラクルが、もう一方のチェーンでの支払いが成功したかどうかに応じて正しい鍵を明かす。","tags":["dvp","cross-chain","settlement","finance","oracle"],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7573/","markdown":"## 何を解決するのか\n\n金融における*引渡し対支払い*（DvP）とは、資産が支払いと引き換えにのみ引き渡されることを意味します。両方のレグが同じ台帳にあれば簡単ですが、資産（たとえばトークン化された債券）が一方のチェーンにあり、資金が別のチェーンや決済システムにあることはよくあります。既存の方法は、システム間の API ブリッジか、タイムアウトの設定が難しいハッシュタイムロックに頼っています。\n\nERC-7573 は、資金を預かる信頼された仲介者のいない方式を提案します。資産チェーンが資産をロックし、支払いチェーンが支払いを試み、支払いチェーンに付随する**ステートレスな復号オラクル**が、ロックされた資産の行き先を決める 2 つの鍵のうち、ちょうど 1 つを解放します。\n\n## 仕組み\n\nチェーンごとに 1 つ、計 2 つのコントラクトがあります。\n\n- **`ILockingContract`**（資産チェーン）。売り手が、ハッシュと*自分の*鍵の暗号文を付けて `inceptTransfer` を呼びます。買い手は、同じ取引データと、*自分の*鍵のハッシュと暗号文を付けて `confirmTransfer` を呼び、これで資産がロックされます。その後 `transferWithKey(id, key)` で、`key` のハッシュが買い手の値と一致すれば資産は買い手へ渡り（`TokenClaimed`）、売り手の値と一致すれば売り手へ戻ります（`TokenReclaimed`）。\n- **`IDecryptionContract`**（支払いチェーン）。支払いは 2 つの暗号化された鍵で設定されます。`keyEncryptedSuccess`（買い手の鍵）と `keyEncryptedFailure`（売り手の鍵）です。`transferAndDecrypt(id)` は支払いを試み、成功すれば成功の鍵、失敗すれば失敗の鍵とともに `TransferKeyRequested` を emit します。`cancelAndDecrypt` は、送金が試みられていない場合に失敗の鍵を要求します。\n\nオラクルは要求された鍵を復号し、支払いコントラクトの `releaseKey` を呼び、`TransferKeyReleased` が emit されます。その後は誰でも、その鍵をロッキングコントラクトに提示して資産を決済できます。\n\n鍵はオラクルの公開鍵で暗号化されます。オラクルをステートレスに保つため、平文の鍵ドキュメントには、それを受け取ってよいコントラクトのアドレスが埋め込まれています。仕様は XML 形式と、鍵を明かさずにハッシュを返すオラクルの `verify` 関数を提案しています。取引データは incept と confirm で完全に一致しなければならず、各 `id` は一度しか使えません。\n\n仕様はさらに、非同期の鍵生成、オラクルプロキシ向けのコールバックインターフェース（厳格な履行とベストエフォートの履行）、そして複数のレグがアトミックに決済されるマルチパーティ DvP も扱います。\n\n## サンプルコード\n\n仕様で定義されているロッキング側（イベントは省略）:\n\n```solidity\ninterface ILockingContract {\n    function inceptTransfer(uint256 id, int amount, address from, address to,\n        bytes memory transaction, bytes memory keyHashedSeller, bytes memory keyEncryptedSeller) external;\n    function confirmTransfer(uint256 id, int amount, address from, address to,\n        bytes memory transaction, bytes memory keyHashedBuyer, bytes memory keyEncryptedBuyer) external;\n    function cancelTransfer(uint256 id, int amount, address from, address to,\n        bytes memory transaction, bytes memory keyHashedSeller, bytes memory keyEncryptedSeller) external;\n    function transferWithKey(uint256 id, bytes memory key) external;\n}\n```\n\n全体の流れを擬似コードで:\n\n```text\nasset chain:   seller.inceptTransfer(id, ..., H(Ks), E(Ks))\nasset chain:   buyer.confirmTransfer(id, ..., H(Kb), E(Kb))        -\u003e asset locked\npayment chain: incept/confirm payment with E(Kb) as success, E(Ks) as failure\npayment chain: transferAndDecrypt(id)\n                 payment ok?  -\u003e TransferKeyRequested(E(Kb))\n                 payment fail -\u003e TransferKeyRequested(E(Ks))\noracle:        decrypt, call releaseKey(id, K)  -\u003e TransferKeyReleased(K)\nasset chain:   transferWithKey(id, K)   -\u003e to buyer if K == Kb, back to seller if K == Ks\n```\n\n## 知っておくべきこと\n\n- ステータスは **Draft** で、仕様は大幅に改訂されています。実装前に最新のテキストを確認してください。\n- 資産のレグは、取引の間ロックされていなければなりません。仕様はこれを機能と捉えています。ロックこそが、マルチパーティのアトミックな決済を可能にするからです。\n- セキュリティは復号オラクルにかかっています。オラクルは鍵ドキュメントに記されたコントラクトに対してだけ復号しなければならず、当事者はその鍵の扱いと可用性を信頼する必要があります。\n- 鍵、暗号化された鍵、ハッシュ化された鍵は不透明な `bytes` なので、暗号方式は実装依存であり、暗号化された鍵自体から推測できるようにすべきです。\n- `amount` は、多くのトークン標準と異なり、符号付きの `int` です。\n"},"ko":{"lang":"ko","tldr":"두 블록체인에 걸친 DvP(인도 대 지급) 프로토콜. 자산은 해시된 두 개의 키 아래 잠기고, 상태 없는 복호화 오라클이 다른 체인의 지급이 성공했는지에 따라 알맞은 키를 공개한다.","tags":["dvp","cross-chain","settlement","finance","oracle"],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7573/","markdown":"## 어떤 문제를 해결하나요?\n\n금융에서 *인도 대 지급(delivery versus payment, DvP)* 은 대금이 지급된 경우에만, 그리고 지급된 경우에는 반드시 자산이 인도된다는 뜻입니다. 양쪽 거래가 같은 원장에 있으면 쉽지만, 자산(예: 토큰화된 채권)은 한 체인에 있고 현금은 다른 체인이나 결제 시스템에 있는 경우가 많습니다. 기존 방식은 시스템 사이의 API 브리지나, 타임아웃을 맞추기 어려운 해시 타임락에 의존합니다.\n\nERC-7573은 자금을 보관하는 신뢰된 중개자가 없는 방식을 제안합니다. 자산 체인이 자산을 잠그고, 지급 체인이 지급을 시도하며, 지급 체인에 붙은 **상태 없는 복호화 오라클**이 잠긴 자산의 행방을 정하는 두 키 중 정확히 하나만 공개합니다.\n\n## 어떻게 동작하나요?\n\n체인마다 하나씩, 두 개의 컨트랙트가 있습니다.\n\n- **`ILockingContract`**(자산 체인). 판매자가 해시와 *자신의* 키 암호문으로 `inceptTransfer`를 호출하고, 구매자가 같은 거래 데이터와 *자신의* 키의 해시 및 암호문으로 `confirmTransfer`를 호출하면 자산이 잠깁니다. 이후 `transferWithKey(id, key)`에서 `key`의 해시가 구매자의 값과 같으면 자산이 구매자에게 가고(`TokenClaimed`), 판매자의 값과 같으면 판매자에게 돌아갑니다(`TokenReclaimed`).\n- **`IDecryptionContract`**(지급 체인). 지급은 암호화된 두 키로 설정됩니다. `keyEncryptedSuccess`(구매자의 키)와 `keyEncryptedFailure`(판매자의 키)입니다. `transferAndDecrypt(id)`는 지급을 시도하여, 성공하면 성공 키로, 실패하면 실패 키로 `TransferKeyRequested`를 emit합니다. `cancelAndDecrypt`는 전송이 시도되지 않았을 때 실패 키를 요청합니다.\n\n오라클은 요청된 키를 복호화해 지급 컨트랙트의 `releaseKey`를 호출하고, 그러면 `TransferKeyReleased`가 emit됩니다. 그 후 누구나 그 키를 락킹 컨트랙트에 제시해 자산을 정산할 수 있습니다.\n\n키는 오라클의 공개키로 암호화됩니다. 오라클을 상태 없이 유지하기 위해, 평문 키 문서에는 이를 받을 수 있는 컨트랙트의 주소가 들어 있습니다. 사양은 XML 형식과, 키를 노출하지 않고 해시를 반환하는 오라클의 `verify` 함수를 제안합니다. 거래 데이터는 incept와 confirm에서 정확히 일치해야 하며, 각 `id`는 한 번만 사용할 수 있습니다.\n\n사양은 비동기 키 생성, 오라클 프록시를 위한 콜백 인터페이스(엄격한 이행 대 최선 노력 이행), 여러 거래가 원자적으로 정산되는 멀티파티 DvP도 다룹니다.\n\n## 샘플 코드\n\n사양에 정의된 락킹 쪽(이벤트 생략):\n\n```solidity\ninterface ILockingContract {\n    function inceptTransfer(uint256 id, int amount, address from, address to,\n        bytes memory transaction, bytes memory keyHashedSeller, bytes memory keyEncryptedSeller) external;\n    function confirmTransfer(uint256 id, int amount, address from, address to,\n        bytes memory transaction, bytes memory keyHashedBuyer, bytes memory keyEncryptedBuyer) external;\n    function cancelTransfer(uint256 id, int amount, address from, address to,\n        bytes memory transaction, bytes memory keyHashedSeller, bytes memory keyEncryptedSeller) external;\n    function transferWithKey(uint256 id, bytes memory key) external;\n}\n```\n\n전체 흐름을 의사코드로:\n\n```text\nasset chain:   seller.inceptTransfer(id, ..., H(Ks), E(Ks))\nasset chain:   buyer.confirmTransfer(id, ..., H(Kb), E(Kb))        -\u003e asset locked\npayment chain: incept/confirm payment with E(Kb) as success, E(Ks) as failure\npayment chain: transferAndDecrypt(id)\n                 payment ok?  -\u003e TransferKeyRequested(E(Kb))\n                 payment fail -\u003e TransferKeyRequested(E(Ks))\noracle:        decrypt, call releaseKey(id, K)  -\u003e TransferKeyReleased(K)\nasset chain:   transferWithKey(id, K)   -\u003e to buyer if K == Kb, back to seller if K == Ks\n```\n\n## 알아둘 점\n\n- 상태는 **Draft**이며 사양이 크게 개정되었습니다. 구현하기 전에 최신 문서를 확인하세요.\n- 자산 쪽 거래는 거래 기간 동안 잠겨 있어야 합니다. 사양은 이를 기능으로 봅니다. 잠금이 멀티파티 원자적 정산을 가능하게 하기 때문입니다.\n- 보안은 복호화 오라클에 달려 있습니다. 오라클은 키 문서에 명시된 컨트랙트에게만 복호화해야 하며, 당사자들은 오라클의 키 관리와 가용성을 신뢰해야 합니다.\n- 키, 암호화된 키, 해시된 키는 불투명한 `bytes`이므로 암호화 방식은 구현이 정하며 암호화된 키 자체에서 유추할 수 있어야 합니다.\n- `amount`는 대부분의 토큰 표준과 달리 부호 있는 `int`입니다.\n"},"zh":{"lang":"zh","tldr":"一种跨两条区块链的券款对付（DvP）协议：资产被锁定在两个经哈希的密钥之下，一个无状态的解密预言机根据另一条链上的付款是否成功来揭示正确的密钥。","tags":["dvp","cross-chain","settlement","finance","oracle"],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7573/","markdown":"## 它解决什么问题？\n\n在金融领域，*券款对付*（DvP）意味着当且仅当付款完成时才交付资产。当两个环节都在同一账本上时，这很容易，但常常是资产（比如代币化债券）在一条链上，而资金在另一条链或支付系统上。现有做法依赖系统之间的 API 桥，或依赖超时设置很难把握的哈希时间锁。\n\nERC-7573 提出一种没有受信任中介持有资金的方案：资产链锁定资产，支付链尝试付款，而挂接在支付链上的**无状态解密预言机**恰好释放两个密钥中的一个，由它决定被锁定的资产去向何处。\n\n## 它如何运作\n\n两个合约，每条链一个：\n\n- **`ILockingContract`**（资产链）。卖方调用 `inceptTransfer`，提交一个哈希和*其*密钥的密文；买方用相同的交易数据以及*其*密钥的哈希和密文调用 `confirmTransfer`，资产就此被锁定。之后调用 `transferWithKey(id, key)`：如果 `key` 的哈希与买方的值一致，资产归买方（`TokenClaimed`）；如果与卖方的值一致，则退回卖方（`TokenReclaimed`）。\n- **`IDecryptionContract`**（支付链）。支付以两个加密密钥设置：`keyEncryptedSuccess`（买方的密钥）和 `keyEncryptedFailure`（卖方的密钥）。`transferAndDecrypt(id)` 尝试付款，成功则触发携带成功密钥的 `TransferKeyRequested`，失败则携带失败密钥。`cancelAndDecrypt` 在没有尝试转账时请求失败密钥。\n\n预言机解密所请求的密钥，并调用支付合约上的 `releaseKey`，由其触发 `TransferKeyReleased`。之后任何人都可以把该密钥提交给锁定合约来结算资产。\n\n密钥用预言机的公钥加密。为了让预言机保持无状态，明文密钥文档中嵌入了允许接收它的合约地址；规范提出了一种 XML 格式，以及一个在不泄露密钥的情况下返回哈希的预言机 `verify` 函数。交易数据在 incept 和 confirm 之间必须完全一致，每个 `id` 只能使用一次。\n\n规范还涵盖异步密钥生成、面向预言机代理的回调接口（严格履行与尽力履行），以及多方 DvP（多个环节原子化结算）。\n\n## 示例代码\n\n规范中定义的锁定端（省略事件）：\n\n```solidity\ninterface ILockingContract {\n    function inceptTransfer(uint256 id, int amount, address from, address to,\n        bytes memory transaction, bytes memory keyHashedSeller, bytes memory keyEncryptedSeller) external;\n    function confirmTransfer(uint256 id, int amount, address from, address to,\n        bytes memory transaction, bytes memory keyHashedBuyer, bytes memory keyEncryptedBuyer) external;\n    function cancelTransfer(uint256 id, int amount, address from, address to,\n        bytes memory transaction, bytes memory keyHashedSeller, bytes memory keyEncryptedSeller) external;\n    function transferWithKey(uint256 id, bytes memory key) external;\n}\n```\n\n整体流程的伪代码：\n\n```text\nasset chain:   seller.inceptTransfer(id, ..., H(Ks), E(Ks))\nasset chain:   buyer.confirmTransfer(id, ..., H(Kb), E(Kb))        -\u003e asset locked\npayment chain: incept/confirm payment with E(Kb) as success, E(Ks) as failure\npayment chain: transferAndDecrypt(id)\n                 payment ok?  -\u003e TransferKeyRequested(E(Kb))\n                 payment fail -\u003e TransferKeyRequested(E(Ks))\noracle:        decrypt, call releaseKey(id, K)  -\u003e TransferKeyReleased(K)\nasset chain:   transferWithKey(id, K)   -\u003e to buyer if K == Kb, back to seller if K == Ks\n```\n\n## 需要注意\n\n- 状态为 **Draft**，规范经过大幅修订；实现前请查看最新文本。\n- 资产环节必须在交易期间保持锁定。规范把这视为一项特性，因为锁定正是实现多方原子结算的前提。\n- 安全性依赖于解密预言机：它只能为密钥文档中指明的合约解密，各方必须信任其密钥处理和可用性。\n- 密钥、加密密钥和哈希密钥都是不透明的 `bytes`，因此加密方案由实现自行定义，并且应能从加密密钥本身推断出来。\n- `amount` 是有符号的 `int`，这与大多数代币标准不同。\n"}}}
