This modifies the encoding logic for script numbers to support encoding min int64s. This was previously not supported since the type was not public and it is not possible to achieve a min int64 within the context of the script system itself due to the strict limits it imposes. However, now that script numbers are exported for external use and callers are not bound by the aforementioned strictness, it should be possible to encode the entire range for completeness. In practice, callers should never realistically need to encode the value since the purpose of the type is to create encoded numbers for scripts and the value in question will be rejected upon any attempt to use it as a number when verifying scripts given it is out of range. |
||
|---|---|---|
| .. | ||
| data | ||
| sign | ||
| stdaddr | ||
| stdscript | ||
| bench_test.go | ||
| consensus_test.go | ||
| consensus.go | ||
| doc.go | ||
| engine_test.go | ||
| engine.go | ||
| error_test.go | ||
| error.go | ||
| example_test.go | ||
| go.mod | ||
| go.sum | ||
| log.go | ||
| opcode_test.go | ||
| opcode.go | ||
| README.md | ||
| reference_test.go | ||
| script_test.go | ||
| script.go | ||
| scriptbuilder_test.go | ||
| scriptbuilder.go | ||
| scriptnum_test.go | ||
| scriptnum.go | ||
| scriptshortform_test.go | ||
| sigcache_test.go | ||
| sigcache.go | ||
| sighash_test.go | ||
| sighash.go | ||
| stack_test.go | ||
| stack.go | ||
| tokenizer_test.go | ||
| tokenizer.go | ||
txscript
Package txscript implements the Decred transaction script 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 Decred transaction scripts.
Decred Scripts
Decred provides a stack-based, FORTH-like language for the scripts in the Decred transactions. This language is not Turing complete although it is still fairly powerful.
Installation and Updating
This package is part of the github.com/decred/dcrd/txscript/v3 module. Use
the standard go tooling for working with modules to incorporate it.
Examples
- Counting Opcodes in Scripts Demonstrates creating a script tokenizer instance and using it to count the number of opcodes a script contains.
License
Package txscript is licensed under the copyfree ISC License.