New sections

This commit is contained in:
Eric Lombrozo 2015-12-25 18:57:27 -05:00
parent 0d887af403
commit 84dc2f7ddc

View File

@ -16,8 +16,7 @@ This BIP defines new messages and serialization formats for propagation of trans
==Specification== ==Specification==
=== Serializations === === Serialization ===
A new serialization format for tx messages is added to the peer-to-peer protocol. A new serialization format for tx messages is added to the peer-to-peer protocol.
The serialization has the following structure: The serialization has the following structure:
@ -63,7 +62,7 @@ The serialization has the following structure:
| txouts[] | txouts[]
| A list of one or more transaction outputs | A list of one or more transaction outputs
|- |-
| | 1+
| txin_witness | txin_witness
| txin_witness | txin_witness
| Transaction input witness | Transaction input witness
@ -85,10 +84,7 @@ Witness objects can potentially be extended to contain other kinds of witness da
A script witness is a vector of byte vectors (nominally: the input stack to the program, no longer A script witness is a vector of byte vectors (nominally: the input stack to the program, no longer
encoded as a scriptSig, but just the resulting stack directly). encoded as a scriptSig, but just the resulting stack directly).
as a valid transaction (even if parsing succeeds, it means it's - Rationale for not having an independent message type with
interpreted as a transaction with no inputs and 1 output). If all
witnesses are empty, the old serialization format is used.
- Rationale for not having an independent CWitnessTransaction with
its own serialization: this would require separate "tx" and "block" its own serialization: this would require separate "tx" and "block"
messages, and all RPC calls operating on raw transactions would need messages, and all RPC calls operating on raw transactions would need
to be duplicated, or need inefficinent or nondeterministic guesswork to be duplicated, or need inefficinent or nondeterministic guesswork
@ -100,29 +96,27 @@ used in some tests) to be interpreted as new serialized data.
easily add more extra non-committed data to transactions (like txouts easily add more extra non-committed data to transactions (like txouts
being spent, ...). It can be interpreted as a bitvector. being spent, ...). It can be interpreted as a bitvector.
* A new message 'havewitness' is sent after receiving 'verack' to === Handshake ===
A new message 'havewitness' is sent after receiving 'verack' to
indicate that a node can provide witness if requested (similar to indicate that a node can provide witness if requested (similar to
'sendheaders') 'sendheaders') (Note: it might be better to signal this with a services bit in the version message)
* New inv types MSG_WITNESS_TX and MSG_WITNESS_BLOCK are added, only === Relay ===
New inv types MSG_WITNESS_TX and MSG_WITNESS_BLOCK are added, only
for use in getdata. Inv itself still use just MSG_TX and MSG_BLOCK, for use in getdata. Inv itself still use just MSG_TX and MSG_BLOCK,
similar to MSG_FILTERED_BLOCK. similar to MSG_FILTERED_BLOCK.
- Rationale for not advertizing witnessness in invs: we don't always - Rationale for not advertizing witnessness in invs: we don't always
use invs anymore (with 'sendheaders' BIP 130), plus it's not useful: use invs anymore (with 'sendheaders' BIP 130), plus it's not useful:
implicitly, every transaction and block have a witness, old ones just implicitly, every transaction and block have a witness, old ones just
have empty ones. have empty ones.
* Transactions' GetHash is always computed on the old non-witness === Hashes ===
serialization. A new CTransaction::GetWitnessHash is added which is Transaction hashes used in the transaction merkle tree and txin outpoints is always computed on the old non-witness
serialization. A new hash including the witness data is added that is
computed from the witness-serialization (this means that transactions computed from the witness-serialization (this means that transactions
with an empty witness have witness hash equal to normal hash). with an empty witness have witness hash equal to normal hash).
== Synchronization ==
=== Initial Blockchain Download ===
=== Message Propagation ===
== Credits == == Credits ==
Special thanks to Gregory Maxwell for originating many of the ideas in this BIP and Luke-Jr for figuring out how to deploy this as a soft fork. Special thanks to Gregory Maxwell for originating many of the ideas in this BIP and Luke-Jr for figuring out how to deploy this as a soft fork.