Skip to main content

causeway_btc/
lib.rs

1//! Causeway off-chain helpers for Bitcoin.
2//!
3//! - [`address`] — P2TR vault address (Causeway tweak ∘ BIP-341 TapTweak)
4//! - [`tx`] — unsigned tx + sighash construction
5//! - [`sign`] — splice the threshold Schnorr signature into the witness
6
7#![forbid(unsafe_code)]
8
9pub mod address;
10pub mod tx;
11pub mod sign;
12
13#[derive(thiserror::Error, Debug)]
14pub enum BtcError {
15    #[error("derivation: {0}")]
16    Derivation(#[from] causeway_derive::tweak::TweakError),
17    #[error("invalid signature length: expected 64 bytes, got {0}")]
18    InvalidSignatureLength(usize),
19    #[error("bitcoin: {0}")]
20    Bitcoin(String),
21}