bitcoin_rs_script/lib.rs
1//! Script verification, sigop counting, sighash caching, and taproot helpers.
2//!
3//! ## V1 implementation note
4//!
5//! Per-script execution delegates to `bitcoin::Script::verify_with_flags`
6//! (Core's canonical Rust port, audited). The hand-rolled per-opcode dispatcher
7//! from PLAN.md Task 3 Step 2 is a follow-up: when introduced, it lives behind
8//! a `hand-rolled` cargo feature and is gated by a parity-vs-bitcoin-crate test.
9//! Public surface is stable across the swap.
10
11#![forbid(unsafe_op_in_unsafe_fn)]
12
13/// Rayon-backed Schnorr verification helpers.
14pub mod batch;
15/// Script verification wrapper.
16pub mod interpreter;
17/// Opcode re-exports and local opcode newtype.
18pub mod opcodes;
19/// Signature hash cache wrapper.
20pub mod sighash_cache;
21/// Signature operation counters.
22pub mod sigops;
23/// Bounded stack infrastructure for the future hand-rolled interpreter.
24pub mod stack;
25/// Taproot verification helpers.
26pub mod taproot;
27
28pub use interpreter::{Interpreter, ScriptError, VerifyFlags};
29pub use stack::{ScriptItem, Stack, StackError};
30
31/// Borrowed script type from the `bitcoin` crate.
32pub type Script = bitcoin::Script;
33/// Owned script buffer from the `bitcoin` crate.
34pub type ScriptBuf = bitcoin::ScriptBuf;
35/// Project transaction wrapper.
36pub type Tx = bitcoin_rs_primitives::Tx;
37/// Canonical transaction output type.
38pub type TxOut = bitcoin_rs_primitives::TxOut;