EIP-7932 Auxiliary signature algorithm registry (Secondary Signature Algorithms)
No call decision · Security & privacy · EIP status Draft · created 2025-04-12
Adds a precompile at address 0x12 that manages signature algorithms other than secp256k1 through a common registry and recovers the signer's address from a signature under any registered algorithm.
Why it is needed
Today, Ethereum account addresses are tied to a single elliptic curve signature scheme, secp256k1. As quantum computers advance, several post-quantum signature algorithms have been designed to replace it, but each has drawbacks: key sizes exceeding 1KiB, large signatures, or long verification times, all of which incur greater computational and storage cost than secp256k1. Rather than picking one specific algorithm, this EIP creates an algorithm registry and a single interface so that multiple algorithms can be added and used in the same way. New algorithms are specified in separate EIPs and added to the registry.
What changes
Today
- Account addresses are derived only from secp256k1 signature public keys
- There is no standard procedure for adding other signature algorithms
- The signature recovery functionality available to contracts only supports secp256k1
After EIP-7932
- New signature algorithms are added via an algorithm registry and a common interface
- A single 0x12 precompile recovers the signer's address from a signature under any registered algorithm
- New algorithms are specified in separate EIPs containing security analysis and gas benchmarks
Who is affected
- Wallet & app developers: ERC-4337 implementations can call the precompile to use the same signature verification and address derivation logic regardless of algorithm type.
- Client teams: The algorithm registry and the sigrecover precompile must be implemented, and each fork must reflect which algorithms are included in the registry.
- Users: As post-quantum algorithms are added to the registry going forward, this creates a foundation for generating account addresses from keys other than secp256k1.
- Future algorithm proposers: New algorithm EIPs must include security analysis, benchmarks supporting the gas cost, and handling of signature malleability.
In depth
Algorithm interface: six requirements every algorithm must satisfy
New algorithms other than secp256k1 must be specified in a separate EIP and must commonly define ALG_TYPE (a uint8 type byte), SIZE (the signature size including the type byte prefix, which must be padded to this size to be valid), gas_cost (the gas cost based on the signature data, expressed as a relative value with secp256k1 as 0, and must include a reasonable minimum), validate (checks signature validity, may be a no-op depending on the algorithm, and is always called before verify), verify (returns the signer's public key from the signature and signed data), and merge_detached_signature (combines a detached signature and public key into a single signature container, without checking whether the public key matches the signature). The specification must include security analysis, basic benchmarks justifying the gas cost, and handling of malleability issues.
Rules for deriving an address from a public key
If algorithm_id is 0x00, the address is derived the same way it is today, for backward compatibility: the last 20 bytes of keccak(public_key[1:]) after dropping the first 12 bytes. For every other algorithm, the last 20 bytes of keccak(algorithm_id || public_key) are used. However, if the public key length is 63 bytes, a single 0x00 byte is inserted between algorithm_id and the public key to avoid collisions with legacy secp256k1, so the computation becomes keccak(algorithm_id || 0x00 || public_key).
The algorithm registry and the type number space
algorithm_registry is a dictionary keyed by a uint8 type byte, holding an AlgorithmEntry(ALG_TYPE, SIZE, gas_cost, merge_detached_signature, validate, verify) for each algorithm included in a hard fork. Type 0x7F is reserved to mean invalid/none, and algorithm types must be less than 127. It states that once this EIP is finalized, a Living EIP could be created to track which algorithms are active in each fork.
Definition of the default algorithm, secp256k1
The existing signature scheme, secp256k1, is also defined under the same interface. ALG_TYPE is 0x00 and SIZE is 66 (1 type byte plus a 65-byte signature). validate checks that r and s are greater than 0, r < SECP256K1N, s <= SECP256K1N // 2, and y_parity is 0 or 1. gas_cost is 0 if the signed data is 32 bytes, otherwise 30 + 6 * minimum_word_size, modeled on the KECCAK256 opcode. verify includes a compatibility path that hashes the data with keccak256 first if it is not 32 bytes, then recovers and returns the uncompressed public key. Since the signature is recoverable, merge_detached_signature is a no-op.
Behavior and gas cost of the sigrecover precompile
The precompile address is 0x12 (SIGRECOVER_PRECOMPILE_ADDRESS), and a static gas charge of 3000 (SIGRECOVER_PRECOMPILE_BASE_GAS) must be applied before execution. The first byte of the input must be an algorithm type present in the registry, and the total length must exceed that algorithm's SIZE. The leading SIZE bytes are split off as the signature and the remainder as the signed data; the per-algorithm gas computed by calculate_penalty is then charged in addition, and the signer's address is recovered via validate and verify. The output is the 20-byte address left-padded with zeros to 32 bytes, and on failure no data must be returned.
Design rationale: ERC-4337 compatibility, choice of a precompile, opaque signature format
The initial draft looked like it competed with ERC-4337, but the current version supports ERC-4337 via the sigrecover precompile. Regardless of which algorithm was used to derive an address, ERC-4337 implementations can use the same signature verification and address derivation logic. A precompile was chosen over native EVM code so that processes outside the EVM, such as transaction-level signature verification, can access the registry without invoking the EVM. The signature format was left as a byte array whose size the algorithm itself defines, because algorithms differ in properties such as whether they support signature recovery or their key size, and the format must be able to hold any combination of signature and additional recovery information.
Security considerations and current status
The source text notes that increasing the number of ways an account's address can be derived can lower that account's overall security. The computational cost of testing every algorithm partially mitigates this, but it states that each time an algorithm is added, further discussion may be needed to confirm it does not harm network security. It states explicitly that there is no backward compatibility issue because existing logic is unchanged. This EIP is in Draft status, so its contents may still change, and there is no record of a decision on fork inclusion.