Build Voltaire from source for maximum performance, custom targets, and supply chain security
Voltaire is a Zig library at its core. The TypeScript and native bindings you install from npm are pre-built artifacts optimized for bundle size (ReleaseSmall). Building from source unlocks capabilities not available in the distributed packages.
npm distributions use ReleaseSmall which prioritizes bundle size over raw speed. Building from source with ReleaseFast yields measurable performance gains:
September 2025: A phishing attack compromised 18 npm packages with 2+ billion weekly downloads (chalk, debug, ansi-styles). Malicious code injected wallet-draining malware that hooked window.ethereum and Solana APIs.December 2024: The @solana/web3.js library was backdoored (CVE-2024-54134) through spear-phishing, stealing private keys from developers.These attacks share a pattern:
Building from source with vendored dependencies eliminates npm as an attack vector:
# Clone with all submodules pinned to specific commitsgit clone --recurse-submodules https://github.com/voltaire-org/voltaire.git# Verify git history and commit signaturesgit log --show-signature# Build entirely from source - no npm fetch during buildzig build
What this eliminates:
npm registry as single point of failure
Account compromise attacks (no accounts to compromise)
Malicious version injection (you control the commits)
Typosquatting attacks (no package names to confuse)
We encourage anyone handling significant value to build from source. The cryptocurrency industry faces unique risk from supply chain attacks, and source builds are the only complete mitigation.
# Requiredzig version # 0.15.x (https://ziglang.org/download/)cargo --version # Rust 1.70+ (for crypto wrappers)# Optionalbun --version # For TypeScript tests/buildsgo version # For Go bindings
# Clone repositorygit clone --recurse-submodules https://github.com/voltaire-org/voltaire.gitcd voltaire# Install dependencies and buildzig build deps # Fetch all dependencieszig build # Full build (Zig + C + Rust libraries)# Run testszig build test # All Zig tests