This will require a new system::config::witness class for parsing/serialization, which will also support a new --witness option for input-set. The system::chain::witness class already incorporates a canonical textual serialization (as bracketed base16-encoded data tokens) and wire encoding with optional prefix (variable integer element count). This should be extended to include a from_string(...) method for parsing the canonical textual serialization.
A transaction incorporates an optional witness stack. These commands will support just one element of that stack and as such require no prefix (element count). The prefix is not allowed when encoding. The prefix should be made a flag (option) when decoding, defaulted to true as this is considered part of the witness. Each token is variable integer byte-prefixed as well.
This will require a new
system::config::witnessclass for parsing/serialization, which will also support a new--witnessoption forinput-set. The system::chain::witness class already incorporates a canonical textual serialization (as bracketed base16-encoded data tokens) and wire encoding with optional prefix (variable integer element count). This should be extended to include afrom_string(...)method for parsing the canonical textual serialization.A transaction incorporates an optional witness stack. These commands will support just one element of that stack and as such require no prefix (element count). The prefix is not allowed when encoding. The prefix should be made a flag (option) when decoding, defaulted to
trueas this is considered part of the witness. Each token is variable integer byte-prefixed as well.