blvm-secp256k1
Pure Rust reimplementation of libsecp256k1 with vendored ASM for hot paths. No FFI to C — all logic in Rust. Performance-optimized secp256k1 for Bitcoin and Ethereum.
Precomputed ecmult tables are committed in src/ecmult_precomputed.rs (no build-time generation). To regenerate: copy precomputed_ecmult.c from upstream libsecp256k1 src/ into build/, then cargo run --example regenerate_precomputed.
Features
- Context-free API — Stateless, no
Secp256k1<C>context. All functions take raw bytes, points, or scalars directly. - Pure Rust + ASM — Field and scalar assembly for ARM32 and x86_64 where it matters; no C dependencies at runtime.
- Parity with libsecp256k1 — ECDSA, Schnorr (BIP 340), MuSig2, ElligatorSwift (BIP 324), ECDH, Taproot.
Installation
[]
= "0.1"
Usage
ECDSA
use ;
use Scalar;
use Gej;
let sk_bytes = ;
let msg_hash = ;
let mut pk_gej = default;
pubkey_from_secret;
let sig = ecdsa_sig_sign.expect;
assert!;
Schnorr (BIP 340)
use ;
let sk = ;
let msg = ;
let pk = xonly_pubkey_from_secret.expect;
let sig = schnorr_sign.expect;
assert!;
License
MIT