Try it live: open the Playground to experiment with Voltaire primitives in your browser.
Prerequisites
- Node.js: 18+ (20+ recommended)
- Package Manager: npm, bun, pnpm, or yarn
- Knowledge: Basic JavaScript/TypeScript
New to Ethereum? Check out our Skills for example-based patterns with working code you can copy into your project.
Installation
npm install @tevm/voltaire
Zig requires building native dependencies first. See Multiplatform Installation for complete instructions.# Clone and build (requires Rust/Cargo)
git clone https://github.com/evmts/voltaire.git
cd voltaire && zig build
zig fetch alone will not work - native Rust crypto libraries must be built via Cargo first.
Prefer importing from "voltaire" instead of "@tevm/voltaire"? Install with an alias:# npm
npm install voltaire@npm:@tevm/voltaire
# bun
bun add voltaire@npm:@tevm/voltaire
# pnpm
pnpm add voltaire@npm:@tevm/voltaire
# yarn
yarn add voltaire@npm:@tevm/voltaire
Then import as import { Address } from "voltaire".
Runtime support: Native FFI is currently supported on Bun. In Node.js, use the regular TypeScript API or the WASM modules. Browsers use WASM.
Imports
Primitives
Cryptography
EVM
Utils
JSON-RPC Provider
import {
Abi,
AccessList,
Address,
Authorization,
Base64,
BinaryTree,
Blob,
BloomFilter,
Bytecode,
Chain,
ChainId,
Denomination,
Ens,
EventLog,
FeeMarket,
GasConstants,
Hardfork,
Hash,
Hex,
Int,
Nonce,
Opcode,
PrivateKey,
PublicKey,
Rlp,
Signature,
Siwe,
State,
Transaction,
Uint
} from "@tevm/voltaire";
import {
AesGcm,
Bip39,
Blake2,
Bls12381,
Bn254,
Ed25519,
EIP712,
HDWallet,
Keccak256,
Kzg,
P256,
Pbkdf2,
Poseidon,
Ripemd160,
Schnorr,
Secp256k1,
Secp256r1,
Sha256,
Sha3,
Sha512,
X25519
} from "@tevm/voltaire";
import {
Opcode,
Bytecode,
GasConstants
} from "@tevm/voltaire";
import {
Base64,
Hex,
Rlp
} from "@tevm/voltaire";
import { Provider } from "@tevm/voltaire";
Import Paths
- Default ergonomic:
import { Address, Hex } from '@tevm/voltaire'
- Tree-shakable subpaths:
import { Address } from '@tevm/voltaire/Address'
- Avoid:
@tevm/voltaire/primitives/*, tevm/*, @voltaire/*
- Aliasing: with
voltaire@npm:@tevm/voltaire, you can import { Address } from 'voltaire' and still use the same subpaths for tree-shaking.
Learn More
API Reference
Primitives
ABI
ABI encoding and decoding. Supports functions, events, errors, and constructors per the ABI specification.
View docs →
AccessList
EIP-2930 transaction access lists for optimized state access costs.
View docs →
Address
20-byte Ethereum addresses with EIP-55 checksumming and CREATE/CREATE2 calculation.
View docs →
Authorization
EIP-7702 authorization lists for account abstraction code delegation.
View docs →
Base64
RFC 4648 Base64 encoding and decoding.
View docs →
BinaryTree
Binary tree structures for Merkle trees and similar data structures.
View docs →
Blob
EIP-4844 blob transaction data (128KB blobs).
View docs →
BloomFilter
Ethereum log bloom filters for efficient log filtering.
View docs →
Bytecode
Contract bytecode manipulation, analysis, and metadata handling.
View docs →
Chain
Chain configuration and network parameters.
View docs →
ChainId
Network identifiers (mainnet, testnets, L2s).
View docs →
Denomination
Ether denomination conversions (wei, gwei, ether).
View docs →
Ens
ENS name normalization per ENSIP-15.
View docs →
EventLog
Transaction event log parsing and filtering.
View docs →
FeeMarket
EIP-1559 fee market calculations (base fee, priority fee).
View docs →
GasConstants
EVM gas costs per the Yellow Paper specification.
View docs →
Hardfork
Network hardfork detection and feature flags.
View docs →
Hash
32-byte hash type with constant-time operations.
View docs →
Hex
Hexadecimal encoding with sized types and manipulation utilities.
View docs →
Int
Signed integer types (Int8, Int16, Int32, Int64, Int128, Int256).
View docs →
Nonce
Transaction nonce management.
View docs →
Opcode
EVM opcodes with gas costs and metadata.
View docs →
PrivateKey
Private key operations including signing and address derivation.
View docs →
PublicKey
Public key operations including verification and address derivation.
View docs →
Rlp
Recursive Length Prefix encoding and decoding.
View docs →
Signature
ECDSA signatures (secp256k1, P-256, Ed25519) with recovery and normalization.
View docs →
Siwe
Sign-In with Ethereum (EIP-4361) authentication.
View docs →
State
Account state management and storage slots.
View docs →
Transaction
All Ethereum transaction types (Legacy, EIP-2930, EIP-1559, EIP-4844, EIP-7702).
View docs →
Uint
Unsigned integer types (Uint8, Uint16, Uint32, Uint64, Uint128, Uint256).
View docs →
Cryptography
AesGcm
AES-GCM authenticated encryption per NIST SP 800-38D.
View docs →
Bip39
BIP-39 mnemonic phrase generation and validation.
View docs →
Blake2
Blake2 hash function per RFC 7693.
View docs →
Bls12381
BLS12-381 elliptic curve operations for Ethereum consensus layer.
View docs →
Bn254
BN254 (alt_bn128) elliptic curve for zkSNARK verification.
View docs →
Ed25519
Ed25519 EdDSA signatures per RFC 8032.
View docs →
EIP712
EIP-712 typed structured data signing.
View docs →
HDWallet
BIP-32/BIP-44 hierarchical deterministic wallet key derivation.
View docs →
Keccak256
Keccak-256 hash function (primary Ethereum hash) per FIPS 202.
View docs →
Kzg
KZG polynomial commitments for EIP-4844 blob verification.
View docs →
P256
NIST P-256 (secp256r1) elliptic curve per FIPS 186-5.
View docs →
Pbkdf2
PBKDF2 key derivation function.
View docs →
Poseidon
Poseidon hash function for zero-knowledge proofs.
View docs →
Ripemd160
RIPEMD-160 hash function.
View docs →
Schnorr
Schnorr signatures for Bitcoin compatibility.
View docs →
Secp256k1
Secp256k1 ECDSA for Ethereum transaction signing.
View docs →
Secp256r1
Secp256r1 (P-256) ECDSA signatures.
View docs →
Sha256
SHA-256 hash function per FIPS 180-4.
View docs →
Sha3
SHA-3 hash function family per FIPS 202.
View docs →
Sha512
SHA-512 hash function per FIPS 180-4.
View docs →
X25519
X25519 ECDH key exchange per RFC 7748.
View docs →