Crate bitcoin_keys

Source
Expand description

§Bitcoin keys

Types and traits for managing Bitcoin keys.

§About

The Bitcoin protocol deals with multiple formats and contexts of keys. There are legacy ECDSA keys that may or may not be compressed, X-only (Taproot) keys, private keys, etc. To avoid mixing them, this library provides multiple newtypes and additional infrastructure aiding with conversions, parsing, serializing…

The crate is no_std and doesn’t require an allocator.

Re-exports§

pub use bip340::XOnlyPrivateKey;
pub use bip340::XOnlyKeyPair;
pub use secp256k1;

Modules§

bip340
Keys intended to be used in Schnorr sinatures - in P2TR.
legacy
Types handling ECDSA public keys.

Structs§

Scalar
Positive 256-bit integer guaranteed to be less than the secp256k1 curve order.
XOnlyPublicKey
An x-only public key, used for verification of Schnorr signatures and serialized according to BIP-340.

Type Aliases§

CompressedKeyPair
Key pair that is always serialized as compressed.
CompressedPrivateKey
Private key that is always serialized as compressed.
CompressedPublicKey
Public key that is always serialized as compressed.
LegacyKeyPair
Key pair that may be serialized as uncompressed, used in legacy addresses only.
LegacyPrivateKey
Private key that may be serialized as uncompressed, used in legacy addresses only.
LegacyPublicKey
Public key that may be serialized as uncompressed, used in legacy addresses only.