{"eip":7793,"title":"Conditional Transactions","description":"Transactions that only executes at a specific index and slot","authors":["Marc Harvey-Hill (@Marchhill)","Ahmad Bitar (@smartprogrammer93)"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2024-10-17","requires":[7843],"discussionsTo":"https://ethereum-magicians.org/t/eip-7793-asserttxindex-opcode/21513","repo":"EIPs","label":"EIP-7793","officialUrl":"https://eips.ethereum.org/EIPS/eip-7793","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7793.md","url":"https://eips.huatuo.xyz/eip-7793/","tldr":{"en":"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.","ja":"特定のスロットとブロック内の位置でのみ有効なトランザクションタイプと TXINDEX opcode を提案する。暗号化 mempool で、ビルダーが復号後のトランザクションを並べ替えられないようにする。","ko":"특정 슬롯과 블록 내 특정 위치에서만 유효한 트랜잭션 타입과 TXINDEX opcode를 제안한다. 암호화 mempool에서 빌더가 복호화된 트랜잭션의 순서를 바꾸지 못하게 한다.","zh":"提议一种仅在特定 slot 和区块内特定位置才有效的交易类型，外加 TXINDEX opcode，使加密 mempool 能够阻止构建者对解密后的交易重新排序。"},"tags":["transactions","mev","encrypted-mempool","opcode","core"],"explainers":{"en":{"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"],"related":[7843,2718,4844],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-7793/","markdown":"## What problem does it solve?\n\nEncrypted 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.\n\nEIP-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.\n\n## How it works\n\n- **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.\n- **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.\n- **Signature** is over `keccak256(0x05 || rlp([...all fields except y_parity, r, s]))`, like other typed transactions.\n- **`TXINDEX` opcode (`0x4c`, 2 gas)** pushes the current transaction's `conditional_tx_index`, or `-1` if it is not a conditional transaction.\n\nWhy 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.\n\n## Sample code\n\nRLP payload layout (pseudocode):\n\n```python\nCOND_TX_TYPE = 0x05\n\npayload = rlp([\n    chain_id, nonce,\n    max_priority_fee_per_gas, max_fee_per_gas, gas_limit,\n    to, value, data, access_list,\n    max_fee_per_blob_gas, blob_versioned_hashes,   # may be []\n    conditional_slot,       # uint64, or -1 = any slot\n    conditional_tx_index,   # uint64, or -1 = any index\n    y_parity, r, s,\n])\nraw_tx = bytes([COND_TX_TYPE]) + payload\n\n# Block validity (sketch)\ndef check(tx, block, index_in_block):\n    if tx.conditional_slot != -1:\n        assert tx.conditional_slot == block.header.slot_number   # EIP-7843\n    if tx.conditional_tx_index != -1:\n        assert tx.conditional_tx_index == index_in_block\n```\n\n## Things to know\n\n- **Status: Stagnant.** It is not scheduled for any upgrade and has no test cases.\n- It is aimed at encrypted-mempool designs, not general wallet use: a normal user rarely knows the exact index their transaction should occupy.\n- A conditional transaction that misses its slot or index is simply invalid, so it cannot be included later; it must be re-signed.\n- The opcode byte and type number are proposals and could collide with other EIPs if this is revived.\n"},"ja":{"lang":"ja","tldr":"特定のスロットとブロック内の位置でのみ有効なトランザクションタイプと TXINDEX opcode を提案する。暗号化 mempool で、ビルダーが復号後のトランザクションを並べ替えられないようにする。","tags":["transactions","mev","encrypted-mempool","opcode","core"],"related":[7843,2718,4844],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-7793/","markdown":"## 何を解決するのか\n\n暗号化 mempool は、フロントランニングを防ぐことを目指しています。トランザクションは暗号化されたまま順序付けされ、その後復号されてブロックの先頭に置かれます。弱点は最後のステップです。復号された内容を見られるブロックビルダーは、それらを並べ替えたり、間に自分のトランザクションを挿入したりできてしまいます。\n\nEIP-7793 は、合意された順序をプロトコルで強制できるようにします。トランザクションは、どのスロットのブロック内のどのインデックスに載らなければならないかを正確に宣言でき、それ以外の場所では無効になります。\n\n## 仕組み\n\n- **新しいトランザクションタイプ `0x05`**（[EIP-2718](/eip-2718/) エンベロープ）。フィールドは [EIP-4844](/eip-4844/) のブロブトランザクションと同じで、`conditional_slot` と `conditional_tx_index`（どちらも `uint64`）の 2 つが追加されます。`blob_versioned_hashes` は空でも構いません。\n- **有効性のルール。** トランザクションは、そのスロットかつそのインデックスに含まれた場合にのみ有効です。スロットのチェックは、ブロックヘッダーにスロット番号を追加する [EIP-7843](/eip-7843/) に依存します。どちらかのフィールドに `-1` を指定すると、そのチェックは無効になります。\n- **署名** は、他の型付きトランザクションと同様に `keccak256(0x05 || rlp([...y_parity, r, s を除くすべてのフィールド]))` に対して行います。\n- **`TXINDEX` opcode（`0x4c`、2 ガス）** は、現在のトランザクションの `conditional_tx_index` をプッシュします。条件付きトランザクションでない場合は `-1` です。\n\n現在のインデックスを返す opcode だけではなく、なぜ新しいトランザクションタイプなのか。インデックスを事前に宣言することで有効性が静的に保たれ、ビルダーは実行結果に依存する複雑な配置制約を解く必要がなくなります。\n\n## サンプルコード\n\nRLP ペイロードのレイアウト（擬似コード）:\n\n```python\nCOND_TX_TYPE = 0x05\n\npayload = rlp([\n    chain_id, nonce,\n    max_priority_fee_per_gas, max_fee_per_gas, gas_limit,\n    to, value, data, access_list,\n    max_fee_per_blob_gas, blob_versioned_hashes,   # may be []\n    conditional_slot,       # uint64, or -1 = any slot\n    conditional_tx_index,   # uint64, or -1 = any index\n    y_parity, r, s,\n])\nraw_tx = bytes([COND_TX_TYPE]) + payload\n\n# Block validity (sketch)\ndef check(tx, block, index_in_block):\n    if tx.conditional_slot != -1:\n        assert tx.conditional_slot == block.header.slot_number   # EIP-7843\n    if tx.conditional_tx_index != -1:\n        assert tx.conditional_tx_index == index_in_block\n```\n\n## 知っておくべきこと\n\n- **ステータス: Stagnant。** どのアップグレードにも予定されておらず、テストケースもありません。\n- 想定しているのは暗号化 mempool の設計であり、一般のウォレット利用ではありません。通常のユーザーが、自分のトランザクションが占めるべき正確なインデックスを知っていることはまずありません。\n- スロットやインデックスを外れた条件付きトランザクションは単に無効になり、後から含めることはできません。再署名が必要です。\n- opcode のバイトとタイプ番号は提案であり、この提案が復活した場合、他の EIP と衝突する可能性があります。\n"},"ko":{"lang":"ko","tldr":"특정 슬롯과 블록 내 특정 위치에서만 유효한 트랜잭션 타입과 TXINDEX opcode를 제안한다. 암호화 mempool에서 빌더가 복호화된 트랜잭션의 순서를 바꾸지 못하게 한다.","tags":["transactions","mev","encrypted-mempool","opcode","core"],"related":[7843,2718,4844],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-7793/","markdown":"## 어떤 문제를 해결하나요?\n\n암호화 mempool은 프론트러닝을 막는 것을 목표로 합니다. 트랜잭션은 암호화된 상태로 순서가 정해진 뒤, 복호화되어 블록의 맨 위에 배치됩니다. 약한 고리는 마지막 단계입니다. 복호화된 내용을 볼 수 있는 블록 빌더가 순서를 바꾸거나 그 사이에 자신의 트랜잭션을 끼워 넣을 수 있습니다.\n\nEIP-7793은 합의된 순서를 프로토콜이 강제할 수 있게 합니다. 트랜잭션은 어느 슬롯의 블록에서 몇 번째 인덱스에 들어가야 하는지를 정확히 선언할 수 있고, 다른 곳에서는 무효가 됩니다.\n\n## 어떻게 동작하나요?\n\n- **새 트랜잭션 타입 `0x05`**([EIP-2718](/eip-2718/) 엔벨로프). 필드는 [EIP-4844](/eip-4844/) 블롭 트랜잭션과 같고, `conditional_slot`과 `conditional_tx_index`(둘 다 `uint64`)가 추가됩니다. `blob_versioned_hashes`는 비어 있어도 됩니다.\n- **유효성 규칙.** 트랜잭션은 그 슬롯의 그 인덱스에 포함된 경우에만 유효합니다. 슬롯 검사는 블록 헤더에 슬롯 번호를 추가하는 [EIP-7843](/eip-7843/)에 의존합니다. 두 필드 중 하나가 `-1`이면 해당 검사는 비활성화됩니다.\n- **서명**은 다른 타입 트랜잭션과 마찬가지로 `keccak256(0x05 || rlp([...y_parity, r, s를 제외한 모든 필드]))`에 대해 이루어집니다.\n- **`TXINDEX` opcode(`0x4c`, 2 가스)**는 현재 트랜잭션의 `conditional_tx_index`를 푸시하며, 조건부 트랜잭션이 아니면 `-1`을 푸시합니다.\n\n현재 인덱스를 반환하는 opcode만이 아니라 왜 새 트랜잭션 타입일까요? 인덱스를 미리 선언하면 유효성이 정적으로 유지되므로, 빌더가 실행 결과에 따라 달라지는 복잡한 배치 제약을 풀 필요가 없습니다.\n\n## 샘플 코드\n\nRLP 페이로드 구조(의사 코드):\n\n```python\nCOND_TX_TYPE = 0x05\n\npayload = rlp([\n    chain_id, nonce,\n    max_priority_fee_per_gas, max_fee_per_gas, gas_limit,\n    to, value, data, access_list,\n    max_fee_per_blob_gas, blob_versioned_hashes,   # may be []\n    conditional_slot,       # uint64, or -1 = any slot\n    conditional_tx_index,   # uint64, or -1 = any index\n    y_parity, r, s,\n])\nraw_tx = bytes([COND_TX_TYPE]) + payload\n\n# Block validity (sketch)\ndef check(tx, block, index_in_block):\n    if tx.conditional_slot != -1:\n        assert tx.conditional_slot == block.header.slot_number   # EIP-7843\n    if tx.conditional_tx_index != -1:\n        assert tx.conditional_tx_index == index_in_block\n```\n\n## 알아둘 점\n\n- **상태: Stagnant.** 어떤 업그레이드에도 예정되어 있지 않으며 테스트 케이스도 없습니다.\n- 일반 지갑 사용이 아니라 암호화 mempool 설계를 겨냥한 것입니다. 일반 사용자는 자신의 트랜잭션이 차지해야 할 정확한 인덱스를 거의 알지 못합니다.\n- 슬롯이나 인덱스를 놓친 조건부 트랜잭션은 그냥 무효이므로 나중에 포함될 수 없으며, 다시 서명해야 합니다.\n- opcode 바이트와 타입 번호는 제안일 뿐이며, 이 제안이 되살아나면 다른 EIP와 충돌할 수 있습니다.\n"},"zh":{"lang":"zh","tldr":"提议一种仅在特定 slot 和区块内特定位置才有效的交易类型，外加 TXINDEX opcode，使加密 mempool 能够阻止构建者对解密后的交易重新排序。","tags":["transactions","mev","encrypted-mempool","opcode","core"],"related":[7843,2718,4844],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-7793/","markdown":"## 它解决什么问题？\n\n加密 mempool 旨在防止抢跑：交易在仍处于加密状态时被排序，然后解密并放在区块的顶部。薄弱环节在最后一步。看得到解密内容的区块构建者可能会重新排序，或在中间插入自己的交易。\n\nEIP-7793 让协议能够强制执行约定的顺序。交易可以精确声明它必须落在哪个 slot、区块中的哪个索引；在其他任何位置，它都是无效的。\n\n## 它如何运作\n\n- **新的交易类型 `0x05`**（[EIP-2718](/eip-2718/) 信封）。其字段与 [EIP-4844](/eip-4844/) 的 blob 交易一致，另外增加两个：`conditional_slot` 和 `conditional_tx_index`（均为 `uint64`）。`blob_versioned_hashes` 可以为空。\n- **有效性规则。** 只有当交易被包含在该 slot 且位于该索引时才有效。slot 检查依赖 [EIP-7843](/eip-7843/)，它把 slot 编号加入区块头。任一字段取值为 `-1` 则禁用对应的检查。\n- **签名**与其他带类型的交易一样，针对 `keccak256(0x05 || rlp([...除 y_parity、r、s 外的所有字段]))`。\n- **`TXINDEX` opcode（`0x4c`，2 gas）** 压入当前交易的 `conditional_tx_index`，如果不是条件交易则压入 `-1`。\n\n为什么要新增交易类型，而不是只用一个返回当前索引的 opcode？预先声明索引能让有效性保持静态，构建者就不必去求解依赖执行结果的复杂排布约束。\n\n## 示例代码\n\nRLP 载荷布局（伪代码）：\n\n```python\nCOND_TX_TYPE = 0x05\n\npayload = rlp([\n    chain_id, nonce,\n    max_priority_fee_per_gas, max_fee_per_gas, gas_limit,\n    to, value, data, access_list,\n    max_fee_per_blob_gas, blob_versioned_hashes,   # may be []\n    conditional_slot,       # uint64, or -1 = any slot\n    conditional_tx_index,   # uint64, or -1 = any index\n    y_parity, r, s,\n])\nraw_tx = bytes([COND_TX_TYPE]) + payload\n\n# Block validity (sketch)\ndef check(tx, block, index_in_block):\n    if tx.conditional_slot != -1:\n        assert tx.conditional_slot == block.header.slot_number   # EIP-7843\n    if tx.conditional_tx_index != -1:\n        assert tx.conditional_tx_index == index_in_block\n```\n\n## 需要注意\n\n- **状态：Stagnant。** 它尚未被安排进任何升级，也没有测试用例。\n- 它面向的是加密 mempool 设计，而不是通用钱包使用：普通用户很少知道自己的交易应当占据的确切索引。\n- 错过其 slot 或索引的条件交易就是无效的，之后无法再被包含；必须重新签名。\n- opcode 字节和交易类型编号只是提议，如果该提案被重新启动，可能与其他 EIP 冲突。\n"}}}
