EIPs Explained

EIP-7591 · Stagnant · Core · 2024-01-10

EIP-7591: BLS signed transactions

A stagnant proposal for a transaction type signed with BLS instead of ECDSA, so all such signatures in a block can be merged into one aggregate signature in the header.

What problem does it solve?

Every Ethereum transaction carries its own 65-byte ECDSA signature, and nodes verify each one separately. BLS signatures have a useful property: many signatures over different messages can be combined into a single 96-byte aggregate and checked in one batch.

EIP-7591 proposes a new EIP-2718 transaction type signed with BLS, so that a block could store one aggregate signature instead of one signature per transaction. The author is candid that the space saving is small; a second motivation is to show how Ethereum could add a new signature scheme as a transaction type, which is the same path a future quantum-safe scheme might take.

How it works

  • New transaction type 0x04 with fields [chain_id, nonce, max_priority_fee_per_gas, max_fee_per_gas, gas_limit, to, value, data, access_list, sender, signature]. Fee fields follow EIP-1559.
  • sender is the sender's 48-byte BLS public key; the account address is the first 20 bytes of keccak256(sender).
  • The sender signs keccak256(0x04 || rlp([...all fields except signature])).
  • When building a block, the producer strips each signature, aggregates them, and puts the result in a new header field aggregated_sig. Blocks containing BLS transactions that still carry signature are invalid.
  • Validators check the whole block with one verifyAggregate(senders, tx_hashes, aggregated_sig) call.

The spec argues a single key cannot control the same address under both ECDSA and BLS without breaking one of the schemes, so the two account types do not collide.

Sample code

Transaction encoding and block verification, as pseudocode:

BLS_TX_TYPE = b"\x04"

def bls_tx_hash(tx):
    body = [tx.chain_id, tx.nonce, tx.max_priority_fee_per_gas, tx.max_fee_per_gas,
            tx.gas_limit, tx.to, tx.value, tx.data, tx.access_list, tx.sender]
    return keccak256(BLS_TX_TYPE + rlp.encode(body))

def sender_address(bls_pubkey: bytes) -> bytes:
    return keccak256(bls_pubkey)[:20]

def verify_block(block):
    bls_txs = [t for t in block.txs if t.type == 0x04]
    assert all(t.signature is None for t in bls_txs)
    return bls.AggregateVerify(
        [t.sender for t in bls_txs],
        [bls_tx_hash(t) for t in bls_txs],
        block.header.aggregated_sig,
    )

Things to know

  • Status is Stagnant; it has not been scheduled for any upgrade.
  • The type byte 0x04 it proposes is now used by EIP-7702 set-code transactions, so a revived version would need a different type number.
  • The header layout in the spec is based on the header of its time and would need updating for fields added by later forks.
  • By the author's own estimate the saving is about 2.4 KB per block (roughly 1.5 %), and only if many users switched to BLS accounts.
  • It requires a hard fork: new transaction type, new header field and new block validity rules.

#transactions #bls #signatures #core

Details

Authors
Marius van der Wijden (@MariusVanDerWijden)
Status
Stagnant
Type
Standards Track / Core
Created
2024-01-10

Machine-readable: Markdown · JSON