Abstract
This EIP adds three precompiles that verify Stateless Hash-Based Digital Signature Algorithm (SLH-DSA) signatures as standardised in FIPS 205, at NIST security levels 1, 3 and 5. Each precompile takes a single concatenated input of the form pubkey ++ signature ++ message with no length prefixes, and returns a 32 byte word that is one on a valid signature and zero otherwise. The precompiles cover the SHA2 small signature parameter sets, so that a verifier reduces to the hash functions the Ethereum Virtual Machine already exposes.
Motivation
A sufficiently powerful quantum computer breaks the elliptic curve signatures that secure Ethereum accounts and every bridge, rollup and application that depends on them. The post quantum answer is two families of signature, one lattice and one hash based, so that a weakness found in one family does not remove post quantum coverage.
Ethereum already has a lattice verifier. EIP-8355 adds precompiles for ML-DSA, the module lattice standard in FIPS 204. There is no hash based verifier. SLH-DSA, the stateless hash based standard in FIPS 205, rests on the security of its hash functions alone and makes no number theoretic or lattice assumption, which is the most conservative position a signature can take. The United States Commercial National Security Algorithm Suite 2.0 names hash based signatures for software and firmware signing for the same reason.
A contract that must verify a hash based signature today has no primitive to call. It must implement SLH-DSA in the Ethereum Virtual Machine, which is tens of thousands of hash compressions per verification and is not affordable. A precompile makes hash based verification a single call, gives applications a fallback that does not share a hard problem with the lattice verifier, and lets a migration carry both families at once.
Specification
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in RFC 2119 and RFC 8174.
Parameters
| Constant | Value |
|---|---|
FORK_BLOCK | To be defined |
VERIFY_SLHDSA_SHA2_128S_ADDRESS | 0x14 |
VERIFY_SLHDSA_SHA2_192S_ADDRESS | 0x15 |
VERIFY_SLHDSA_SHA2_256S_ADDRESS | 0x16 |
The three precompiles verify the FIPS 205 parameter sets SLH-DSA-SHA2-128s, SLH-DSA-SHA2-192s and SLH-DSA-SHA2-256s. Their fixed sizes, in bytes, are as follows.
| Parameter set | Security level | Public key | Signature |
|---|---|---|---|
| SLH-DSA-SHA2-128s | 1 | 32 | 7856 |
| SLH-DSA-SHA2-192s | 3 | 48 | 16224 |
| SLH-DSA-SHA2-256s | 5 | 64 | 29792 |
Input
Each precompile takes a single byte string of the form pubkey ++ signature ++ message. The public key and the signature are the fixed sizes above for the precompile being called. The message is every byte after the signature and MAY be of any length, including zero. There are no length prefixes.
The message is taken as the trailing bytes so that a caller signs and verifies the message itself, under the pure variant of SLH-DSA with an empty context string, without pre hashing it in the contract. This matches the input shape of EIP-8355.
Output
Each precompile returns a 32 byte big endian word. It is 1 when the input parses to the exact fixed sizes for that parameter set and the signature verifies over the message under the public key, following the SLH-DSA verification procedure of FIPS 205 for the pure variant with an empty context string. It is 0 otherwise. A precompile MUST NOT revert on a well formed input whose signature does not verify, and MUST return 0 when the input is shorter than the sum of the fixed public key and signature sizes.
Gas cost
The gas cost of each precompile is a fixed base plus a per word charge over the whole input.
| Parameter set | Base gas |
|---|---|
| SLH-DSA-SHA2-128s | To be defined |
| SLH-DSA-SHA2-192s | To be defined |
| SLH-DSA-SHA2-256s | To be defined |
The base gas MUST be calibrated from a native benchmark of the verification on the target client hardware, dominated by the SHA2 compressions the verification performs, before the fork is scheduled. The per word charge over the input follows the memory and copy accounting already used for large precompile inputs.
Rationale
Why SLH-DSA alongside ML-DSA
ML-DSA and SLH-DSA are the two signature schemes NIST has finalised, as FIPS 204 and FIPS 205. They rest on unrelated hard problems, a lattice problem and the security of a hash function, so the pair gives Ethereum a fallback if one family is weakened. A chain that carries only a lattice verifier has no second family to fall back to. SLH-DSA is the conservative anchor of a post quantum migration, and a precompile is the only affordable way to verify it on chain.
Why the SHA2 parameter sets
SLH-DSA verification is a sequence of hash computations and nothing else. The SHA2 parameter sets use SHA-256 and SHA-512, which the Ethereum Virtual Machine already exposes and which clients already implement and optimise. Choosing the SHA2 sets keeps the verifier on primitives the ecosystem has audited, rather than requiring a new SHAKE implementation in consensus critical code.
Why the small signature sets
FIPS 205 offers a small and a fast variant of each parameter set. The small variant produces a smaller signature at the cost of slower signing, which is the correct trade for a chain where the signature is calldata that every node stores and verification happens far more often than signing. The 128s signature is 7856 bytes against 17088 bytes for 128f. Where an application needs the fast variant, a later EIP can add it at a further address without changing this one.
Why the concatenated input
A single concatenated input of pubkey ++ signature ++ message with no length prefixes carries the FIPS 205 encodings unmodified, lets the message be any length, and keeps the public key and the signature as the only fixed size values. It is the same shape EIP-8355 uses for ML-DSA, so a contract that dispatches across both families parses both the same way.
Backwards Compatibility
The precompiles are added at previously unused addresses from the fork block, so there is no effect on existing contracts or state. A contract that calls one of the addresses before the fork receives the empty return of a call to a non contract account, and the same call after the fork receives a verification result, so a contract MUST gate a call on the fork being active.
Test Cases
Each precompile is tested against a corpus that verifies both acceptance and rejection. For each parameter set the corpus includes a genuine signature that returns one, a signature with one flipped bit that returns zero, a message with one flipped bit that returns zero, a signature verified under another public key of the same parameter set that returns zero, an input shorter than the fixed sizes that returns zero, and the FIPS 205 reject categories including a non canonical encoding and an out of range value. The vectors are produced and cross checked against independent implementations and are published with this proposal.
Reference Implementation
A formally checked specification of SLH-DSA verification, written in Cryptol, accompanies this proposal and defines the verification the precompiles implement. A reference verifier and the test vectors are published alongside it. A production client implements the precompile against its own audited SHA2 implementation and is held to the published vectors.
Security Considerations
The security of SLH-DSA reduces to the collision and preimage resistance of its hash functions and makes no lattice or number theoretic assumption. A quantum adversary gains only the square root speed up of Grover against those hashes, which the parameter sets already account for, so the security levels hold against a quantum adversary.
A signature is large, from 7856 to 29792 bytes, and a verification performs on the order of thousands of hash compressions. The fixed base gas MUST bound this work so that a block of verifications cannot be used to exhaust a node, and the per word charge MUST bound the calldata a verification reads. A precompile returns zero rather than reverting on a bad signature, so a caller MUST check the returned word and MUST NOT treat a non reverting call as a valid signature.
The precompiles verify the pure variant of SLH-DSA with an empty context string. An application that needs domain separation MUST place its domain inside the message it signs, and MUST NOT rely on the context string, which is empty here.
Copyright
Copyright and related rights waived via CC0.
