crypto-signer
High-performance, low-latency, lightweight multi-chain signing primitives in Rust.
Feature Flags
evm: EIP-712 domain/message signing primitivesbitcoin: Bitcoin module stubssolana: Solana module stubscosmos: Cosmos SignDoc protobuf encoding and SHA-256 signing hashkms: KMS backend extension pointhw: hardware wallet extension pointk256-signer: local secp256k1 signer backended25519-signer: local Ed25519 signer backendserde: serde derivesstd: standard library support
Default features: std, evm, k256-signer.
Specs & Standards
All implementations are spec-driven and validated against official test vectors:
- EIP-712: Official Mail example
- EIP-2612: Permit typehash constant verified against reference implementations
- Cosmos: Protobuf SignDoc SHA-256 signing as per Tendermint/Cosmos SDK
Usage
The core pattern is generic and typestate-driven:
TypedMessage<T, Unsigned>for pre-signingTypedMessage<T, Signed>for post-signingEip712Typeimplemented once per payload type
Each new EIP-712 message requires only a data struct + one trait impl.
Performance
Benchmarks on modern hardware (LTO + fat codegen):
| Operation | Time |
|---|---|
| EIP-712 Permit sign | ~4.7 µs |
| EIP-712 Order sign | ~4.6 µs |
Run locally: cargo bench --bench eip712 --features evm,k256-signer
Quick Start
use ;
let domain = new;
let _unsigned = new
.spender
.value
.nonce
.deadline;
Quality Gates and Getting Started
CI runs on every push:
cargo fmt --check— code stylecargo clippy --all-targets --all-features -- -D warnings— lint warnings deniedcargo test --all-features --all-targets— all tests with all feature combinationscargo check --no-default-features—no_stdcompatibility gatecargo bench --bench eip712— performance regression detectioncargo audit— vulnerability scanningcargo deny check advisories licenses bans sources— supply chain policy enforcementcargo llvm-cov --all-features --summary-only --fail-under-lines 90— code coverage floor at 90%
Buy me a coffee
- ETH/Polygon: 0xCba7FBDe48C6F7A496f7c8304eCB8a813c234C02
- BTC: bc1qf5jenprghcuazckeycx0k3h5hn46a3qetec4m2
- SOL: 9NRLGeyxQA6nJ2b1wkFpJGtQJ7xudFEqthXRKguXzdd4
Thank you!
LICENSE
MIT