EIPs Explained

EIP-7932 · Draft · Core · 2025-04-12

EIP-7932: Secondary Signature Algorithms

Creates a registry of signature algorithms beyond secp256k1, a common address-derivation rule and a sigrecover precompile, as groundwork for post-quantum and other signature schemes.

What problem does it solve?

Every Ethereum externally owned account is tied to secp256k1 ECDSA. Quantum computers are expected to break that curve eventually, and many applications would also like other schemes (passkeys, BLS, post-quantum lattices). Post-quantum signatures, however, tend to have large keys, large signatures or slow verification, and each one has different quirks.

Adding them one by one with bespoke rules would fragment the protocol. EIP-7932 instead defines one registry and one interface that future algorithm EIPs plug into, so the protocol, smart accounts and tooling can treat "a signature" generically.

How it works

  • Algorithm interface. Each algorithm, specified in its own EIP, defines an ALG_TYPE byte, a fixed signature SIZE, a gas_cost relative to secp256k1, and validate, verify (returns the signer's public key) and merge_detached_signature functions. Algorithm EIPs must include a security analysis, benchmarks and a discussion of malleability.
  • Registry. algorithm_registry maps a type byte to an entry, tracking which algorithms a hard fork has activated. Type 0x7F is reserved as invalid; types must be below 127.
  • secp256k1 is type 0x00. Its signature is 66 bytes (type byte + r, s, y-parity), with low-s enforced.
  • Address derivation. 0x00 keeps today's rule (keccak(pubkey)[12:]). Other algorithms hash algorithm_id || public_key, with an extra separator for 63-byte keys to avoid collisions with legacy addresses.
  • sigrecover precompile at address 0x12. Input is signature || signing_data, where the first byte selects the algorithm. It charges 3000 gas plus the algorithm's penalty and returns the signer's address left-padded to 32 bytes, or empty output on failure.

Sample code

Calling the precompile from Solidity with a secp256k1 signature:

// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.20;

library SigRecover {
    address constant SIGRECOVER = address(0x12);

    /// sig = 0x00 || r (32) || s (32) || yParity (1)  -> 66 bytes
    function recover(bytes memory sig, bytes32 digest) internal view returns (address signer) {
        (bool ok, bytes memory out) = SIGRECOVER.staticcall(abi.encodePacked(sig, digest));
        require(ok && out.length == 32, "sigrecover failed");
        signer = abi.decode(out, (address));
    }
}

Address derivation, as in the spec:

def pubkey_to_address(public_key: bytes, algorithm_id: int) -> bytes:
    if algorithm_id == 0x00:
        return keccak(public_key[1:])[12:]          # legacy secp256k1
    if len(public_key) == 63:
        return keccak(bytes([algorithm_id, 0x00]) + public_key)[12:]
    return keccak(bytes([algorithm_id]) + public_key)[12:]

Things to know

  • Status: Draft. The precompile address, gas values and interface may change.
  • This EIP defines only the framework and the secp256k1 entry. Actual post-quantum algorithms need their own EIPs and a hard fork.
  • A precompile (rather than a contract) is used so transaction-level verification can use the registry without entering the EVM. The authors describe it as compatible with ERC-4337 smart accounts, which can call the precompile for consistent address derivation.
  • The spec notes that allowing more ways to derive addresses for one account may reduce that account's security; each new algorithm needs careful review.

#signatures #post-quantum #precompile #core #accounts

Details

Authors
James Kempton (@SirSpudlington)
Status
Draft
Type
Standards Track / Core
Created
2025-04-12
Required by

Machine-readable: Markdown · JSON