Skip to main content

bitcoin_bosd/
lib.rs

1//! # Bitcoin Binary Output Script Descriptor (BOSD)
2//!
3//! BOSD uses a simple binary format consisting of
4//! a 1-byte type tag followed by a cryptographic payload.
5//! The format is designed to be compact
6//! and efficiently represent standard Bitcoin output types:
7//!
8//! | Type | Payload Length(s) | Payload Interpretation | Spend Type    | Mainnet Address Prefix |
9//! | ---- | ----------------- | ---------------------- | ------------- | ---------------------- |
10//! | 0    | ..=100_000        | `OP_RETURN` payload    | (N/A)         | (N/A)                  |
11//! | 1    | 20                | Pubkey Hash            | P2PKH         | `1...`                 |
12//! | 2    | 20                | Script Hash            | P2SH          | `3...`                 |
13//! | 3    | 20, 32            | SegWit v0 Hash         | P2WPKH, P2WSH | `bc1q...`              |
14//! | 4    | 0, 32             | SegWit v1 Public Key   | P2A, P2TR     | `bc1p...`              |
15
16#[cfg(feature = "address")]
17pub mod address;
18#[cfg(all(feature = "arbitrary", feature = "address"))]
19pub mod arbitrary;
20#[cfg(feature = "borsh")]
21pub mod borsh;
22pub mod descriptor;
23pub mod error;
24#[cfg(feature = "serde")]
25pub mod serde;
26
27pub use descriptor::{Descriptor, DescriptorType};
28pub use error::DescriptorError;