---
eip: 5081
label: EIP-5081
title: Expirable Transaction
status: Stagnant
type: Standards Track
category: Core
created: 2022-05-06
requires: 155, 1559, 2718, 2929, 2930
official: https://eips.ethereum.org/EIPS/eip-5081
source: https://github.com/ethereum/EIPs/blob/master/EIPS/eip-5081.md
canonical: https://eips.huatuo.xyz/eip-5081/
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]
---

# EIP-5081: Expirable Transaction

> This EIP adds a new transaction type of that includes expiration with a blocknum

**TL;DR:** 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.

## What problem does it solve?

An 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.

Some 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.

EIP-5081 lets a transaction carry its own deadline.

## How it works

- A new [EIP-2718](/eip-2718/) typed transaction (type byte still TBD, above `0x02`).
- Its payload is the [EIP-1559](/eip-1559/) layout plus one field, `expire_by`, placed right after `chain_id`:

  `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])`

- `expire_by` is the **last block number** that may include the transaction. Any block with `number > expire_by` must not execute it.
- 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.
- 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.

## Sample code

Validity check a client or block builder would apply (pseudocode):

```python
def can_include(tx, block_number: int) -> bool:
    if tx.type != EXPIRABLE_TX_TYPE:   # value TBD in the spec
        return True
    return block_number <= tx.expire_by

def should_gossip(tx, current_block: int, gossip_ttl: int = 0) -> bool:
    return current_block + gossip_ttl <= tx.expire_by
```

Payload fields in order (illustrative values):

```json
{
  "chain_id": 1,
  "expire_by": 20000100,
  "nonce": 7,
  "max_priority_fee_per_gas": "1000000000",
  "max_fee_per_gas": "30000000000",
  "gas_limit": 21000,
  "destination": "0x000000000000000000000000000000000000dEaD",
  "amount": "0",
  "data": "0x",
  "access_list": []
}
```

## Things to know

- **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.
- The spec's signing preimage is written as `keccak256(0x02 || rlp([...]))`; with the type byte still undecided, treat that detail as unfinished.
- Expiry is by block number, not timestamp.
- Replay protection relies on `chain_id` as in [EIP-155](/eip-155/) and later typed transactions.


---

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