Crate breez_sdk_core::bitcoin

Expand description

§Rust Bitcoin Library

This is a library that supports the Bitcoin network protocol and associated primitives. It is designed for Rust programs built to work with the Bitcoin network.

It is also written entirely in Rust to illustrate the benefits of strong type safety, including ownership and lifetime, for financial and/or cryptographic software.

See README.md for detailed documentation about development and supported environments.

§Available feature flags

  • std - the usual dependency on std (default).
  • secp-recovery - enables calculating public key from a signature and message.
  • base64 - (dependency), enables encoding of PSBTs and message signatures.
  • rand - (dependency), makes it more convenient to generate random values.
  • serde - (dependency), implements serde-based serialization and deserialization.
  • secp-lowmemory - optimizations for low-memory devices.
  • no-std - enables additional features required for this crate to be usable without std. Does not disable std. Depends on hashbrown and core2.

Modules§

  • Encoding and decoding of the Bech32 format
  • This project builds the libbitcoinconsensus library from Bitcoin’s C++ sources using Cargo and provides Rust bindings to its API.
  • Bitcoin block data.
  • Bitcoin consensus.
  • Contains error types and other error handling tools.
  • Bitcoin hash types.
  • Bitcoin network support.
  • Bitcoin policy.
  • Utility functions.

Structs§

  • A Bitcoin address.
  • Amount
  • Bitcoin block.
  • A bitcoin block hash.
  • Bitcoin block header.
  • An ECDSA signature with the corresponding hash type.
  • Filter hash, as defined in BIP-157
  • Filter header, as defined in BIP-157
  • Opaque data structure that holds a keypair consisting of a secret and a public key.
  • Data structure that represents a block header paired to a partial merkle tree.
  • A reference to a transaction output.
  • Packed lock time wraps a LockTime consensus value i.e., the raw u32 used by the network.
  • A Bitcoin ECDSA private key
  • A hash of a public key.
  • A Bitcoin ECDSA public key
  • A BIP340-341 serialized schnorr signature with the corresponding hash type.
  • Bitcoin script.
  • A hash of Bitcoin Script bytecode.
  • Bitcoin transaction input sequence number.
  • Hash of the transaction according to the signature algorithm
  • SignedAmount
  • Bitcoin transaction.
  • Bitcoin transaction input.
  • A hash of the Merkle tree branch or root for transactions
  • Bitcoin transaction output.
  • A bitcoin transaction hash/transaction ID.
  • A variable-length unsigned integer
  • SegWit version of a public key hash.
  • SegWit version of a Bitcoin Script bytecode hash.
  • The Witness is the data used to unlock bitcoins since the segwit upgrade
  • A hash corresponding to the witness structure commitment in the coinbase transaction
  • A hash corresponding to the Merkle tree root for witness data
  • A bitcoin witness transaction ID.
  • An x-only public key, used for verification of Schnorr signatures and serialized according to BIP-340.
  • XpubIdentifier as defined in BIP-32.

Enums§

  • The different types of addresses.
  • A set of denominations in which amounts can be expressed.
  • A key-related error.
  • Hashtype of an input’s signature, encoded in the last byte of the signature.
  • A general error code, other errors should implement conversions to/from this if appropriate.
  • A lock time value, representing either a block height or a UNIX timestamp (seconds since epoch).
  • The cryptocurrency to act on
  • A schnorr sig related error.
  • Hashtype of an input’s signature, encoded in the last byte of the signature. Fixed values so they can be cast as integer types for encoding.

Type Aliases§

  • SigHashTypeDeprecated
    Legacy Hashtype of an input’s signature