EIP-3534 Restricted connection chain-context transactions (Restricted Chain Context Type Transactions)

No call decision · Other · EIP status Stagnant · created 2021-04-20

Introduces a new transaction type (0x4) that restricts a transaction to being valid only when conditions such as ancestor block, allowed/blocked miner list, or expiry time are satisfied.

Why it is needed

Today a transaction's validity is determined only by chain ID and nonce; there is no way for the transaction itself to specify which block ancestor it must sit above, which miners should (or should not) process it, or until when it remains valid. As a result, when a reorg occurs a transaction can end up included in a chain segment the sender never intended, there is no way to express a preference for or against particular miners, and withdrawing a transaction from the pool has no option other than the indirect method of sending a replacement transaction with a higher gas price. EIP-3534 aims to let a transaction declare these conditions directly in its fields, so it can itself state the scope in which it applies.

What changes

Today

After EIP-3534

Who is affected

In depth

New transaction type and field structure

TRANSACTION_TYPE_NUMBER is 0x4, and the payload is rlp([chainId, chainContext, nonce, gasPrice, gasLimit, to, value, data, access_list, yParity, senderR, senderS]). The receipt payload is rlp([status, cumulativeGasUsed, logsBloom, logs]), unchanged from before. It follows EIP-2718's typed transaction format and includes EIP-2930's access_list field as is, so the access list feature can be used alongside it. FORK_BLOCK_NUMBER is left as TBD.

chainContext encoding structure

The chainContext value has the form ANNOTATION_COMPOSITE_PREFIX || rlp[subclass values...]. ANNOTATION_COMPOSITE_PREFIX is an integer between 1 and 0xff, the sum of the ANNOTATION_PREFIX values of the subclasses being applied. ANNOTATION_PREFIX is defined as powers of two (1, 2, 4, 8, 16, 32, 64, 128), and this EIP uses only four of them (1, 2, 4, 8). The values must be listed in the fixed order ancestorId, eligibleMinerList, ineligibleMinerList, expiry so they can be interpreted unambiguously.

ancestorId: specifying an ancestor block

ANNOTATION_PREFIX 1. A value of 4 to 12 bytes formed by concatenating the block number (big-endian, leading zeros stripped) with the first 4 bytes of that block's hash. The number can be omitted when referring to the genesis block. This overlaps in function with chainId, but chainId is kept as is because when two chains survive together after a fork (for example Ethereum and Ethereum Classic), ancestorId alone can be ambiguous, and chainId is also used in the signature's v value.

eligibleMinerList / ineligibleMinerList

The ANNOTATION_PREFIX values are 2 and 4 respectively, and each can hold up to 3 addresses. A transaction is valid only if the block's beneficiary (etherbase) is in eligibleMinerList (or is not in ineligibleMinerList). Using both at the same time (prefix 6) is not allowed. The limit of 3 addresses is based on the fact that, at the time of writing, the top 3 miners produced 52% of all blocks. It notes that ineligibleMinerList can be circumvented by a miner using a temporary address as beneficiary, but this is not entirely without cost since moving funds requires an additional transaction and time.

expiry: limiting the validity period

ANNOTATION_PREFIX 8. The transaction is valid only if the block's timestamp is less than the EXPIRY value. Since this field carries no protocol-level gas cost, it states that spam prevention relies on miners simply dropping unwanted transactions from the pool.

Why only a 4-byte hash is used, and the collision probability

Using only the first 4 bytes of the hash for ancestorId, instead of the full 32 bytes, is a choice made to reduce the bytes transmitted. The original states the collision probability as roughly 1/(16^8 ≈ 4.29 billion), which is further reduced when multiplied by the roughly 10% probability that a public uncle block exists. It adds, however, that this probability can rise to as high as 100% if a competing chain segment persists for a long time. Even if a collision occurs, the effect is only that the transaction becomes valid on both chain segments, which it states is the same level of risk as the current state.

Signed payload and backwards compatibility

The signature covers not only the transaction data but also the transaction type itself, so the same signature cannot be reinterpreted as a transaction of a different type. The original states there are no known backwards compatibility issues.

Current status

The status of this EIP is Stagnant, and FORK_BLOCK_NUMBER is left as TBD, so it has never actually been included in a fork or implemented. The available call records contain no inclusion decision or debate concerning this EIP.

Original EIP · ← EIPs