---
eip: 7796
label: ERC-7796
title: Conditional send transaction RPC
status: Review
type: Standards Track
category: ERC
created: 2024-04-16
official: https://eips.ethereum.org/EIPS/eip-7796
source: https://github.com/ethereum/ERCs/blob/master/ERCS/erc-7796.md
canonical: https://eips.huatuo.xyz/eip-7796/
lang: en
tldr: Defines eth_sendRawTransactionConditional, an RPC that lets users tell a block builder or sequencer to include a transaction only if certain state, block range and timestamp conditions hold.
tags: [json-rpc, block-builders, sequencers, mev, account-abstraction]
---

# ERC-7796: Conditional send transaction RPC

> JSON-RPC API for block builders allowing users to express preconditions for transaction inclusion

**TL;DR:** Defines eth_sendRawTransactionConditional, an RPC that lets users tell a block builder or sequencer to include a transaction only if certain state, block range and timestamp conditions hold.

## What problem does it solve?

Private builder APIs make the builder simulate each transaction to decide whether it is worth including. Simulation is CPU-heavy, and the builder still cannot easily tell which transactions depend on each other.

That has odd economic effects. The only way to guarantee no other transaction interferes with yours is to be first in the block, so that slot is very expensive while other positions are cheap. And searching for a good ordering is costly.

ERC-7796 lets the sender state the preconditions for its transaction up front. The builder checks a few storage slots instead of running a full simulation, and different conditional transactions can be ordered safely.

## How it works

Method: `eth_sendRawTransactionConditional(rawTx, options)`

`options` may contain:

| Member | Meaning |
| --- | --- |
| `knownAccounts` | Per-address expectations: a storage root hash (hex string), or an object of exact `slot: value` pairs, plus special keys `balance`, `nonce` and `code` |
| `blockNumberMin` / `blockNumberMax` | Allowed block number range |
| `timestampMin` / `timestampMax` | Allowed block timestamp range |
| `paysCoinbase` | Minimum amount the tx pays the `coinbase` (fees plus direct payment) |

For `code`, `""` means "no code", and a `0xef0100…` prefix means a specific [EIP-7702](/eip-7702/) delegation.

The builder or sequencer should check the ranges, storage roots and slot values, and reject the request if any fail. Errors:

- `-32003` "transaction rejected" with a reason (storage mismatch, out of range…);
- `-32005` "limit exceeded" for repeated failures or an oversized `knownAccounts`.

On success it returns the transaction hash, like `eth_sendRawTransaction`. Acceptance is **not** inclusion: the caller must still watch the chain.

Only exact slot values are supported; min/max ranges were left out to keep the API simple. More complex conditions can be expressed via `paysCoinbase` with a conditional payment.

## Sample code

```json
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "eth_sendRawTransactionConditional",
  "params": [
    "0x02f8...signedTx",
    {
      "blockNumberMax": 12345,
      "timestampMax": 1760000000,
      "knownAccounts": {
        "0x1111111111111111111111111111111111111111": "0x5f3c...storageRoot",
        "0x2222222222222222222222222222222222222222": {
          "0x0000000000000000000000000000000000000000000000000000000000000001": "0x00000000000000000000000000000000000000000000000000000000000003e8"
        },
        "0x3333333333333333333333333333333333333333": { "code": "" }
      }
    }
  ]
}
```

Sending it with ethers v6:

```ts
const hash = await provider.send("eth_sendRawTransactionConditional", [signedTx, options]);
```

## Things to know

- **Status: Review.** Some sequencers already expose non-standard methods with this name; they may need changes to match the final spec.
- A successful response does not guarantee inclusion; a reorg can drop or invalidate the transaction.
- Builders must protect against spam of transactions that are designed to fail: the spec suggests per-sender throttling, validating against recent state history, and for [ERC-4337](/eip-4337/) bundles, checking the UserOperations exist in the public mempool.
- The design is especially useful for ERC-4337 bundlers, which need their bundle's validation assumptions to still hold at inclusion time.


---

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