alloy-signer-local
Local signer implementations:
- K256 private key
- Secp256k1 private key (feature-gated)
- Mnemonic phrase
- YubiHSM2
Features
keystore: enables Ethereum keystore functionality on thePrivateKeySignerandSecp256k1Signertypes.mnemonic: enables BIP-39 mnemonic functionality for buildingPrivateKeySigners.secp256k1: enables theSecp256k1Signertype, an alternative signer implementation using thesecp256k1crate instead ofk256.yubihsm: enablesLocalSigners with YubiHSM2 support.
Secp256k1 vs K256
This crate provides two ECDSA implementations:
PrivateKeySigner(default): Uses thek256crate, a pure Rust implementation.Secp256k1Signer(feature-gated): Uses thesecp256k1crate, Rust bindings to libsecp256k1.
Both implementations produce identical signatures and addresses for the same private key. The secp256k1 crate may offer better performance in some scenarios due to its optimized C implementation.