Expand description
rawtx-rs makes information about Bitcoin transactions accessible.
§Examples
// The first Bitcoin mainnet transaction between Satoshi and Hal
// f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16
// as rust-bitcoin's bitcoin::Transaction.
let tx_info = tx::TxInfo::new(&tx).unwrap();
assert_eq!(tx_info.input_infos[0].in_type, input::InputType::P2pk);
assert_eq!(tx_info.output_infos[0].out_type, output::OutputType::P2pk);
assert_eq!(tx_info.output_infos[1].out_type, output::OutputType::P2pk);
assert!(!tx_info.is_spending_segwit());
assert!(tx_info.is_bip69_compliant());
// Random mainnet transaction spending SegWit and MultiSig
// 7874eb36dfff6d4d38f9dbe013bceed0c31de4da1dee4a507b9abd0540aa0af4
// as rust-bitcoin's bitcoin::Transaction.
let tx_info = tx::TxInfo::new(&tx).unwrap();
assert_eq!(tx_info.input_infos[0].in_type, input::InputType::P2shP2wsh);
assert_eq!(tx_info.output_infos[0].out_type, output::OutputType::P2sh);
assert_eq!(tx_info.output_infos[1].out_type, output::OutputType::P2sh);
assert!(tx_info.is_spending_segwit());
assert!(tx_info.is_bip69_compliant());
assert!(tx_info.is_signaling_explicit_rbf_replicability());
assert!(tx_info.is_spending_multisig());
let multisig_info = tx_info.input_infos[0].multisig_info.as_ref().unwrap();
// 2 of 4 multisig
assert_eq!(multisig_info.m_of_n, (2, 4));
Re-exports§
pub extern crate bitcoin;
Modules§
- Information about Bitcoin transaction inputs.
- Information about Bitcoin transaction outputs.
- Information about Bitcoin PubKeys, Signatures and MultiSig constructs.
- Information about Bitcoin transactions.