Crate subcoin_script

Source
Expand description

§Bitcoin Script Interpreter

This crate implements a Bitcoin Script interpreter in Rust. It provides functionality to interpret and evaluate Bitcoin scripts, similar to the Bitcoin Core implementation, but with a focus on readability and compatibility with Rust. Performance optimizations will be pursued in future updates.

§Key Points

  • Some functions are directly ported from Bitcoin Core and may not follow typical Rust idioms. They are intentionally written in a way that is closer to the original C++ code to preserve functionality and logic.

  • Several components, including tests prior to the Taproot upgrade, are ported from the Parity-Bitcoin project to reuse their valuable work for Bitcoin’s older features and standards.

§Caveats

This library is not widely used and lacks comprehensive tests. As a result, never use it for production use! Please use it with caution, and only in non-critical applications or for experimentation purposes.

Structs§

EcdsaSignature
Same semantic with [bitcoin::ecdsa::Signature] with the following differences:
NoSignatureCheck
A SignatureChecker implementation that skips all signature checks.
ScriptExecutionData
TransactionSignatureChecker
A SignatureChecker implementation for transactions.
VerifyFlags
Script verification flags.

Enums§

Error
Script error type.
SigVersion
Represents different signature verification schemes used in Bitcoin
SignatureError
Error types related to signature verification.

Traits§

SignatureChecker
Trait for verifying Bitcoin transaction signatures.

Functions§

verify_script
Verifies the script validity.

Type Aliases§

H256
SchnorrSignature