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.
- XOnly
Public Key - An x-only public key, used for verification of Schnorr signatures and serialized according to BIP-340.
Type Aliases§
- Compressed
KeyPair - Key pair that is always serialized as compressed.
- Compressed
Private Key - Private key that is always serialized as compressed.
- Compressed
Public Key - Public key that is always serialized as compressed.
- Legacy
KeyPair - Key pair that may be serialized as uncompressed, used in legacy addresses only.
- Legacy
Private Key - Private key that may be serialized as uncompressed, used in legacy addresses only.
- Legacy
Public Key - Public key that may be serialized as uncompressed, used in legacy addresses only.