# README
interpreter
Package interpreter implements the an interpreter for the bitcoin transaction language. There is a comprehensive test suite.
This package has intentionally been designed so it can be used as a standalone package for any projects needing to use or validate bitcoin transaction scripts.
Bitcoin Scripts
Bitcoin provides a stack-based, FORTH-like language for the scripts in the bitcoin transactions. This language is not turing complete although it is still fairly powerful. A description of the language can be found at https://wiki.bitcoinsv.io/index.php/Script
Installation and Updating
$ go get -u github.com/libsv/go-bt/bscript/interpreter
Examples
- Standard Pay-to-pubkey-hash Script
Demonstrates creating a script which pays to a bitcoin address. It also prints the created script hex and uses the DisasmString function to display the disassembled script.
License
Package interpreter is licensed under the copyfree ISC License.
# Packages
No description provided by the author
No description provided by the author
No description provided by the author
# Functions
NewEngine returns a new script engine for the provided locking script (of a previous transaction out), transaction, and input index.
WithAfterGenesis configure the execution to operate in an after-genesis context.
WithDebugger enable execution debugging with the provided configured debugger.
WithFlags configure the execution with the provided flags.
WithForkID configure the execution to allow a tx with a fork id.
WithP2SH configure the execution to allow a P2SH output.
WithScripts configure the execution to run again a set of *bscript.Script.
WithState inject the provided state into the execution thread.
WithTx configure the execution to run again a tx.
# Constants
Tue Nov 5 00:53:20 1985 UTC.
Limits applied to transactions before genesis.
Limits applied to transactions before genesis.
Limits applied to transactions before genesis.
Limits applied to transactions before genesis.
Limits applied to transactions before genesis.
Limits applied to transactions before genesis.
# Structs
DefaultOpcodeParser is a standard parser which can be used from zero value.
ParsedOpcode is a parsed opcode.
State a snapshot of a threads state during execution.
# Interfaces
Debugger implement to enable debugging.
Engine is the virtual machine that executes scripts.
OpcodeParser parses *bscript.Script into a ParsedScript, and unparsing back.
StateHandler interfaces getting and applying state.
# Type aliases
ExecutionOptionFunc for setting execution options.
ParsedScript is a slice of ParsedOp.