EIP-7619 · Draft · Core · 2023-07-03
EIP-7619: Precompile Falcon512 generic verifier
Proposes a precompile at 0x65 that verifies Falcon-512 post-quantum signatures cheaply, so smart contracts and smart accounts can authenticate users with quantum-resistant keys.
What problem does it solve?
Ethereum accounts are secured by ECDSA over secp256k1. A large enough quantum computer running Shor's algorithm could recover private keys from public keys, breaking ECDSA and similar schemes. Post-quantum signature algorithms exist, but verifying them in Solidity is very expensive: the authors report that their Solidity Falcon verifier did not scale because of gas cost, largely due to the SHAKE256 hashing Falcon relies on.
EIP-7619 proposes a native precompile for Falcon-512, a lattice-based scheme from the NIST post-quantum process with NIST security level I and relatively small keys and signatures. With cheap on-chain verification, a smart contract wallet (for example an ERC-4337 account) could require a Falcon signature instead of, or in addition to, ECDSA.
How it works
- Address:
0x65. - Input: concatenated bytes
[public key: 897][signature: 666][message: rest]. The implementation is taken from the PQClean project. - Output: a 32-byte word,
...01if the signature is valid and...00otherwise. - Failure behaviour: the call only fails on insufficient gas. Bad lengths, malformed data and invalid signatures all return
0, not a revert. - Gas:
1465 + 6 × (number of 32-byte words in the input), derived by benchmarking againstecrecover.
The precompile verifies only. Key generation and signing happen off-chain.
Sample code
Solidity wrapper around the precompile, following the spec's example:
// SPDX-License-Identifier: CC0-1.0
pragma solidity ^0.8.20;
library Falcon512 {
address constant PRECOMPILE = address(0x65);
/// publicKey: 897 bytes, signature: 666 bytes (per EIP-7619 encoding)
function verify(bytes memory publicKey, bytes memory signature, bytes memory message)
internal view returns (bool)
{
(bool ok, bytes memory out) =
PRECOMPILE.staticcall(abi.encodePacked(publicKey, signature, message));
return ok && out.length == 32 && uint8(out[31]) == 1;
}
}
Gas estimate for a 32-byte message:
input = 897 + 666 + 32 = 1595 bytes -> ceil(1595 / 32) = 50 words
gas = 1465 + 6 * 50 = 1765
Things to know
- Status is Draft, and the precompile is not active on Ethereum mainnet. On chains without it, a call to
0x65hits an empty account and returns no data, so always check the output length as above. - Falcon signatures are variable in length up to the 666-byte maximum, while the input layout uses a fixed 666-byte slot. The spec does not say how shorter signatures are padded; clarify this against the reference implementation before relying on it.
- The address
0x65is not final in any upgrade, and the spec notes it could be changed. - A later proposal for Falcon support, EIP-8052, and ML-DSA verification proposals such as EIP-8051 cover overlapping ground. Compare them before choosing one to build on.
- A post-quantum signature only helps if the account cannot also be controlled by an ECDSA key, so this is mainly useful for smart contract accounts.