Convenience struct pairing a BSV.PrivateKey with its corresponding BSV.PublicKey.
Example
kp = BSV.KeyPair.new()
kp.privkey #=> %BSV.PrivateKey{...}
kp.pubkey #=> %BSV.PublicKey{...}
# From an existing private key
kp = BSV.KeyPair.from_private_key(privkey)
Summary
Functions
Build a key pair from an existing private key.
Generate a new random key pair.
Return the compressed public key bytes (33 bytes).
Return the 20-byte public key hash (HASH160).
Types
@type t() :: %BSV.KeyPair{privkey: BSV.PrivateKey.t(), pubkey: BSV.PublicKey.t()}
Functions
@spec from_private_key(BSV.PrivateKey.t()) :: t()
Build a key pair from an existing private key.
@spec new() :: t()
Generate a new random key pair.
Return the compressed public key bytes (33 bytes).
@spec pubkey_hash(t()) :: <<_::160>>
Return the 20-byte public key hash (HASH160).