diff options
author | Matt Corallo <git@bluematt.me> | 2016-10-14 10:09:03 -0400 |
---|---|---|
committer | Matt Corallo <git@bluematt.me> | 2016-10-14 10:09:03 -0400 |
commit | 10fcf4ed0db168ee60662fd1bddd4370ec71e6fe (patch) | |
tree | 4effb49e69c6841d996c8ced0c0a19d2e9de8b03 /bip-0152.mediawiki | |
parent | 78cbaca9408ea03470379479b93592b75f9ddc0f (diff) |
Fix a few nits and expand on coinbase short ID calc in ver 2
Diffstat (limited to 'bip-0152.mediawiki')
-rw-r--r-- | bip-0152.mediawiki | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/bip-0152.mediawiki b/bip-0152.mediawiki index cdb55b9..53ccce6 100644 --- a/bip-0152.mediawiki +++ b/bip-0152.mediawiki @@ -149,8 +149,8 @@ A new inv type (MSG_CMPCT_BLOCK == 4) and several new protocol messages are adde # By way of example, an implementation of the above protocol might look like the following. # Upon exchanging version/verack messages, a node immediately sends its list of sendcmpct announcements to the other side, with the version which it wants to receive sent first. # Upon receiving the first sendcmpct announcement with a protocol version which is understood from the remote peer, a node will "lock in" the compact block encoding version which will be used to encode compact blocks to that peer. -# The node then sets the current receive-protocol-version in use on the connection as that version, and uses it to decode new compact block messages. -# Upon receiving subsequent sendcmpct announcements with a protocol version which is understood from the remote peer, a node will check if that protocol version is higher-receive-priority than the current receive-protocol-version in use on the connection, and switch to that version for decoding new compact block messages received. +# The node then sets the current receive-protocol-version in use on the connection to that version, and uses it to decode new compact block messages. +# Upon receiving subsequent sendcmpct announcements with a protocol version which is understood from the remote peer (ie a version which has been announced using a sendcmpct in the other direction), a node will check if that protocol version is higher-receive-priority than the current receive-protocol-version in use on the connection, and switch to that version for decoding new compact block messages received. # A node might wish to keep a flag for each peer which indicates compact block version negotiation is complete, which can be set upon receiving any compact block-related, or pong message. # The above implementation requires only a compile-time list of supported versions in some static priority order, two version fields per peer, and an optional negotiation-complete boolean per-peer. @@ -159,7 +159,7 @@ Compact blocks version 2 is almost identical to version 1, but supports segregat # The second integer (version number) inside sendcmpct is 2 instead of 1 (see Protocol Versioning section, above). # Transactions inside cmpctblock messages (both those used as direct announcement and those in response to getdata) and in blocktxn should include witness data, using the same format as responses to getdata MSG_WITNESS_TX, specified in BIP144. -# Short transaction IDs sent to us in cmpctblock messages, and sent by us in getblocktxn messages, are computed using the same process as in version 1, but using the wtxid as defined in BIP 141 instead of the txid. +# Short transaction IDs sent to us in cmpctblock messages, and sent by us in getblocktxn messages, are computed using the same process as in version 1, but using the wtxid as defined in BIP 141 instead of the txid. Note that, though a node normally SHOULD, if a node does not include (ie must then include the short ID for) the coinbase transaction, it must be computed by encoding the transaction in witness format as defined by BIP 141. # Upon receipt of a getdata containing a request for a MSG_CMPCT_BLOCK object for which a cmpctblock message is not sent in response, the block message containing the requested block in non-compact form MUST be encoded with witnesses (as is sent in reply to a MSG_WITNESS_BLOCK getdata) if the protocol version used to encode the cmpctblock message would have been 2, and encoded without witnesses (as is sent in response to a MSG_BLOCK getdata) if the protocol version used to encode the cmpctblock message would have been 1. ==Implementation Notes== |