---
eip: 7573
label: ERC-7573
title: Conditional-upon-Transfer-Decryption for DvP
status: Draft
type: Standards Track
category: ERC
created: 2023-12-05
official: https://eips.ethereum.org/EIPS/eip-7573
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7573.md
canonical: https://eips.huatuo.xyz/eip-7573/
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]
---

# ERC-7573: Conditional-upon-Transfer-Decryption for DvP

> A Protocol for Secure Delivery-versus-Payment across two Blockchains

**TL;DR:** 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.

## What problem does it solve?

In 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.

ERC-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.

## How it works

Two contracts, one per chain:

- **`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`).
- **`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.

The 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.

Keys 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.

The 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.

## Sample code

The locking side, as defined in the spec (events omitted):

```solidity
interface ILockingContract {
    function inceptTransfer(uint256 id, int amount, address from, address to,
        bytes memory transaction, bytes memory keyHashedSeller, bytes memory keyEncryptedSeller) external;
    function confirmTransfer(uint256 id, int amount, address from, address to,
        bytes memory transaction, bytes memory keyHashedBuyer, bytes memory keyEncryptedBuyer) external;
    function cancelTransfer(uint256 id, int amount, address from, address to,
        bytes memory transaction, bytes memory keyHashedSeller, bytes memory keyEncryptedSeller) external;
    function transferWithKey(uint256 id, bytes memory key) external;
}
```

The overall flow as pseudocode:

```text
asset chain:   seller.inceptTransfer(id, ..., H(Ks), E(Ks))
asset chain:   buyer.confirmTransfer(id, ..., H(Kb), E(Kb))        -> asset locked
payment chain: incept/confirm payment with E(Kb) as success, E(Ks) as failure
payment chain: transferAndDecrypt(id)
                 payment ok?  -> TransferKeyRequested(E(Kb))
                 payment fail -> TransferKeyRequested(E(Ks))
oracle:        decrypt, call releaseKey(id, K)  -> TransferKeyReleased(K)
asset chain:   transferWithKey(id, K)   -> to buyer if K == Kb, back to seller if K == Ks
```

## Things to know

- Status is **Draft**, and the specification has been revised substantially; check the latest text before implementing.
- 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.
- 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.
- 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.
- `amount` is a signed `int`, unlike most token standards.


---

This is an unofficial plain-language summary. Read the full specification: https://eips.ethereum.org/EIPS/eip-7573
