Bitmask of SignerCapability flags representing the operations this signer can perform. Lazily computed and cached.
Whether the public key is in compressed SEC1 form.
Network this signer is bound to.
Raw private key bytes, or undefined for public-key-only signers.
SEC1-encoded public key. Lazily derived from the private key when the signer was created via fromPrivateKey or fromWIF.
32-byte BIP-340 x-only public key (lazily derived and cached).
StaticfromCreates a signer from a raw private key.
Cryptographic backend to use.
32-byte secp256k1 private key.
Target network.
Optionaloptions: SignerOptionsOptional settings (e.g. compressed).
StaticfromCreates a public-key-only signer (cannot sign, export WIF, etc.).
Cryptographic backend to use.
SEC1-encoded public key.
Target network.
Optionaloptions: SignerOptionsOptional settings (e.g. compressed).
StaticfromImports a signer from a WIF-encoded private key string.
Cryptographic backend to use.
Base58Check WIF string.
One or more candidate networks whose WIF version byte is matched.
Tests whether this signer has a specific capability.
SignerCapability flag to test.
StaticmakeGenerates a new signer with a random private key.
Uses FIPS 186-5 B.4.2 / RFC 9380 modular reduction:
48 bytes of entropy are reduced via (seed mod (n − 1)) + 1,
producing a key in [1, n) with negligible bias (< 2^−128).
Cryptographic backend to use.
Target network.
Optionaloptions: RandomSignerOptionsOptional settings (rng, compressed).
Produces a compact ECDSA signature.
When lowR is true, grinds the nonce until the R value's first
byte is <= 0x7f, producing a smaller DER encoding.
32-byte message digest.
OptionallowR: booleanEnable low-R grinding. Defaults to false.
Produces a 64-byte BIP-340 Schnorr signature.
32-byte message digest.
Derives a new signer by applying a Taproot-style scalar tweak.
When a private key is available the tweak is applied to the scalar (negating first if the public key has odd Y). Otherwise, only the public key is tweaked via x-only point addition.
32-byte tweak scalar.
Verifies a compact ECDSA signature against this signer's public key.
32-byte message digest.
Compact ECDSA signature.
Verifies a BIP-340 Schnorr signature against this signer's x-only public key.
32-byte message digest.
64-byte Schnorr signature.
Concrete secp256k1 key-pair signer backed by a CryptoBackend.
Instances are created exclusively through the static factory methods (ECPairSigner.fromPrivateKey, ECPairSigner.fromPublicKey, ECPairSigner.fromWIF, ECPairSigner.makeRandom).
Example