{"eip":5081,"title":"Expirable Transaction","description":"This EIP adds a new transaction type of that includes expiration with a blocknum","authors":["Zainan Victor Zhou (@xinbenlv)","Nick Johnson (@Arachnid)","Konrad Feldmeier \u003ckonrad@brainbot.com\u003e"],"status":"Stagnant","type":"Standards Track","category":"Core","created":"2022-05-06","requires":[155,1559,2718,2929,2930],"discussionsTo":"https://ethereum-magicians.org/t/eip-5081-expirable-transaction/9208","repo":"EIPs","label":"EIP-5081","officialUrl":"https://eips.ethereum.org/EIPS/eip-5081","sourceUrl":"https://github.com/ethereum/EIPs/blob/master/EIPS/eip-5081.md","url":"https://eips.huatuo.xyz/eip-5081/","tldr":{"en":"Proposed a new transaction type with an expire_by block number, after which the transaction can never be included, giving users a clean way to let stale transactions die.","ja":"expire_by ブロック番号を持つ新しいトランザクションタイプを提案しました。そのブロックを過ぎるとトランザクションは二度と取り込まれず、古くなったトランザクションをきれいに消滅させる手段をユーザーに提供します。","ko":"`expire_by` 블록 번호를 가진 새 트랜잭션 타입을 제안했습니다. 그 블록이 지나면 트랜잭션이 영영 포함될 수 없어, 사용자가 오래된 트랜잭션을 깔끔하게 소멸시킬 수 있습니다.","zh":"提议了一种带 expire_by 区块号的新交易类型，超过该区块后交易将永远不能被打包，让用户有一种干净的方式让过时的交易自行作废。"},"tags":["transactions","expiry","mempool","core"],"explainers":{"en":{"lang":"en","tldr":"Proposed a new transaction type with an expire_by block number, after which the transaction can never be included, giving users a clean way to let stale transactions die.","tags":["transactions","expiry","mempool","core"],"related":[1559,2718,2930,155],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/eip-5081/","markdown":"## What problem does it solve?\n\nAn Ethereum transaction stays valid until its nonce is used. If you send a transaction with a low fee during congestion and then accomplish the same goal another way (a different nonce or another account), the old transaction can still be mined days later when fees drop. The only way to kill it is to send a replacement with the same nonce and a higher fee, which is unreliable and can be expensive if the original fee was already high.\n\nSome transactions are also only useful for a short window, such as a swap that will almost certainly revert if it is not mined within minutes. Users would rather it fail cheaply by never being included at all.\n\nEIP-5081 lets a transaction carry its own deadline.\n\n## How it works\n\n- A new [EIP-2718](/eip-2718/) typed transaction (type byte still TBD, above `0x02`).\n- Its payload is the [EIP-1559](/eip-1559/) layout plus one field, `expire_by`, placed right after `chain_id`:\n\n  `rlp([chain_id, expire_by, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, destination, amount, data, access_list, signature_y_parity, signature_r, signature_s])`\n\n- `expire_by` is the **last block number** that may include the transaction. Any block with `number \u003e expire_by` must not execute it.\n- All other fields, intrinsic gas (inherited from [EIP-2930](/eip-2930/) access-list pricing) and the receipt format work the same as for EIP-1559 transactions.\n- Clients that know the current block number must drop and stop gossiping expired transactions. The spec also suggests an optional `gossip_ttl` margin so nodes only relay transactions that still have a few blocks left.\n\n## Sample code\n\nValidity check a client or block builder would apply (pseudocode):\n\n```python\ndef can_include(tx, block_number: int) -\u003e bool:\n    if tx.type != EXPIRABLE_TX_TYPE:   # value TBD in the spec\n        return True\n    return block_number \u003c= tx.expire_by\n\ndef should_gossip(tx, current_block: int, gossip_ttl: int = 0) -\u003e bool:\n    return current_block + gossip_ttl \u003c= tx.expire_by\n```\n\nPayload fields in order (illustrative values):\n\n```json\n{\n  \"chain_id\": 1,\n  \"expire_by\": 20000100,\n  \"nonce\": 7,\n  \"max_priority_fee_per_gas\": \"1000000000\",\n  \"max_fee_per_gas\": \"30000000000\",\n  \"gas_limit\": 21000,\n  \"destination\": \"0x000000000000000000000000000000000000dEaD\",\n  \"amount\": \"0\",\n  \"data\": \"0x\",\n  \"access_list\": []\n}\n```\n\n## Things to know\n\n- **Status: Stagnant.** No transaction type number or fork was assigned, and the Rationale and Backwards Compatibility sections were left as TODO. Today, apps achieve similar effects at the contract level (for example a `deadline` parameter that makes a swap revert), which still costs gas when the transaction is mined.\n- The spec's signing preimage is written as `keccak256(0x02 || rlp([...]))`; with the type byte still undecided, treat that detail as unfinished.\n- Expiry is by block number, not timestamp.\n- Replay protection relies on `chain_id` as in [EIP-155](/eip-155/) and later typed transactions.\n"},"ja":{"lang":"ja","tldr":"expire_by ブロック番号を持つ新しいトランザクションタイプを提案しました。そのブロックを過ぎるとトランザクションは二度と取り込まれず、古くなったトランザクションをきれいに消滅させる手段をユーザーに提供します。","tags":["transactions","expiry","mempool","core"],"related":[1559,2718,2930,155],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ja/eip-5081/","markdown":"## 何を解決するのか\n\nEthereum のトランザクションは、その nonce が使われるまで有効なままです。混雑時に低い手数料でトランザクションを送り、その後別の方法（別の nonce や別のアカウント）で同じ目的を達成した場合でも、手数料が下がった数日後に古いトランザクションがマイニングされる可能性があります。それを無効にする唯一の方法は、同じ nonce でより高い手数料の置き換えトランザクションを送ることですが、これは確実ではなく、元の手数料がすでに高ければ高額になりえます。\n\nまた、短い期間だけ役に立つトランザクションもあります。たとえば数分以内にマイニングされなければほぼ確実にリバートするスワップです。ユーザーとしては、そもそも取り込まれないことで安く失敗してほしいところです。\n\nEIP-5081 は、トランザクション自身に期限を持たせられるようにします。\n\n## 仕組み\n\n- 新しい [EIP-2718](/eip-2718/) の型付きトランザクション（タイプバイトは未定で、`0x02` より上）。\n- ペイロードは [EIP-1559](/eip-1559/) のレイアウトに、`chain_id` の直後に置かれるフィールド `expire_by` を 1 つ加えたものです。\n\n  `rlp([chain_id, expire_by, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, destination, amount, data, access_list, signature_y_parity, signature_r, signature_s])`\n\n- `expire_by` は、そのトランザクションを取り込める**最後のブロック番号**です。`number \u003e expire_by` のブロックは、それを実行してはなりません。\n- その他のフィールド、固有ガス（[EIP-2930](/eip-2930/) のアクセスリスト価格設定を継承）、レシート形式は、EIP-1559 のトランザクションと同じ動作です。\n- 現在のブロック番号を把握しているクライアントは、期限切れのトランザクションを破棄し、ゴシップを止めなければなりません。仕様はさらに、ノードがまだ数ブロックの猶予が残るトランザクションだけを中継するよう、オプションの `gossip_ttl` マージンを提案しています。\n\n## サンプルコード\n\nクライアントやブロックビルダーが適用する有効性チェックです（疑似コード）。\n\n```python\ndef can_include(tx, block_number: int) -\u003e bool:\n    if tx.type != EXPIRABLE_TX_TYPE:   # value TBD in the spec\n        return True\n    return block_number \u003c= tx.expire_by\n\ndef should_gossip(tx, current_block: int, gossip_ttl: int = 0) -\u003e bool:\n    return current_block + gossip_ttl \u003c= tx.expire_by\n```\n\nペイロードのフィールドを順に並べたもの（説明用の値）:\n\n```json\n{\n  \"chain_id\": 1,\n  \"expire_by\": 20000100,\n  \"nonce\": 7,\n  \"max_priority_fee_per_gas\": \"1000000000\",\n  \"max_fee_per_gas\": \"30000000000\",\n  \"gas_limit\": 21000,\n  \"destination\": \"0x000000000000000000000000000000000000dEaD\",\n  \"amount\": \"0\",\n  \"data\": \"0x\",\n  \"access_list\": []\n}\n```\n\n## 知っておくべきこと\n\n- **ステータス: Stagnant。** トランザクションタイプ番号もフォークも割り当てられず、Rationale と Backwards Compatibility のセクションは TODO のままでした。現在、アプリはコントラクトレベルで同様の効果を実現しています（たとえば、スワップをリバートさせる `deadline` パラメータ）が、これはトランザクションがマイニングされた時点でガスがかかります。\n- 仕様の署名プリイメージは `keccak256(0x02 || rlp([...]))` と書かれています。タイプバイトが未定のため、この部分は未完成として扱ってください。\n- 期限はタイムスタンプではなく、ブロック番号で指定します。\n- リプレイ保護は、[EIP-155](/eip-155/) や以降の型付きトランザクションと同様に `chain_id` に依存します。\n"},"ko":{"lang":"ko","tldr":"`expire_by` 블록 번호를 가진 새 트랜잭션 타입을 제안했습니다. 그 블록이 지나면 트랜잭션이 영영 포함될 수 없어, 사용자가 오래된 트랜잭션을 깔끔하게 소멸시킬 수 있습니다.","tags":["transactions","expiry","mempool","core"],"related":[1559,2718,2930,155],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/ko/eip-5081/","markdown":"## 어떤 문제를 해결하나요?\n\n이더리움 트랜잭션은 nonce가 사용되기 전까지 계속 유효합니다. 혼잡할 때 낮은 수수료로 트랜잭션을 보낸 뒤 다른 방법(다른 nonce나 다른 계정)으로 같은 목적을 달성했더라도, 수수료가 내려간 며칠 뒤에 예전 트랜잭션이 채굴될 수 있습니다. 이를 없애는 유일한 방법은 같은 nonce에 더 높은 수수료로 대체 트랜잭션을 보내는 것인데, 이는 확실하지 않고 원래 수수료가 이미 높았다면 비용이 클 수 있습니다.\n\n또 어떤 트랜잭션은 짧은 시간 동안만 쓸모가 있습니다. 예를 들어 몇 분 안에 채굴되지 않으면 거의 확실히 리버트될 스왑이 그렇습니다. 사용자로서는 아예 포함되지 않아 저렴하게 실패하는 편이 낫습니다.\n\nEIP-5081은 트랜잭션이 스스로 마감 기한을 가지게 합니다.\n\n## 어떻게 동작하나요?\n\n- 새로운 [EIP-2718](/eip-2718/) 타입 트랜잭션(타입 바이트는 아직 미정이며 `0x02`보다 큼).\n- 페이로드는 [EIP-1559](/eip-1559/) 레이아웃에 `chain_id` 바로 뒤에 놓이는 필드 `expire_by` 하나를 더한 것입니다.\n\n  `rlp([chain_id, expire_by, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, destination, amount, data, access_list, signature_y_parity, signature_r, signature_s])`\n\n- `expire_by`는 트랜잭션을 포함할 수 있는 **마지막 블록 번호**입니다. `number \u003e expire_by`인 블록은 이를 실행해서는 안 됩니다.\n- 나머지 모든 필드, 고유 가스([EIP-2930](/eip-2930/) 액세스 리스트 가격에서 상속), 영수증 형식은 EIP-1559 트랜잭션과 같습니다.\n- 현재 블록 번호를 아는 클라이언트는 만료된 트랜잭션을 버리고 전파를 멈춰야 합니다. 명세는 노드가 아직 몇 블록의 여유가 남은 트랜잭션만 중계하도록 하는 선택적 `gossip_ttl` 마진도 제안합니다.\n\n## 샘플 코드\n\n클라이언트나 블록 빌더가 적용할 유효성 검사입니다(의사 코드).\n\n```python\ndef can_include(tx, block_number: int) -\u003e bool:\n    if tx.type != EXPIRABLE_TX_TYPE:   # value TBD in the spec\n        return True\n    return block_number \u003c= tx.expire_by\n\ndef should_gossip(tx, current_block: int, gossip_ttl: int = 0) -\u003e bool:\n    return current_block + gossip_ttl \u003c= tx.expire_by\n```\n\n순서대로 나열한 페이로드 필드(예시 값):\n\n```json\n{\n  \"chain_id\": 1,\n  \"expire_by\": 20000100,\n  \"nonce\": 7,\n  \"max_priority_fee_per_gas\": \"1000000000\",\n  \"max_fee_per_gas\": \"30000000000\",\n  \"gas_limit\": 21000,\n  \"destination\": \"0x000000000000000000000000000000000000dEaD\",\n  \"amount\": \"0\",\n  \"data\": \"0x\",\n  \"access_list\": []\n}\n```\n\n## 알아둘 점\n\n- **상태: Stagnant.** 트랜잭션 타입 번호도 포크도 배정되지 않았고, Rationale과 Backwards Compatibility 섹션은 TODO로 남았습니다. 오늘날 앱은 컨트랙트 수준에서 비슷한 효과를 냅니다(예: 스왑을 리버트시키는 `deadline` 파라미터). 다만 이 경우 트랜잭션이 채굴될 때 여전히 가스가 듭니다.\n- 명세의 서명 프리이미지는 `keccak256(0x02 || rlp([...]))`로 쓰여 있습니다. 타입 바이트가 아직 정해지지 않았으므로 이 부분은 미완성으로 취급하세요.\n- 만료는 타임스탬프가 아니라 블록 번호 기준입니다.\n- 리플레이 방지는 [EIP-155](/eip-155/) 및 이후의 타입 트랜잭션처럼 `chain_id`에 의존합니다.\n"},"zh":{"lang":"zh","tldr":"提议了一种带 expire_by 区块号的新交易类型，超过该区块后交易将永远不能被打包，让用户有一种干净的方式让过时的交易自行作废。","tags":["transactions","expiry","mempool","core"],"related":[1559,2718,2930,155],"updated":"2026-10-19","url":"https://eips.huatuo.xyz/zh/eip-5081/","markdown":"## 它解决什么问题？\n\n以太坊交易在其 nonce 被使用之前一直有效。如果你在拥堵时以较低费用发出一笔交易，之后又用别的方式（不同的 nonce 或另一个账户）达成了同样的目的，旧交易仍可能在几天后费用下降时被打包。要让它失效，唯一的办法是用相同 nonce 和更高费用发送一笔替换交易，这并不可靠，而且如果原费用已经很高，代价可能很大。\n\n有些交易也只在很短的时间窗口内有用，例如一笔如果几分钟内没有被打包就几乎一定会回滚的兑换。用户更希望它因为根本没被打包而以很低的代价失败。\n\nEIP-5081 让交易自带截止时间。\n\n## 它如何运作\n\n- 一种新的 [EIP-2718](/eip-2718/) 类型化交易（类型字节仍待定，大于 `0x02`）。\n- 其负载是 [EIP-1559](/eip-1559/) 的布局再加一个字段 `expire_by`，紧跟在 `chain_id` 之后：\n\n  `rlp([chain_id, expire_by, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, destination, amount, data, access_list, signature_y_parity, signature_r, signature_s])`\n\n- `expire_by` 是允许打包该交易的**最后一个区块号**。任何 `number \u003e expire_by` 的区块都不得执行它。\n- 其他所有字段、固有 gas（继承自 [EIP-2930](/eip-2930/) 的访问列表定价）和收据格式，都与 EIP-1559 交易相同。\n- 知道当前区块号的客户端必须丢弃并停止传播已过期的交易。规范还建议了一个可选的 `gossip_ttl` 余量，让节点只转发仍剩几个区块有效期的交易。\n\n## 示例代码\n\n客户端或区块构建者会应用的有效性检查（伪代码）：\n\n```python\ndef can_include(tx, block_number: int) -\u003e bool:\n    if tx.type != EXPIRABLE_TX_TYPE:   # value TBD in the spec\n        return True\n    return block_number \u003c= tx.expire_by\n\ndef should_gossip(tx, current_block: int, gossip_ttl: int = 0) -\u003e bool:\n    return current_block + gossip_ttl \u003c= tx.expire_by\n```\n\n按顺序排列的负载字段（示意数值）：\n\n```json\n{\n  \"chain_id\": 1,\n  \"expire_by\": 20000100,\n  \"nonce\": 7,\n  \"max_priority_fee_per_gas\": \"1000000000\",\n  \"max_fee_per_gas\": \"30000000000\",\n  \"gas_limit\": 21000,\n  \"destination\": \"0x000000000000000000000000000000000000dEaD\",\n  \"amount\": \"0\",\n  \"data\": \"0x\",\n  \"access_list\": []\n}\n```\n\n## 需要注意\n\n- **状态：Stagnant。** 没有分配交易类型编号或分叉，Rationale 和 Backwards Compatibility 两节仍是 TODO。如今，应用在合约层面实现类似效果（例如让兑换回滚的 `deadline` 参数），但交易被打包时仍然要消耗 gas。\n- 规范中的签名原像写作 `keccak256(0x02 || rlp([...]))`；由于类型字节尚未确定，请把这一细节视为未完成。\n- 过期按区块号而不是时间戳计算。\n- 重放保护依赖 `chain_id`，与 [EIP-155](/eip-155/) 及后来的类型化交易相同。\n"}}}
