evm precompiles

QoreChain extends the EVM with six custom precompiled contracts that expose protocol-level features directly to Solidity. These precompiles provide on-chain access to post-quantum cryptography, AI risk scoring, cross-VM messaging, and RL consensus parameters.


Precompile Address Map

Precompile
Address
Base Gas
Description

CrossVM Bridge

0x0000000000000000000000000000000000000901

50,000

Synchronous cross-VM calls (EVM to CosmWasm)

PQC Verify

0x0000000000000000000000000000000000000A01

25,000 + 8/byte

Verify ML-DSA-87 post-quantum signatures

PQC Key Status

0x0000000000000000000000000000000000000A02

2,500

Check if an account has a registered PQC key

AI Risk Score

0x0000000000000000000000000000000000000B01

50,000

Get AI-generated risk score for transaction data

AI Anomaly Check

0x0000000000000000000000000000000000000B02

40,000

Check if a transfer is flagged as anomalous

RL Consensus Params

0x0000000000000000000000000000000000000C01

1,500

Read current RL-tuned consensus parameters


Solidity Interfaces

IQorePQC.sol

// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

interface IQorePQC {
    /// @notice Verify an ML-DSA-87 (Dilithium-5) signature
    /// @param pubkey The 2592-byte ML-DSA-87 public key
    /// @param signature The 4627-byte ML-DSA-87 signature
    /// @param message The original message bytes
    /// @return valid True if the signature is valid
    function pqcVerify(
        bytes calldata pubkey,
        bytes calldata signature,
        bytes calldata message
    ) external view returns (bool valid);

    /// @notice Check if an account has a registered PQC public key
    /// @param account The Ethereum-style address to check
    /// @return registered True if a PQC key is registered
    /// @return algorithmId The PQC algorithm identifier (1 = ML-DSA-87)
    /// @return pubkey The registered public key bytes (empty if not registered)
    function pqcKeyStatus(address account)
        external
        view
        returns (bool registered, uint8 algorithmId, bytes memory pubkey);
}

IQoreAI.sol

IQoreConsensus.sol


Usage Examples

PQC Verify -- Verify a Post-Quantum Signature

Gas cost: 25,000 base + 8 gas per byte of input data. For a typical ML-DSA-87 verification (2592 + 4627 + message bytes), expect approximately 80,000-90,000 gas.

PQC Key Status -- Check Account Registration

Gas cost: 2,500 flat.

AI Risk Score -- Evaluate Transaction Risk

Risk levels:

Level
Value
Score Range (bps)

SAFE

0

0 - 1000

LOW

1

1001 - 3000

MEDIUM

2

3001 - 6000

HIGH

3

6001 - 8500

CRITICAL

4

8501 - 10000

Gas cost: 50,000 flat.

AI Anomaly Check -- Flag Suspicious Transfers

Gas cost: 40,000 flat.

RL Consensus Params -- Read Consensus State

Gas cost: 1,500 flat.

CrossVM Bridge -- Call CosmWasm from EVM

Gas cost: 50,000 base + target contract execution cost. See Cross-VM Interoperability for details.


Interface File Locations

The Solidity interface files are available in the repository for direct import:

Install them in your Hardhat or Foundry project:

Or reference them via import path in your Solidity files:


Next Steps

  • Cross-VM Interoperability -- Full cross-VM messaging documentation

  • EVM Development -- Deploying Solidity contracts

  • Account Abstraction -- Programmable accounts with session keys