ERC-8339: Receiver-Attested Transfers

Hi all,

I have reworked ERC-8339 and am replacing the escrow design. The draft now specifies transfers
that run only if the receiver has signed consent for exactly that transfer. It needs no escrow
and no second transaction, and nothing sits in a pending state. It builds on EIP-8141 frame
transactions. The title changes to Receiver-Attested Transfers.

Draft: Add ERC: Receiver-Attested Transfers by muhammadaus · Pull Request #1882 · ethereum/ERCs · GitHub

The problem

A normal transfer is one-sided. The sender acts, the receiver does nothing and a mistyped or
poisoned address owns the funds the moment the transaction lands.

An earlier version of this draft fixed that with an escrow: deposit first, the receiver accepts
later, revoke if something is wrong. EIP-8141 makes the deposit unnecessary, because the
receiver’s consent can now be checked in the same transaction as the send.

How it works

  1. The sender asks. The sender’s wallet sends a ConsentRequest to the person over a
    private messaging channel the two already share. The request contains sender, asset,
    amount, a random challenge and a deadline. It has no receiver field.
  2. The receiver signs. The receiver signs an EIP-712 TransferConsent that names their own
    address, and replies.
  3. The sender sends once. The sender submits one frame transaction:
Frame mode flags does
0 VERIFY self_verify sender’s own auth
1 DEFAULT ATOMIC_BATCH guard.check(consent, sig)
2 SENDER the actual transfer

The guard reads frame 2 itself with FRAMEPARAM and FRAMEDATACOPY: target, value and
calldata. It reverts unless that frame is exactly the consented transfer. Because frames 1
and 2 are an atomic batch, a mismatch skips the transfer and nothing moves.

What you get:

  • No custody, no approvals, no pending state, no revoke or reclaim.
  • No typed address. The address paid is the one whose key signed. A typo can’t be signed
    for, so it can’t receive anything.
  • Each consent pays once. The guard records the consent digest, and the record rolls back
    with the batch if the transfer fails.
  • Third-party replay is impossible. The nonce, the frame tx signature hash and the guard’s
    TXPARAM(SENDER) check block it. A front-runner can’t burn someone else’s consent, because
    the sender check runs before the record is touched.
  • Smart accounts and wrong chains. ERC-1271 receivers are supported, and binding the
    consent to the chain catches “same address, wrong chain”.

Transport: bytes

The draft fixes the bytes of the two messages and no transport. The messages aren’t secret: a
response works only for its one sender, asset, amount, chain and deadline. So any relay can
carry them and none has to be trusted. The draft recommends end-to-end encrypted,
censorship-resistant messaging (Waku, XMTP, Nostr, Status…).

The request MUST go to the person, never to a typed address. Address-based delivery to a typo
would hand the request to the stranger at that address.

Design decisions I most want feedback on

  1. Guard as DEFAULT + ATOMIC_BATCH instead of a VERIFY frame. A non-approving
    VERIFY would make a mismatched tx invalid, so the sender wouldn’t even pay gas. But the
    8141 public mempool only recognizes it for the expiry verifier. Is the atomic-batch
    approach the right call, or should a strict VERIFY variant be first-class?
  2. Exact calldata matching for the transfer frame, especially which ERC-721 and ERC-1155
    call shapes to accept.
  3. The trade-off that the receiver must answer before the send. Is losing “send to someone
    offline” acceptable given what the escrow cost?

Prior art

ERC-1996, ERC-2020 and ERC-5528 touched adjacent ground as token extensions and stalled. This
draft changes no token. It uses EIP-8141 so the receiver’s consent and the transfer are checked
in one transaction.

The reference implementation (Foundry, with a mock frame introspector, plus a Yul wrapper for
the 8141 opcodes) is in the PR’s assets directory. Feedback welcome.

I’m not if it’s doable because user can also send to wrong escrow address. What you could do is to extend ERC20 with new functions that implement the multi-step transfer.

This only work on newly deployed erc20?(Maybe I am missing something)

Sending to the wrong address is another problem that can be solved by something similar to post-tx confirmations or clear signing. Also, it does not need to be a fixed address.