npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@tevm/voltaire

v0.1.42

Published

Ethereum primitives and cryptography library with TypeScript implementations and native Zig bindings via Bun FFI

Readme

Why Voltaire?

Modern Ethereum library built for TypeScript, Zig, Swift, and AI-assisted development.

import { Address, Wei, Gwei, Ether, Rlp, Abi, Keccak256, Hex } from '@tevm/voltaire'

// Type-safe addresses - casing bugs eliminated
const addr = Address('0x742d35Cc6634C0532925a3b844Bc9e7595f51e3e')
Address.toChecksummed(addr) // "0x742d35Cc..."

// Denomination safety - can't accidentally mix Wei and Ether
const value = Wei(1000000000000000000n)
Wei.toEther(value)  // 1n
Wei.toGwei(value)   // 1000000000n

// Keccak256 hashing
const selector = Keccak256.selector('transfer(address,uint256)')
// Uint8Array(4) [0xa9, 0x05, 0x9c, 0xbb]

// RLP encoding
const encoded = Rlp.encode([addr, Hex.fromNumber(42n)])

// ABI encoding
const calldata = Abi.Function.encodeParams(transferAbi, [recipient, amount])

Branded Types = Type Safety

TypeScript's structural typing lets you pass a Hash where an Address is expected - both are just 0x${string}. Voltaire prevents this entire class of bugs:

// Traditional libraries - compiles fine, breaks at runtime
simulateTransfer(bytecode, address); // Wrong order - TypeScript can't catch it!

// Voltaire - compile-time error
simulateTransfer(bytecode, address);
// Error: Type 'Bytecode' is not assignable to parameter of type 'Address'

Zero runtime overhead. Brands exist only in TypeScript's type checker.

LLM-Optimized

APIs mirror Ethereum specifications. LLMs can leverage training data from official docs instead of learning library-specific abstractions.

  • MCP Server - claude mcp add --transport http voltaire https://voltaire.tevm.sh/mcp
  • Smart detection - Docs return markdown for AI, HTML for humans
  • Eval-tested - Comprehensive test suite validates AI can 1-shot implementations

Multiplatform

Same API across TypeScript, Zig, and C-FFI. Works in Node.js, Bun, browsers, and any language with FFI support.

const Address = @import("primitives").Address;

pub fn main() !void {
    const address = try Address.fromHex("0x742d35Cc6634C0532925a3b844Bc9e7595f51e3e");
    _ = address.toChecksummed();
}

Tree-Shakeable

Data-first design. Import only what you need:

// Import specific functions - excludes unused code from bundle
import { fromHex, toChecksummed } from '@tevm/voltaire/Address'

Get Started

npm install @tevm/voltaire

Three Entrypoints

Voltaire provides three entrypoints with identical APIs:

import { Address, Keccak256 } from '@tevm/voltaire'        // JS (default)
import { Address, Keccak256 } from '@tevm/voltaire/wasm'   // WASM
import { Address, Keccak256 } from '@tevm/voltaire/native' // Native FFI (Bun)

| Entrypoint | Use Case | |------------|----------| | @tevm/voltaire | Universal compatibility - works everywhere | | @tevm/voltaire/wasm | Browser/edge crypto performance | | @tevm/voltaire/native | Maximum performance (Bun only) |

All entrypoints implement the same VoltaireAPI interface - switch by changing the import path.

Documentation | Playground | API Reference | TypeDoc API


What's Included

Primitives

| Primitive | Description | Key Features | | --------- | ----------- | ------------ | | Address | 20-byte Ethereum address | EIP-55 checksums, CREATE/CREATE2 calculation | | Transaction | All transaction types | Legacy, EIP-1559, EIP-4844, EIP-7702 | | ABI | Contract interface encoding | Functions, events, errors, constructors | | RLP | Recursive Length Prefix | Encoding/decoding for Ethereum data structures | | Hex | Hexadecimal encoding | Sized types, manipulation, conversion | | Uint | 256-bit unsigned integer | Wrapping arithmetic, bitwise operations | | Hash | 32-byte hash type | Constant-time operations | | Signature | ECDSA signatures | Secp256k1, P-256, Ed25519 | | Blob | EIP-4844 blob data | 128KB blobs for rollups | | Denomination | Ether denominations | Wei, gwei, ether conversions | | Ens | ENS name normalization | ENSIP-15 normalization | | SIWE | Sign-In with Ethereum | EIP-4361 authentication |

View all 23 primitives →

Cryptography

| Algorithm | Purpose | Key Operations | | --------- | ------- | -------------- | | Keccak256 | Primary Ethereum hash | Address derivation, selectors, topics | | Secp256k1 | ECDSA signing | Sign, verify, recover public key | | EIP-712 | Typed data signing | Domain separation, type hashing | | BN254 | zkSNARK verification | G1/G2 operations, pairing checks | | KZG | EIP-4844 blob commitments | Polynomial commitments, proofs | | BIP-39 | Mnemonic phrases | 12/24-word mnemonics, seed derivation | | HDWallet | HD wallets | BIP-32/44 key derivation |

Hash functions: SHA256, RIPEMD160, Blake2

Elliptic curves: Ed25519, X25519, P256

Encryption: AES-GCM

View all 17 crypto modules →

EVM & Precompiles

Low-level tree-shakable EVM utilities and all 19 precompiled contracts (0x01-0x13).

Precompiles Guide →


Development

  • Install: pnpm install
  • Build: pnpm build (Zig + JS bundles + types)
  • Lint: pnpm lint:check (no warnings) and pnpm format
  • Test: pnpm test:run (single pass) or pnpm test:coverage
  • Package checks: pnpm lint:package

Documentation

  • Docs content lives in docs/ (Mintlify). Docs code samples are validated by tests in docs/**/*.test.ts.
  • API reference is generated from JSDoc/TypeScript via pnpm docs:api and written to docs/generated-api/.
  • TypeDoc Generated API Reference - auto-generated from source.

Security

Cryptography Implementation Status


Language Support

| Language | Status | Installation | | -------- | ------ | ------------ | | TypeScript/JavaScript | Full support | npm install @tevm/voltaire | | Zig | Full support | Build from source | | Swift | C-FFI bindings | See swift/ directory | | Go, Python, Rust, Kotlin | Planned | Contribute → |

All languages can use Voltaire via the C-FFI interface (src/c_api.zig).


Dependencies

TypeScript: @noble/curves, @noble/hashes, @scure/bip32, @scure/bip39, abitype, ox, whatsabi

Native: blst, c-kzg-4844, arkworks


Links

Related projects:


MIT License - see LICENSE