EIP-1681 Preventing reuse via transaction validity expiration (Temporal Replay Protection)
No call decision · Security & privacy · EIP status Stagnant · created 2019-01-08
A proposal to add a 'valid-until' expiration time to transactions, after which the transaction can no longer be included in a block.
Why it is needed
Right now, once an Ethereum transaction is signed, it remains valid forever. Transactions that only matter if processed within a few hours, like ICO transactions, can sit in the queue for days instead, so users waste gas on transactions that will fail and the network has to keep processing a backlog of transactions. Also, clearing out dust accounts (small accounts that are essentially never used) requires replay protection, and implementing this by changing the nonce scheme makes it harder to integrate with offline signers and causes side effects such as making it impossible to create a contract at a specific address. Nodes also have no common standard for when to drop old transactions, so unnecessary transactions keep piling up in the pool.
What changes
Today
- A signed transaction remains valid exactly as is even after years have passed
- Unprocessed transactions, such as those from ICOs, sit in the queue for days and waste gas fees
- Implementing replay protection requires making the nonce scheme itself more complex
- Each node has a different standard for discarding old transactions, so they pile up in the pool
After EIP-1681
- Transactions can include a 'valid-until' expiration time (optional at first, mandatory later)
- If block.timestamp exceeds valid-until, the transaction cannot be included in a block
- Achieves time-based replay protection without touching the nonce scheme
- Nodes can clean expired transactions out of the pool based on this standard
Who is affected
- Wallet and signing software developers: A valid-until field must be added, and after the second stage (Y), a transaction without this field becomes invalid as a signature.
- Offline and paper wallet users: A transaction signed and stored in advance becomes unusable once it passes its valid-until time.
- Client and node teams: They can establish a standard for clearing expired transactions out of the transaction pool.
- Ordinary users: Reduces the problem of transactions that need fast processing, like ICO transactions, wasting gas and sitting in the queue for days when they fail.
In depth
Two-stage rollout: hard fork X, soft fork Y
This proposal is applied in two stages: block X (hard fork) and block Y (soft fork). At block X, an optional valid-until field is added to RLP-encoded transactions, and a transaction with this field can only be included if block.timestamp is less than valid-until. At block Y, valid-until becomes mandatory, and a transaction without this field is treated as invalid.
Definition of the valid-until field
valid-until is a new field added to RLP-encoded transactions, defined as a uint64, the same type as nonce. If this field is present on transaction t, t is only eligible for inclusion in a block whose block.timestamp is less than t.valid-until.
Why walltime instead of block number
The earlier proposal EIPs/pull/599 (Nick Johnson, Konrad Feldmeier) used block number as the basis, but this proposal uses UTC walltime. UTC time can be known by a signer offline, without blockchain information, whereas block time fluctuates with network hashrate and difficulty bomb progression, and on testnets or private networks block number is an even less stable indicator of time. It is also far more intuitive for users to set an expiration by date rather than by calculating an appropriate number of valid blocks.
Relationship to dust-account clearing
Introducing a feature like dust-account clearing requires replay protection. Because time-based replay protection only touches the transaction validation step without changing how nonces are handled in state, it does not require adding new structures such as a 'highest known-nonce' to the consensus engine or limiting the number of transactions per sender per block. In contrast, more complex nonce-based approaches have side effects such as making it impossible to create a contract at a specific address, or making processing difficult for offline signers that lack access to state.
Transaction TTL and network resources
Currently, there is no common standard across node implementations for which transactions to keep in the pool and which to drop. Once valid-until introduces the concept of a TTL (time to live) for transactions, it becomes easier for the system to purge transactions that are old and no longer valid.
Backward compatibility: signing software must be updated
Once this EIP is applied, all software and hardware that creates transactions must add a timestamp, otherwise signing itself becomes impossible after block Y. However, since no upper bound is placed on the value of valid-until, it remains possible to create a transaction with an effectively unlimited validity period.
Security considerations: invalidation of pre-signed paper wallet transactions
The most notable impact is that signed transactions written down and stored in advance on paper become invalid after block Y. This affects cases such as giving a user a pre-made one-time 'bootstrap' transaction instead of a gift card containing ether, or a transaction pre-made to send ether directly to an exchange without going through a procedure to revive a paper wallet. In addition, the added timestamp field slightly increases transaction size.
Current status and fork inclusion
The source explicitly states that this EIP's status is Stagnant, with no test cases or implementation yet. There is no record of a core developer call deciding to include it in a fork. In other words, adoption has not yet been finalized, and the content may still change or be abandoned.