Interface Signer
- All Known Implementing Classes:
SeedSigner, VaultSigner
public interface Signer
Everything that touches a wallet's private keys, behind one interface. The keys are
addressed by derivation path and never leave the implementation: it answers public keys
and signatures. SeedSigner derives them from a seed in memory; a product with real money
implements this over a hardware device, a vault the user unlocks, or a key service that
holds the keys and logs every signature.
An implementation that cannot do one kind of signature (a cloud KMS with secp256k1 and no
Ed25519, say) throws UnsupportedOperationException from it.
-
Method Summary
Modifier and TypeMethodDescriptionbyte[]The 32-byte Ed25519 public key at a SLIP-10 path; every index is hardened.intThe fingerprint of the BIP-32 master key, which PSBTs record to say whose keys they want.byte[]The compressed 33-byte secp256k1 public key at a BIP-32 path.byte[]signEd25519(DerivationPath path, byte[] message) An Ed25519 signature over a message with the SLIP-10 key at a path.signSecp256k1(DerivationPath path, byte[] hash32) An ECDSA signature over a 32-byte hash with the secp256k1 key at a path: RFC 6979 deterministic, low-S, with its recovery id.byte[]signTaproot(DerivationPath path, byte[] sighash, byte[] merkleRoot) A BIP-340 signature over a 32-byte Taproot sighash with the secp256k1 key at a path, tweaked by BIP-341 formerkleRoot(nullfor a key-path-only output).
-
Method Details
-
getMasterFingerprint
int getMasterFingerprint()The fingerprint of the BIP-32 master key, which PSBTs record to say whose keys they want. -
getSecp256k1PublicKey
The compressed 33-byte secp256k1 public key at a BIP-32 path. -
signSecp256k1
An ECDSA signature over a 32-byte hash with the secp256k1 key at a path: RFC 6979 deterministic, low-S, with its recovery id. -
signTaproot
A BIP-340 signature over a 32-byte Taproot sighash with the secp256k1 key at a path, tweaked by BIP-341 formerkleRoot(nullfor a key-path-only output). -
getEd25519PublicKey
The 32-byte Ed25519 public key at a SLIP-10 path; every index is hardened. -
signEd25519
An Ed25519 signature over a message with the SLIP-10 key at a path.
-