{"eip":3534,"title":"Restricted Chain Context Type Transactions","description":"Defines a new transaction type with constraints on ancestor block hash, block author, and/or block timestamp.","authors":["Isaac Ardis (@whilei)"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2021-04-20","requires":[2718,2930],"discussionsTo":"https://ethereum-magicians.org/t/eip-3534-restricted-chain-context-transaction-type/6112","repo":"EIPs","label":"EIP-3534","officialUrl":"https://eips.ethereum.org/EIPS/eip-3534","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-3534.md","url":"https://eips.huatuo.xyz/eip-3534/","tldr":{"en":"Proposed a typed transaction carrying a `chainContext` that limits where it is valid: only after a given ancestor block, only for (or never for) certain block producers, and only until a timestamp.","ja":"有効な場所を制限する `chainContext` を持つ型付きトランザクションを提案した。指定した祖先ブロックの後でのみ、特定のブロックプロデューサー向けにのみ（または決して向けない）、そしてタイムスタンプまでのみ有効にできる。","ko":"유효한 위치를 제한하는 `chainContext`를 담은 타입 트랜잭션을 제안했다. 주어진 조상 블록 이후에만, 특정 블록 생산자에게만(또는 절대 안 되게), 그리고 타임스탬프까지만 유효하도록 할 수 있다.","zh":"提议了一种带有 `chainContext` 的带类型交易，用来限制它在哪里有效：只在某个给定祖先区块之后有效、只对（或绝不对）某些区块生产者有效，并且只在某个时间戳之前有效。"},"tags":["transactions","core","typed-transactions","expiry","mempool"],"explainers":{"en":{"lang":"en","tldr":"Proposed a typed transaction carrying a `chainContext` that limits where it is valid: only after a given ancestor block, only for (or never for) certain block producers, and only until a timestamp.","tags":["transactions","core","typed-transactions","expiry","mempool"],"related":[2718,2930,155,7702],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-3534/","markdown":"## What problem does it solve?\n\nA normal Ethereum transaction is valid in any block as long as its nonce, balance and signature check out. The sender cannot say:\n\n- \"only include me on the chain I'm looking at, after block X\" (so it does not land on a competing fork or after a reorg changes history);\n- \"only let these miners include me\", or \"never these ones\";\n- \"drop me if not mined by time T\" (instead of waiting in the mempool indefinitely or paying to replace it).\n\nEIP-3534 proposed letting a transaction state these conditions itself, enforced by consensus: a block containing a transaction whose conditions are not met would be invalid.\n\n## How it works\n\nA new [EIP-2718](/eip-2718/) transaction type `0x4` extends the [EIP-2930](/eip-2930/) access-list format with one extra field:\n\n```text\n0x04 || rlp([chainId, chainContext, nonce, gasPrice, gasLimit, to, value,\n             data, access_list, yParity, senderR, senderS])\n```\n\n`chainContext` is a one-byte bit-flag prefix followed by RLP-encoded values, in a fixed order:\n\n| Flag | Subclass | Value | Rule |\n| --- | --- | --- | --- |\n| `1` | `ancestorId` | block number (big-endian, no leading zeros) + first 4 bytes of its hash | block must have this ancestor |\n| `2` | `eligibleMinerList` | up to 3 addresses | beneficiary must be in the list |\n| `4` | `ineligibleMinerList` | up to 3 addresses | beneficiary must not be in the list |\n| `8` | `expiry` | unsigned integer timestamp | limits the block timestamp |\n\nThe prefix is the sum of the flags used, like Unix file permissions: `9` = ancestor + expiry. Allow and deny lists cannot be combined, so `6` and `15` are invalid.\n\n`ancestorId` acts like a finer-grained [EIP-155](/eip-155/) `chainId`: it ties a transaction to one segment of one chain. `chainId` is kept anyway because the field is optional and chains that split share early history.\n\n## Sample code\n\nBuilding an `ancestorId` and a `chainContext` (Python; values from the spec's test vectors):\n\n```python\nimport rlp  # pyrlp\n\ndef ancestor_id(number: int, block_hash: bytes) -\u003e bytes:\n    num = number.to_bytes((number.bit_length() + 7) // 8, \"big\")  # b\"\" for genesis\n    return num + block_hash[:4]\n\nh = bytes.fromhex(\"e78b1ec31bcb535548ce4b6ef384deccad1e7dc599817b65ab5124eeaaee3e58\")\nassert ancestor_id(15_000_000, h).hex() == \"e4e1c0e78b1ec3\"\nassert ancestor_id(1, h).hex() == \"01e78b1ec3\"\n\nANCESTOR, ELIGIBLE, INELIGIBLE, EXPIRY = 1, 2, 4, 8\n\n# \"valid only after block 15,000,000 (e78b1ec3...) and before timestamp T\"\nprefix = ANCESTOR | EXPIRY                     # 9\nchain_context = bytes([prefix]) + rlp.encode([ancestor_id(15_000_000, h), 1_700_000_000])\n```\n\n## Things to know\n\n- Status is **Stagnant**; it was never scheduled and `FORK_BLOCK_NUMBER` is TBD.\n- Type `0x04` has since been taken by [EIP-7702](/eip-7702/) set-code transactions, so this draft's type number is no longer available.\n- The spec is inconsistent about `expiry`: the definition calls it the *maximum* valid block timestamp, while one example describes it as a minimum. Any revival would need to settle this.\n- Only 4 bytes of the ancestor hash are used to save space. The spec estimates the collision chance as very low in normal conditions; on a collision the transaction is simply valid on both branches, as today.\n- A miner on a deny list can dodge it by using a fresh beneficiary address. The new fields carry no gas cost, so nodes would rely on dropping unwanted transactions from their pool.\n- The design predates the Merge and talks about miners; under proof-of-stake the equivalent would be the block's fee recipient.\n"},"ja":{"lang":"ja","tldr":"有効な場所を制限する `chainContext` を持つ型付きトランザクションを提案した。指定した祖先ブロックの後でのみ、特定のブロックプロデューサー向けにのみ（または決して向けない）、そしてタイムスタンプまでのみ有効にできる。","tags":["transactions","core","typed-transactions","expiry","mempool"],"related":[2718,2930,155,7702],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-3534/","markdown":"## 何を解決するのか\n\n通常の Ethereum トランザクションは、nonce、残高、署名に問題がなければ、どのブロックでも有効です。送信者は次のようなことを指定できません。\n\n- 「自分が見ているチェーンの、ブロック X の後にだけ含めてほしい」（競合するフォークや、reorg で履歴が変わった後のチェーンに載らないようにする）。\n- 「これらのマイナーだけに含めてほしい」、あるいは「これらのマイナーには決して含めさせない」。\n- 「時刻 T までにマイニングされなければ破棄してほしい」（mempool に無期限に残ったり、置き換えのために支払ったりしなくて済むようにする）。\n\nEIP-3534 は、トランザクション自身がこれらの条件を示し、コンセンサスで強制されるようにすることを提案しました。条件を満たさないトランザクションを含むブロックは無効になります。\n\n## 仕組み\n\n新しい [EIP-2718](/eip-2718/) のトランザクションタイプ `0x4` が、[EIP-2930](/eip-2930/) のアクセスリスト形式に、追加のフィールドを 1 つ加えて拡張します。\n\n```text\n0x04 || rlp([chainId, chainContext, nonce, gasPrice, gasLimit, to, value,\n             data, access_list, yParity, senderR, senderS])\n```\n\n`chainContext` は、1 バイトのビットフラグの接頭辞と、それに続く固定順序の RLP エンコードされた値です。\n\n| フラグ | サブクラス | 値 | ルール |\n| --- | --- | --- | --- |\n| `1` | `ancestorId` | ブロック番号（ビッグエンディアン、先頭のゼロなし）+ そのハッシュの先頭 4 バイト | ブロックがこの祖先を持っていなければならない |\n| `2` | `eligibleMinerList` | 最大 3 アドレス | beneficiary がリストに含まれていなければならない |\n| `4` | `ineligibleMinerList` | 最大 3 アドレス | beneficiary がリストに含まれていてはならない |\n| `8` | `expiry` | 符号なし整数のタイムスタンプ | ブロックのタイムスタンプを制限する |\n\n接頭辞は、使用するフラグの合計値で、Unix のファイルパーミッションと同じ方式です。`9` = 祖先 + 有効期限です。許可リストと拒否リストは組み合わせられないため、`6` と `15` は無効です。\n\n`ancestorId` は、より細かい粒度の [EIP-155](/eip-155/) の `chainId` のように働きます。トランザクションを 1 つのチェーンの 1 つの区間に結びつけます。それでも `chainId` を残しているのは、このフィールドが任意であり、分岐したチェーンが初期の履歴を共有するためです。\n\n## サンプルコード\n\n`ancestorId` と `chainContext` を組み立てる例です（Python。値は仕様のテストベクターより）。\n\n```python\nimport rlp  # pyrlp\n\ndef ancestor_id(number: int, block_hash: bytes) -\u003e bytes:\n    num = number.to_bytes((number.bit_length() + 7) // 8, \"big\")  # b\"\" for genesis\n    return num + block_hash[:4]\n\nh = bytes.fromhex(\"e78b1ec31bcb535548ce4b6ef384deccad1e7dc599817b65ab5124eeaaee3e58\")\nassert ancestor_id(15_000_000, h).hex() == \"e4e1c0e78b1ec3\"\nassert ancestor_id(1, h).hex() == \"01e78b1ec3\"\n\nANCESTOR, ELIGIBLE, INELIGIBLE, EXPIRY = 1, 2, 4, 8\n\n# \"valid only after block 15,000,000 (e78b1ec3...) and before timestamp T\"\nprefix = ANCESTOR | EXPIRY                     # 9\nchain_context = bytes([prefix]) + rlp.encode([ancestor_id(15_000_000, h), 1_700_000_000])\n```\n\n## 知っておくべきこと\n\n- ステータスは **Stagnant** です。予定に組み込まれたことはなく、`FORK_BLOCK_NUMBER` は TBD です。\n- タイプ `0x04` は、その後 [EIP-7702](/eip-7702/) の set-code トランザクションに使われたため、このドラフトのタイプ番号はもう使えません。\n- 仕様は `expiry` について一貫していません。定義では有効なブロックタイムスタンプの*最大値*とされていますが、ある例では最小値として説明されています。復活させる場合は、これを決着させる必要があります。\n- 容量節約のため、祖先のハッシュは 4 バイトだけが使われます。仕様は、通常の状況での衝突確率を非常に低いと見積もっています。衝突した場合は、現在と同じく、トランザクションが両方の分岐で有効になるだけです。\n- 拒否リストに載ったマイナーは、新しい beneficiary アドレスを使えば回避できます。新しいフィールドにはガスコストがかからないため、ノードは不要なトランザクションをプールから捨てることに頼ることになります。\n- この設計は The Merge より前のもので、マイナーについて述べています。proof-of-stake では、相当するものはブロックの手数料受取人になります。\n"},"ko":{"lang":"ko","tldr":"유효한 위치를 제한하는 `chainContext`를 담은 타입 트랜잭션을 제안했다. 주어진 조상 블록 이후에만, 특정 블록 생산자에게만(또는 절대 안 되게), 그리고 타임스탬프까지만 유효하도록 할 수 있다.","tags":["transactions","core","typed-transactions","expiry","mempool"],"related":[2718,2930,155,7702],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-3534/","markdown":"## 어떤 문제를 해결하나요?\n\n일반적인 이더리움 트랜잭션은 nonce, 잔액, 서명이 맞기만 하면 어떤 블록에서든 유효합니다. 발신자는 다음과 같은 것을 지정할 수 없습니다.\n\n- \"내가 보고 있는 체인에서 블록 X 이후에만 나를 포함해 달라\"(경쟁 포크에 들어가거나 리오그로 역사가 바뀐 뒤에 들어가지 않도록).\n- \"이 채굴자들만 나를 포함하게 해 달라\", 또는 \"이 채굴자들은 절대 안 된다\".\n- \"시각 T까지 채굴되지 않으면 나를 버려 달라\"(mempool에서 무기한 기다리거나 교체하려고 비용을 내지 않도록).\n\nEIP-3534는 트랜잭션 자체가 이런 조건을 명시하고 합의로 강제되게 하자고 제안했습니다. 조건이 충족되지 않는 트랜잭션을 포함한 블록은 무효가 됩니다.\n\n## 어떻게 동작하나요?\n\n새 [EIP-2718](/eip-2718/) 트랜잭션 타입 `0x4`가 [EIP-2930](/eip-2930/) 액세스 리스트 형식에 필드 하나를 더해 확장합니다.\n\n```text\n0x04 || rlp([chainId, chainContext, nonce, gasPrice, gasLimit, to, value,\n             data, access_list, yParity, senderR, senderS])\n```\n\n`chainContext`는 1바이트 비트 플래그 접두사와, 그 뒤에 고정된 순서로 이어지는 RLP 인코딩된 값들입니다.\n\n| 플래그 | 하위 유형 | 값 | 규칙 |\n| --- | --- | --- | --- |\n| `1` | `ancestorId` | 블록 번호(빅 엔디언, 앞자리 0 없음) + 그 해시의 처음 4바이트 | 블록이 이 조상을 가져야 함 |\n| `2` | `eligibleMinerList` | 최대 3개 주소 | 수혜자가 목록에 있어야 함 |\n| `4` | `ineligibleMinerList` | 최대 3개 주소 | 수혜자가 목록에 없어야 함 |\n| `8` | `expiry` | 부호 없는 정수 타임스탬프 | 블록 타임스탬프를 제한 |\n\n접두사는 사용한 플래그의 합이며, Unix 파일 권한과 같은 방식입니다. `9` = 조상 + 만료입니다. 허용 목록과 거부 목록은 함께 쓸 수 없으므로 `6`과 `15`는 유효하지 않습니다.\n\n`ancestorId`는 더 세밀한 [EIP-155](/eip-155/) `chainId`처럼 동작합니다. 트랜잭션을 한 체인의 한 구간에 묶습니다. 그래도 `chainId`를 유지하는 이유는 이 필드가 선택 사항이고, 갈라진 체인들이 초기 역사를 공유하기 때문입니다.\n\n## 샘플 코드\n\n`ancestorId`와 `chainContext`를 만드는 예시입니다(Python. 값은 명세의 테스트 벡터에서 가져왔습니다).\n\n```python\nimport rlp  # pyrlp\n\ndef ancestor_id(number: int, block_hash: bytes) -\u003e bytes:\n    num = number.to_bytes((number.bit_length() + 7) // 8, \"big\")  # b\"\" for genesis\n    return num + block_hash[:4]\n\nh = bytes.fromhex(\"e78b1ec31bcb535548ce4b6ef384deccad1e7dc599817b65ab5124eeaaee3e58\")\nassert ancestor_id(15_000_000, h).hex() == \"e4e1c0e78b1ec3\"\nassert ancestor_id(1, h).hex() == \"01e78b1ec3\"\n\nANCESTOR, ELIGIBLE, INELIGIBLE, EXPIRY = 1, 2, 4, 8\n\n# \"valid only after block 15,000,000 (e78b1ec3...) and before timestamp T\"\nprefix = ANCESTOR | EXPIRY                     # 9\nchain_context = bytes([prefix]) + rlp.encode([ancestor_id(15_000_000, h), 1_700_000_000])\n```\n\n## 알아둘 점\n\n- 상태는 **Stagnant**입니다. 일정에 오른 적이 없으며 `FORK_BLOCK_NUMBER`는 TBD입니다.\n- 타입 `0x04`는 이후 [EIP-7702](/eip-7702/)의 set-code 트랜잭션이 사용하게 되어, 이 초안의 타입 번호는 더 이상 쓸 수 없습니다.\n- 명세는 `expiry`에 대해 일관되지 않습니다. 정의는 유효한 블록 타임스탬프의 *최댓값*이라고 하지만, 한 예시는 최솟값으로 설명합니다. 부활시키려면 이를 정리해야 합니다.\n- 공간을 아끼기 위해 조상 해시는 4바이트만 사용합니다. 명세는 일반적인 조건에서 충돌 확률이 매우 낮다고 추정합니다. 충돌하면 지금처럼 트랜잭션이 두 분기 모두에서 유효할 뿐입니다.\n- 거부 목록에 오른 채굴자는 새 수혜자 주소를 써서 피할 수 있습니다. 새 필드에는 가스 비용이 없으므로, 노드는 원치 않는 트랜잭션을 풀에서 버리는 데 의존하게 됩니다.\n- 이 설계는 The Merge 이전의 것이며 채굴자에 대해 이야기합니다. 지분 증명에서는 이에 해당하는 것이 블록의 수수료 수취인입니다.\n"},"zh":{"lang":"zh","tldr":"提议了一种带有 `chainContext` 的带类型交易，用来限制它在哪里有效：只在某个给定祖先区块之后有效、只对（或绝不对）某些区块生产者有效，并且只在某个时间戳之前有效。","tags":["transactions","core","typed-transactions","expiry","mempool"],"related":[2718,2930,155,7702],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-3534/","markdown":"## 它解决什么问题？\n\n只要 nonce、余额和签名都没问题，一笔普通的以太坊交易在任何区块中都有效。发送者无法声明：\n\n- \"只在我所看到的这条链上、区块 X 之后才打包我\"（这样它就不会落在竞争分叉上，或在重组改变历史之后被打包）；\n- \"只允许这些矿工打包我\"，或者\"绝不允许这些矿工打包我\"；\n- \"如果到时间 T 还没被打包就丢弃我\"（而不是在内存池里无限期等待，或者付费来替换它）。\n\nEIP-3534 提议让交易自己声明这些条件，并由共识强制执行：如果区块包含了条件不满足的交易，该区块就是无效的。\n\n## 它如何运作\n\n一种新的 [EIP-2718](/eip-2718/) 交易类型 `0x4` 在 [EIP-2930](/eip-2930/) 访问列表格式的基础上增加了一个额外字段：\n\n```text\n0x04 || rlp([chainId, chainContext, nonce, gasPrice, gasLimit, to, value,\n             data, access_list, yParity, senderR, senderS])\n```\n\n`chainContext` 是一个字节的位标志前缀，后面按固定顺序跟着 RLP 编码的值：\n\n| 标志 | 子类 | 值 | 规则 |\n| --- | --- | --- | --- |\n| `1` | `ancestorId` | 区块号（大端序，无前导零）+ 其哈希的前 4 个字节 | 区块必须拥有这个祖先 |\n| `2` | `eligibleMinerList` | 最多 3 个地址 | 受益人必须在列表中 |\n| `4` | `ineligibleMinerList` | 最多 3 个地址 | 受益人不得在列表中 |\n| `8` | `expiry` | 无符号整数时间戳 | 限制区块时间戳 |\n\n前缀是所用标志之和，就像 Unix 文件权限一样：`9` = 祖先 + 过期时间。允许列表和拒绝列表不能同时使用，所以 `6` 和 `15` 无效。\n\n`ancestorId` 的作用就像一个粒度更细的 [EIP-155](/eip-155/) `chainId`：它把交易绑定到某条链的某一段。仍然保留 `chainId`，是因为该字段是可选的，而且分叉出来的链共享早期历史。\n\n## 示例代码\n\n构造 `ancestorId` 和 `chainContext`（Python；数值来自规范的测试向量）：\n\n```python\nimport rlp  # pyrlp\n\ndef ancestor_id(number: int, block_hash: bytes) -\u003e bytes:\n    num = number.to_bytes((number.bit_length() + 7) // 8, \"big\")  # b\"\" for genesis\n    return num + block_hash[:4]\n\nh = bytes.fromhex(\"e78b1ec31bcb535548ce4b6ef384deccad1e7dc599817b65ab5124eeaaee3e58\")\nassert ancestor_id(15_000_000, h).hex() == \"e4e1c0e78b1ec3\"\nassert ancestor_id(1, h).hex() == \"01e78b1ec3\"\n\nANCESTOR, ELIGIBLE, INELIGIBLE, EXPIRY = 1, 2, 4, 8\n\n# \"valid only after block 15,000,000 (e78b1ec3...) and before timestamp T\"\nprefix = ANCESTOR | EXPIRY                     # 9\nchain_context = bytes([prefix]) + rlp.encode([ancestor_id(15_000_000, h), 1_700_000_000])\n```\n\n## 需要注意\n\n- 状态为 **Stagnant**；它从未被排入计划，`FORK_BLOCK_NUMBER` 为 TBD。\n- 类型 `0x04` 后来已被 [EIP-7702](/eip-7702/) 的 set-code 交易占用，因此这份草案的类型编号已不可用。\n- 规范对 `expiry` 的说法并不一致：定义中称它是有效区块时间戳的*最大值*，而有一个示例却把它描述为最小值。任何复活该提案的尝试都需要先厘清这一点。\n- 为节省空间，只使用祖先哈希的 4 个字节。规范估计在正常情况下碰撞概率非常低；一旦碰撞，交易只是在两个分支上都有效，和现在一样。\n- 位于拒绝列表上的矿工可以通过使用全新的受益人地址来规避。新增字段不消耗 gas，因此节点只能依靠把不想要的交易从自己的交易池中丢弃。\n- 该设计早于合并（The Merge），谈论的是矿工；在权益证明下，对应的概念是区块的手续费接收者。\n"}}}
