Cryptography
Below is a list of all of the cryptographic algorithms that Firedancer implements:
AES-GCM
An authenticated encryption scheme. Used for securing traffic send through TLS.
Implementation copied out of Linux and OpenSSL.
BLAKE3
Tree-based hashing function, used for computing the LtHash.
Implementation written by hand from scratch.
BLS12-381
A pairing-friendly elliptic curve that allows for efficient batching of signature verifications.
Used in the following SVM syscalls:
sol_curve_decompresssol_curve_group_opsol_curve_pairing_mapsol_curve_validate_point
Also used for Alpenglow (consensus) votes and certificates.
Implementation wraps the blst library.
BN254
Also known as alt_bn128. A pairing-friendly elliptic curve.
Used in the following SVM syscalls:
sol_alt_bn128_group_opsol_alt_bn128_compression
Implementation written by hand, with the core field operations provided by fiat-crypto.
Poseidon
A SNARK-friendly cryptographic hash function.
Used in the sol_poseidon syscall.
Implementation handwritten over the BN254 scalar field.
ChaCha (ChaCha8 & ChaCha20)
Used for computing shred distribution trees and the leader schedule.
Implementation written by hand, providing both scalar and SIMD optimized variants.
Ed25519
An EdDSA signature scheme that operates on the Edwards25519 curve.
Used for verifying ownership of transactions, accounts, shreds, repair requests, and gossip messages.
Used to sign various consensus and p2p messages.
Implementation consists of multiple backends:
- A reference implementation using fiat-crypto
- Handwritten constant-time signing routines (
fd_curve25519_secure.c). - Handwritten high-performance AVX512-IFMA backend for Intel/AMD CPUs
- Hardware-accelerated signature verification via FPGA offload (Wiredancer)
Curve25519
An elliptic curve.
Used in the following SVM syscalls:
sol_curve_multiscalar_mulsol_curve_group_opsol_curve_validate_point
Ristretto255
A prime-order group constructed over Curve25519 using the Ristretto group abstraction (RFC 9496).
Used in the following SVM syscalls:
sol_curve_multiscalar_mulsol_curve_group_opsol_curve_validate_point
Also used in the Solana ZK SDK.
Implementation implemented in fd_ristretto255.c on top of Firedancer's Curve25519 arithmetic.
X25519
An Elliptic Curve Diffie-Hellman (ECDH) key agreement scheme over Curve25519 in Montgomery form (RFC 7748).
Used for TLS 1.3 and QUIC key establishment.
Implementation provides:
- Assembly routines from AWS s2n-bignum on x86-64.
- A portable constant-time Montgomery ladder reference backend built on
fiat-crypto.
Secp256k1
A Koblitz elliptic curve defined in SEC 2.
Used in Solana for:
- The
KeccakSecp256k11111111111111111111111111111native precompile. - The
sol_secp256k1_recoversyscall.
Implementation provides:
- Assembly routines from AWS s2n-bignum on x86-64.
- A portable reference backend using fiat-crypto.
Secp256r1 (NIST P-256)
A prime Weierstrass elliptic curve (FIPS 186-4).
Used in Solana for:
- The
Secp256r1SigVerify1111111111111111111111111native precompile. - TLS 1.3 server authentication (
ecdsa_secp256r1_sha256) outside of QUIC. - X.509 certificate validation.
Implementation uses:
- Assembly routines from AWS s2n-bignum on x86-64.
- A portable reference backend generated by fiat-crypto.
Secp384r1 (NIST P-384) is similarly provided.
SHA-2
A family of cryptographic hash functions.
SHA-256 is used for computing PoH, computing PDAs, and generally any Solana protocol hashing requirements, and also the SVM sol_sha256 syscall.
SHA-512 is used by Ed25519 and RSA signatures. SHA-384 is used by P-384 ECDSA and RSA signatures in X.509/TLS.
Implementations of SHA-256 and SHA-384/SHA-512 provide scalar and SIMD batched variants written by hand. SHA-256 also uses SHA-NI. The SHA-512 AVX2 core is generated from OpenSSL's sha512-x86_64.pl.
Keccak-256
A cryptographic hashing function.
Used in Solana for:
- The
sol_keccak256syscall. - Secp256k1 recovery precompile.
- Internal sponge permutation primitives for Strobe-128 and Merlin.
Implementation provides:
- Assembly routines from AWS s2n-bignum (
sha3_keccak_f1600.S). - A portable C reference implementation (
fd_keccak256_private.h).
Strobe-128
A sponge construction used to build non-interactive protocols.
Used for Merlin in the Zk El-Gamal native program. Follows the spec.
Implementation written by hand, using the core Keccak-256 permutation described above.
LtHash (LtHash16-1024)
A homomorphic hashing scheme based on BLAKE3.
Used as a live hash over the Solana account database.
RSA
A digital signature scheme.
RSASSA-PSS and RSASSA-PKCS1-v1.5 are used for X.509 certificate verification and TLS connections.