Module key

Expand description

Bitcoin keys.

This module provides keys used in Bitcoin that can be roundtrip (de)serialized.

Structs§

CompressedPublicKey
An always-compressed Bitcoin ECDSA public key
InvalidAddressVersionError
Invalid address version in decoded base58 data.
InvalidBase58PayloadLengthError
Decoded base58 data was an invalid length.
Keypair
Opaque data structure that holds a keypair consisting of a secret and a public key.
PrivateKey
A Bitcoin ECDSA private key
PubkeyHash
A hash of a public key.
PublicKey
A Bitcoin ECDSA public key
Secp256k1
The secp256k1 engine, used to execute all signature operations.
SortKey
An opaque return type for PublicKey::to_sort_key
TweakedKeypair
Tweaked BIP-340 key pair
TweakedPublicKey
Tweaked BIP-340 X-coord-only public key
UncompressedPublicKeyError
Segwit public keys must always be compressed.
WPubkeyHash
SegWit version of a public key hash.
XOnlyPublicKey
An x-only public key, used for verification of Taproot signatures and serialized according to BIP-340.

Enums§

FromSliceError
Error returned while generating key from slice.
FromWifError
Error generated from WIF key format.
Parity
Represents the parity passed between FFI function calls.
ParseCompressedPublicKeyError
Error returned when parsing a CompressedPublicKey from a string.
ParsePublicKeyError
Error returned while constructing public key from string.

Traits§

TapTweak
A trait for tweaking BIP340 key types (x-only public keys and key pairs).
Verification
Marker trait for indicating that an instance of Secp256k1 can be used for verification.

Type Aliases§

UntweakedKeypair
Untweaked BIP-340 key pair
UntweakedPublicKey
Untweaked BIP-340 X-coord-only public key