1
0
Fork 0
mirror of https://github.com/bitcoin/bips.git synced 2025-03-03 10:47:00 +01:00

Use abstract witness structure

This commit is contained in:
Eric Lombrozo 2015-12-25 19:56:11 -05:00
parent 1f538fd458
commit 35990e2faa

View file

@ -63,9 +63,9 @@ The serialization has the following structure:
| A list of one or more transaction outputs
|-
| 1+
| txin_witnesses
| txin_witnesses[]
| A list of one or more transaction input witnesses (note: the count is just txin_count)
| witness
| witness
| The witness structure as a serialized byte array
|-
| 4
| lock_time
@ -73,9 +73,9 @@ The serialization has the following structure:
| The block number or timestamp until which the transaction is locked
|}
Parsers supporting this BIP will be able to distinguish between the old serialization format (without the witnesses) and this one. The marker byte is set to zero so that this structure will never parse as a valid transaction in a parser that does not support this BIP. If parsing were to succeeded, such a transaction would contain no inputs and a single output.
Parsers supporting this BIP will be able to distinguish between the old serialization format (without the witness) and this one. The marker byte is set to zero so that this structure will never parse as a valid transaction in a parser that does not support this BIP. If parsing were to succeeded, such a transaction would contain no inputs and a single output.
If all witnesses are empty, the old serialization format should be used.
If the witness is empty, the old serialization format should be used.
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 BIPxxxx (Consensus Segwit BIP), and treats it as an arbitrary byte array.