---
eip: 7793
label: EIP-7793
title: Conditional Transactions
status: Stagnant
type: Standards Track
category: Core
created: 2024-10-17
requires: 7843
official: https://eips.ethereum.org/EIPS/eip-7793
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7793.md
canonical: https://eips.huatuo.xyz/eip-7793/
lang: en
tldr: Proposes a transaction type that is only valid at a specific slot and position in the block, plus a TXINDEX opcode, so encrypted mempools can stop builders from reordering decrypted transactions.
tags: [transactions, mev, encrypted-mempool, opcode, core]
---

# EIP-7793: Conditional Transactions

> Transactions that only executes at a specific index and slot

**TL;DR:** Proposes a transaction type that is only valid at a specific slot and position in the block, plus a TXINDEX opcode, so encrypted mempools can stop builders from reordering decrypted transactions.

## What problem does it solve?

Encrypted mempools aim to prevent front-running: transactions are ordered while still encrypted, then decrypted and placed at the top of the block. The weak point is the last step. A block builder who sees the decrypted contents could reorder them or insert its own transactions in between.

EIP-7793 makes the agreed order enforceable by the protocol. A transaction can declare exactly which slot and which index in the block it must land at; anywhere else, it is invalid.

## How it works

- **New transaction type `0x05`** ([EIP-2718](/eip-2718/) envelope). Its fields mirror the [EIP-4844](/eip-4844/) blob transaction, with two additions: `conditional_slot` and `conditional_tx_index` (both `uint64`). `blob_versioned_hashes` may be empty.
- **Validity rule.** The transaction is valid only if included in that slot and at that index. The slot check relies on [EIP-7843](/eip-7843/), which adds the slot number to the block header. A value of `-1` in either field disables that check.
- **Signature** is over `keccak256(0x05 || rlp([...all fields except y_parity, r, s]))`, like other typed transactions.
- **`TXINDEX` opcode (`0x4c`, 2 gas)** pushes the current transaction's `conditional_tx_index`, or `-1` if it is not a conditional transaction.

Why a new transaction type instead of just an opcode returning the current index? Declaring the index up front keeps validity static, so builders do not have to solve complex, execution-dependent placement constraints.

## Sample code

RLP payload layout (pseudocode):

```python
COND_TX_TYPE = 0x05

payload = rlp([
    chain_id, nonce,
    max_priority_fee_per_gas, max_fee_per_gas, gas_limit,
    to, value, data, access_list,
    max_fee_per_blob_gas, blob_versioned_hashes,   # may be []
    conditional_slot,       # uint64, or -1 = any slot
    conditional_tx_index,   # uint64, or -1 = any index
    y_parity, r, s,
])
raw_tx = bytes([COND_TX_TYPE]) + payload

# Block validity (sketch)
def check(tx, block, index_in_block):
    if tx.conditional_slot != -1:
        assert tx.conditional_slot == block.header.slot_number   # EIP-7843
    if tx.conditional_tx_index != -1:
        assert tx.conditional_tx_index == index_in_block
```

## Things to know

- **Status: Stagnant.** It is not scheduled for any upgrade and has no test cases.
- It is aimed at encrypted-mempool designs, not general wallet use: a normal user rarely knows the exact index their transaction should occupy.
- A conditional transaction that misses its slot or index is simply invalid, so it cannot be included later; it must be re-signed.
- The opcode byte and type number are proposals and could collide with other EIPs if this is revived.


---

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