Skip to content

Commit 6a6c305

Browse files
committed
Merge pull request bitcoin#297 from CodeShark/bip144_edits
Script witness encoding.
2 parents 46a1b4e + ecdfa0a commit 6a6c305

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bip-0144.mediawiki

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ The serialization has the following structure:
6363
| A list of one or more transaction outputs
6464
|-
6565
| 1+
66-
| witness
67-
| witness
66+
| script_witnesses
67+
| script_witnesses[]
6868
| The witness structure as a serialized byte array
6969
|-
7070
| 4
@@ -77,7 +77,7 @@ Parsers supporting this BIP will be able to distinguish between the old serializ
7777

7878
If the witness is empty, the old serialization format should be used.
7979

80-
Witness objects can be extended to contain other kinds of witness data not yet specified. This BIP is agnostic to the witness data structure, defined in [https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki BIP141] (Consensus segwit BIP), and treats it as an arbitrary byte array.
80+
Currently, the only witness objects type supported are script witnesses which consist of a stack of byte arrays. It is encoded as a var_int item count followed by each item encoded as a var_int length followed by a string of bytes. Each txin has its own script witness. The number of script witnesses is not explicitly encoded as it is implied by txin_count. Empty script witnesses are encoded as a zero byte. The order of the script witnesses follows the same order as the associated txins.
8181

8282
* '''Rationale for not having an independent message type with its own serialization''': this would require separate "tx" and "block" messages, and all RPC calls operating on raw transactions would need to be duplicated, or need inefficinent or nondeterministic guesswork to know which type is to be used.
8383

0 commit comments

Comments
 (0)