Input Format for Precompiled Function Calls
1. Input Format Specification
When invoking precompiled contracts for Dilithium5 or MLDSA-87 verification, the input must follow this structured byte format:
Copy
Field Definitions
Field
Description
PUBLIC_KEY
The public key (Dilithium5: 1,312 bytes / MLDSA-87: ~3 KB)
MESSAGE
Original message (arbitrary length) that was signed
SIGNATURE
Cryptographic signature (Dilithium5: 2.8 KB / MLDSA-87: 2.5 KB)
2. Precompiled Contract Addresses
3. Verification Logic
The precompiled contracts:
Validate that
SIGNATURE
matchesMESSAGE
when signed byPUBLIC_KEY
.Return
1
(success) or0
(failure) as a 32-byte word.
4. Use Cases
4.1 Post-Quantum Secure Authentication
Verify off-chain signatures before executing sensitive transactions.
4.2 Decentralized Identity
Validate quantum-proof credentials in DID (Decentralized Identifiers) systems.
4.3 Gas Optimization
30-50% cheaper than equivalent EVM-based signature verification.
Last updated