Expand description
Script opcodes and interpreter
§Examples
Evaluate a script that divides two numbers:
use bch::script::op_codes::*;
use bch::script::{Script, TransactionlessChecker};
let mut script = Script::new();
script.append(OP_10);
script.append(OP_5);
script.append(OP_DIV);
script.eval(&mut TransactionlessChecker {}).unwrap();
Modules§
- op_
codes - Script commands
Structs§
- Script
- Transaction script
- Transaction
Checker - Checks that external values in a script are correct for a specific transaction spend
- Transactionless
Checker - Script checker that fails all transaction checks
Constants§
- MAX_
OPS_ PER_ SCRIPT - Maximum number of non-push operations per script
- MAX_
PUBKEYS_ PER_ MULTISIG - Maximum number of multisig keys
- MAX_
SCRIPT_ ELEMENT_ SIZE - Maximum number of bytes pushable to the stack
- MAX_
SCRIPT_ SIZE - Maximum script length in bytes
Traits§
- Checker
- Checks that external values are correct in the script