ZIP 239: message type -> inv type.

Signed-off-by: Daira Hopwood <daira@jacaranda.org>
This commit is contained in:
Daira Hopwood 2021-05-29 18:01:01 +01:00
parent a756260c05
commit 50e4914b01
2 changed files with 3 additions and 3 deletions

View File

@ -31,7 +31,7 @@ Pull-Request: &lt;<a href="https://github.com/zcash/zips/pull/516">https://githu
<p>For v5 transactions, a new transaction digest algorithm is defined that constructs the txid from a tree of hashes, which include only effecting data <a id="id7" class="footnote_reference" href="#zip-0244">4</a>. Witness data is committed to by a separate "authorizing digest".</p>
<p>Not committing to the witness data in v5 transaction announcements would create inefficiencies: because a v5 transaction's witness can be malleated without altering the txid, a node in receipt of a v5 transaction that the node does not accept would generally still have to download that same transaction when announced by other peers. This is because the alternative — of not downloading a v5 transaction with a given txid after rejecting a previous transaction with that txid — would allow a third party to interfere with transaction relay by malleating a transaction's witness and announcing the resulting invalid transaction to nodes, preventing relay of the valid version of the transaction as well.</p>
<p>This inefficiency was present in Bitcoin for almost 3 years after activation of its Segwit upgrade <a id="id8" class="footnote_reference" href="#bip-0141">8</a>, until the adoption of BIP 339 <a id="id9" class="footnote_reference" href="#bip-0339">9</a>. The latter BIP specifies a way to use the Segwit "wtxid" (which commits to both effecting and witness data) in place of the txid when announcing and fetching transactions. In Zcash, the analogous identifier is the pair (txid, auth_digest).</p>
<p>This ZIP is modelled after BIP 339: it adds a <code>MSG_TXV5</code> message type to the peer-to-peer protocol, analogous to BIP 339's <code>MSG_WTX</code> message type, that announces transactions by their (txid, auth_digest) pair. It does not introduce any equivalent of BIP 339's <code>wtxidrelay</code> message, since that is not needed for compatibility given that Zcash full nodes are required to support <code>MSG_TXV5</code> based on the negotiated peer protocol version (see <a href="#deployment">Deployment</a>).</p>
<p>This ZIP is modelled after BIP 339: it adds a <code>MSG_TXV5</code> inv type to the peer-to-peer protocol, analogous to BIP 339's <code>MSG_WTX</code> inv type, that announces transactions by their (txid, auth_digest) pair. It does not introduce any equivalent of BIP 339's <code>wtxidrelay</code> message, since that is not needed for compatibility given that Zcash full nodes are required to support <code>MSG_TXV5</code> based on the negotiated peer protocol version (see <a href="#deployment">Deployment</a>).</p>
</section>
<section id="specification"><h2><span class="section-heading">Specification</span><span class="section-anchor"> <a rel="bookmark" href="#specification"><img width="24" height="24" src="assets/images/section-anchor.png" alt=""></a></span></h2>
<p>A new inv type <code>MSG_TXV5</code> (0x00000005) is added, for use in both <code>inv</code> messages and <code>getdata</code> requests, indicating that the hash being referenced is the 64-byte value <code>txid</code> || <code>auth_digest</code>. This inv type MUST be used when announcing v5 transactions, and only for such transactions. The <code>txid</code> and <code>auth_digest</code> are as defined in <a id="id10" class="footnote_reference" href="#zip-0244">4</a>.</p>

View File

@ -67,8 +67,8 @@ BIP specifies a way to use the Segwit "wtxid" (which commits to both effecting a
witness data) in place of the txid when announcing and fetching transactions. In Zcash,
the analogous identifier is the pair (txid, auth_digest).
This ZIP is modelled after BIP 339: it adds a ``MSG_TXV5`` message type to the
peer-to-peer protocol, analogous to BIP 339's ``MSG_WTX`` message type, that announces
This ZIP is modelled after BIP 339: it adds a ``MSG_TXV5`` inv type to the
peer-to-peer protocol, analogous to BIP 339's ``MSG_WTX`` inv type, that announces
transactions by their (txid, auth_digest) pair. It does not introduce any equivalent
of BIP 339's ``wtxidrelay`` message, since that is not needed for compatibility given
that Zcash full nodes are required to support ``MSG_TXV5`` based on the negotiated