dcrd/internal/staging/stdscript
Dave Collins a6d266d0b9
stdscript: Add v0 nulldata support.
This adds support for detecting version 0 nulldata scripts as standard.

It should be noted that this code includes a change in the semantics as
compared to the existing code.  In particular, the existing code detects
and treats any type of data push up to the maximum allowed length,
including those that are not canonical, as standard per policy, whereas
this new code further restricts the standardness policy to only treat
nulldata scripts with canonical data pushes up to the maximum allowed
length as standard since they occupy less space on chain and there is
really no good reason for using non-canonical pushes anyway.  In
practice, all known software already only creates canonical pushes and
has since launch.

This does not affect consensus in any way since consensus enforces its
own code related to the associated opcode as required.  Further,
nulldata scripts are unspendable by consensus, so this is purely a
policy change.

Full test coverage is included.

This is part of a series of commits to fully implement the stdscript
package.
2021-06-08 12:20:43 -05:00
..
error_test.go stdscript: Introduce pkg infra for std scripts. 2021-06-08 12:20:31 -05:00
error.go stdscript: Introduce pkg infra for std scripts. 2021-06-08 12:20:31 -05:00
script_bench_test.go stdscript: Add extract v0 multisig redeem benchmark. 2021-06-08 12:20:42 -05:00
script_test.go stdscript: Add v0 nulldata support. 2021-06-08 12:20:43 -05:00
script.go stdscript: Add v0 nulldata support. 2021-06-08 12:20:43 -05:00
scriptshortform_test.go stdscript: Introduce pkg infra for std scripts. 2021-06-08 12:20:31 -05:00
scriptv0_test.go stdscript: Add v0 nulldata support. 2021-06-08 12:20:43 -05:00
scriptv0.go stdscript: Add v0 nulldata support. 2021-06-08 12:20:43 -05:00