--- eip: 8804 title: Cryptographic Capability Declaration description: A contract declares the signature and encryption schemes it uses and its post quantum readiness author: Quantova Inc (@quantova-inc) discussions-to: https://ethereum-magicians.org/t/erc-8804-cryptographic-capability-declaration/30624 status: Draft type: Standards Track category: ERC created: 2026-12-05 requires: 165 --- ## Abstract This ERC defines a view interface through which a contract declares the cryptographic schemes it uses, each named by a single scheme byte, a signature scheme byte and an encryption scheme byte, and reports whether those schemes are post quantum. A counterparty, a wallet or an indexer reads the declaration to learn whether a contract is quantum secure, which scheme it holds and how far a migration has reached, without guessing from a field length or a byte probe. ## Motivation A post quantum migration is a change that happens contract by contract and account by account, and nothing today lets a reader learn where a given contract stands. A wallet that is about to send value to an account cannot tell whether that account is still on an elliptic curve signature. A tool that reports the readiness of a protocol cannot count which of its contracts have moved. A counterparty that only wants to interact with a quantum secure account has no way to check. The schemes themselves are each named by a single byte, a signature scheme byte and an encryption scheme byte. What is missing is a standard way for a contract to publish which of those bytes it uses and whether they are post quantum, so that the state of a migration is a value a reader reads rather than a fact a reader infers. This is the cryptographic equivalent of the interface declaration in [ERC-165](./eip-165.md), applied to the algorithms a contract depends on rather than to the interfaces it implements. ## 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. ### Scheme bytes A cryptographic scheme is named by a single byte, one byte for a signature scheme and one byte for an encryption scheme. A scheme byte is post quantum when the scheme it names is a NIST standardised post quantum algorithm. Every scheme the two registries define today is post quantum. The elliptic curve algorithms a contract may also use are named by the reserved byte `0x00`, which is not post quantum and stands for every classical scheme a contract uses that has no registered byte. ### Interface A conforming contract implements [ERC-165](./eip-165.md) and the following interface. ```solidity interface ICryptographicCapabilities { /// @notice The scheme bytes this contract uses, for both signatures and encryption. function cryptographicSchemes() external view returns (bytes memory schemes); /// @notice Whether this contract uses only post quantum schemes. function isPostQuantum() external view returns (bool); } ``` `cryptographicSchemes` returns the set of scheme bytes the contract uses, as a byte string with one byte per scheme and no repeats. The byte `0x00` is present when the contract uses any classical scheme. The order of the bytes is not significant and a reader MUST NOT depend on it. `isPostQuantum` returns true when `cryptographicSchemes` contains no classical scheme, which is the case when the returned byte string does not contain `0x00` and every byte in it is a registered post quantum scheme byte. It returns false otherwise. A contract MUST return from `cryptographicSchemes` exactly the schemes it uses to authenticate or to receive encrypted data, and MUST NOT list a scheme it does not use. `isPostQuantum` MUST be consistent with `cryptographicSchemes`, so a reader MAY rely on either. The [ERC-165](./eip-165.md) interface identifier for `ICryptographicCapabilities` is declared so that a reader first asks whether a contract declares its capabilities at all. ## Rationale ### Why reuse the scheme bytes The scheme bytes are defined where the signature and the encryption are defined, so a declaration that reuses them ties the discovery layer to the same registry the account and the encryption use, and a reader learns a scheme the same way everywhere. A separate numbering would let the discovery drift from the schemes it describes. ### Why a reserved byte for classical A migration is a mixed state in which a contract may still carry a classical scheme beside a post quantum one. A single reserved byte `0x00` for all classical schemes lets a contract declare that it is not yet fully migrated without enumerating curves that have no registered byte, and it makes `isPostQuantum` a simple test for the absence of that byte. ### Why follow ERC-165 [ERC-165](./eip-165.md) is the established way a contract declares a capability that a reader checks before it interacts. Declaring cryptographic schemes the same way means a reader uses the pattern it already knows, first asking through ERC-165 whether the contract declares its cryptography and then reading the schemes, rather than probing a signature or a key to guess the algorithm. ## Backwards Compatibility This ERC adds a view interface and changes no existing behaviour. A contract that does not implement it is simply a contract whose cryptography is not declared, which a reader learns from the [ERC-165](./eip-165.md) check, and the reader falls back to whatever it did before. The reserved byte `0x00` cannot collide with a registered scheme byte because the registries do not assign it. ## Reference Implementation A reference account that holds a post quantum signature credential and an ML-KEM encryption credential returns the two scheme bytes from `cryptographicSchemes` and true from `isPostQuantum`, and a reference contract that still uses an elliptic curve signature returns a byte string containing `0x00` and false. The references are published with this proposal. ## Security Considerations The declaration is a claim a contract makes about itself and is not a proof, so a reader MUST treat `isPostQuantum` as the contract's own statement and MUST NOT accept it as evidence that a signature verified. A reader that requires a post quantum guarantee MUST still verify a post quantum signature or encrypt to a post quantum key, and MUST use the declaration only to choose which path to take. A contract that lists a scheme it does not use misdeclares itself, which can mislead a counterparty, so an implementation MUST keep the declaration in step with the schemes it actually uses, in particular after a credential rotation that changes a scheme. ## Copyright Copyright and related rights waived via [CC0](../LICENSE.md).