Overview
The crypto component is organized into several layers:Crypto Component
Main interface used by replicas for all cryptographic operations
Threshold Signatures
BLS12-381 based threshold signatures for consensus and certification
Chain-Key Crypto
Threshold ECDSA/Schnorr for signing transactions on other chains
TLS & Node Keys
Transport security and node identity management
The cryptography implementation is located in
rs/crypto/ with the main component in src/ and supporting libraries in subdirectories.Architecture
The crypto component is structured as follows:Key Components
- Crypto Component
- Internal Libraries
- Public Crates
Location:
rs/crypto/src/The main interface used by replica components:- Manages secret keys through SecretKeyStore
- Provides signing and verification operations
- Handles TLS connections
- Interfaces with consensus and other components
Chain-Key Cryptography
Chain-key cryptography is a cornerstone innovation of the Internet Computer, enabling:- Single public key for the entire IC
- Fast finality and certified queries
- Threshold signatures without key reconstruction
- Integration with other blockchains (Bitcoin, Ethereum)
Threshold Signatures (BLS12-381)
The IC uses BLS signatures on the BLS12-381 curve for:Consensus
Consensus
Random beacon and block finalization:
Certification
Certification
State certification and query responses:
DKG (Distributed Key Generation)
DKG (Distributed Key Generation)
Non-interactive DKG for key generation:From rs/crypto/internal/crypto_lib/threshold_sig/bls12_381/:
- Forward-secure encryption for dealing
- NIZK proofs for correctness
- Complaint mechanism for cheating dealers
Properties
Non-Interactive
Key generation doesn’t require synchronous communication rounds
Threshold Security
Requires t+1 of n shares to produce signatures
Unique Signatures
Each message has exactly one valid signature
Efficient Verification
Single signature verification regardless of signers
Chain-Key Signatures
The IC can sign transactions for other blockchains using threshold cryptography:Threshold ECDSA
- Overview
- Key Derivation
- Signing Process
Enables canisters to have ECDSA keys and sign transactions:Supported Curves:
- secp256k1 (Bitcoin, Ethereum)
- secp256r1 (Enterprise applications)
- Bitcoin integration
- Ethereum interoperability
- Cross-chain DeFi
- Multi-chain wallets
Threshold Schnorr
Support for Schnorr signatures:- BIP-340 for Bitcoin Taproot
- Ed25519 for other applications
- Similar threshold protocol to ECDSA
- Optimized for specific use cases
Internet Computer Distributed Key Generation (IDKG)
IDKG is the protocol for generating and managing threshold keys:
Protocol Features:
Resharing
Transfer key shares to new node set without revealing the key
Multiple Keys
Support multiple threshold keys on same subnet
Forward Security
Old key shares cannot recover future keys
Verifiable
All operations include cryptographic proofs
Key Management
SecretKeyStore
The crypto component manages node secret keys:- Node signing keys (Ed25519)
- Committee signing keys (multi-signature)
- DKG encryption keys (forward-secure)
- TLS certificate keys
- Threshold key shares
Node Key Validation
Validation of node public keys:Cryptographic Primitives
Hashing
- SHA-2 Family
- Hash Trees
- Hash-to-Curve
Location:
rs/crypto/sha/Standard hash functions:Signature Schemes
| Scheme | Use Case | Location |
|---|---|---|
| BLS12-381 | Threshold signatures, consensus, certification | rs/crypto/internal/crypto_lib/threshold_sig/bls12_381/ |
| Ed25519 | Node signatures, basic authentication | rs/crypto/internal/crypto_lib/basic_sig/ed25519/ |
| ECDSA | Threshold signing for Bitcoin, Ethereum | rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/ |
| Schnorr | Bitcoin Taproot, alternative signatures | rs/crypto/internal/crypto_lib/threshold_sig/canister_threshold_sig/ |
TLS and Transport Security
Node-to-Node Communication
All replica communication is secured with TLS:Registry Integration
Crypto keys are stored in the Registry:- Node public keys
- Subnet threshold keys
- DKG transcripts
- Certificate chains
Cryptographic Tests
The crypto component includes extensive testing:Unit Tests
Unit Tests
Located throughout
rs/crypto/ for individual components:Benchmarks
Benchmarks
Performance testing in
benches/:Stability Tests
Stability Tests
Ensure consistent behavior:
Usage Examples
Threshold Signing (Canister)
Verification (Client)
Security Considerations
Key Protection
- Secret keys stored in encrypted format
- Access controlled by crypto component
- Never exported from SecretKeyStore
- Rotation procedures for compromised keys
Threshold Security
- Requires threshold of nodes to sign
- Individual node compromise doesn’t leak key
- Byzantine fault tolerance (n ≥ 3f+1)
- Proactive resharing for forward security
Side-Channel Resistance
- Constant-time implementations
- Memory protection mechanisms
- Sandboxed execution
- Regular security audits
Protocol Security
- Formal security proofs
- Zero-knowledge proofs for correctness
- Complaint mechanisms
- Verifiable randomness
Source Code Reference
Related Topics
Consensus
How cryptography enables IC consensus
State Management
State certification using threshold signatures
Canisters
Using chain-key signatures in canisters
Network Nervous System
Governance and the Registry’s key management