Skip to main content

tidecoin_consensus_core/
lib.rs

1// SPDX-License-Identifier: CC0-1.0
2
3//! Shared Tidecoin consensus-validation core types.
4//!
5//! This crate is the shared validation/engine layer used by higher-level
6//! Tidecoin crates.
7//!
8//! In particular, similarly named PQ and validation-side types may exist in
9//! both `tidecoin` and `consensus-core`:
10//!
11//! - `tidecoin::*` is the normal product-facing Rust API
12//! - `consensus-core::*` is the lower-level shared verifier/engine API
13//!
14//! Most downstream application code should start with `tidecoin`. Reach for
15//! `consensus-core` directly when you intentionally need shared validation,
16//! sighash, or lower-level engine building blocks.
17
18#![no_std]
19#![warn(missing_docs)]
20#![warn(deprecated_in_future)]
21#![doc(test(attr(warn(unused))))]
22
23extern crate alloc;
24
25#[cfg(feature = "std")]
26extern crate std;
27
28mod error;
29mod flags;
30mod interpreter;
31mod pq;
32mod sighash;
33mod tx;
34mod verify;
35mod witness;
36
37#[doc(inline)]
38pub use self::error::{ScriptError, TidecoinValidationError};
39#[doc(inline)]
40pub use self::flags::{
41    VERIFY_ALL_TIDECOIN, VERIFY_CHECKLOCKTIMEVERIFY, VERIFY_CHECKSEQUENCEVERIFY, VERIFY_CLEANSTACK,
42    VERIFY_CONST_SCRIPTCODE, VERIFY_DISCOURAGE_UPGRADABLE_NOPS,
43    VERIFY_DISCOURAGE_UPGRADABLE_WITNESS_PROGRAM, VERIFY_MINIMALDATA, VERIFY_MINIMALIF,
44    VERIFY_NONE, VERIFY_NULLDUMMY, VERIFY_NULLFAIL, VERIFY_P2SH, VERIFY_PQ_STRICT, VERIFY_SHA512,
45    VERIFY_SIGPUSHONLY, VERIFY_WITNESS, VERIFY_WITNESS_V1_512,
46};
47#[doc(inline)]
48pub use self::interpreter::{Interpreter, ScriptFlags, ScriptStack, SpendContext};
49#[doc(inline)]
50pub use self::pq::{PqError, PqPublicKey, PqSignature};
51#[doc(inline)]
52pub use self::sighash::{
53    InputsIndexError, LegacySighash, NonStandardSighashTypeError, SegwitV0Sighash, Sighash512,
54    SighashCache, SighashTypeParseError, TxSighashType,
55};
56#[doc(inline)]
57pub use self::tx::{PrecomputedTransactionData, SpentOutputs, TransactionContext};
58#[doc(inline)]
59pub use self::verify::{
60    validate_verification_flags, verify_script_input, verify_script_input_detailed,
61    VerificationFailure,
62};
63#[doc(inline)]
64pub use self::witness::{
65    WitnessExecutionPlan, WitnessProgram, WitnessProgramClass, WitnessSigVersion, WitnessSigops,
66};
67pub use primitives::PqScheme;