diff --git a/zip-0239.html b/zip-0239.html index 9168bffc..c0d7f1ab 100644 --- a/zip-0239.html +++ b/zip-0239.html @@ -31,7 +31,7 @@ Pull-Request: <https://githu

For v5 transactions, a new transaction digest algorithm is defined that constructs the txid from a tree of hashes, which include only effecting data 4. Witness data is committed to by a separate "authorizing digest".

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.

This inefficiency was present in Bitcoin for almost 3 years after activation of its Segwit upgrade 8, until the adoption of BIP 339 9. 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).

-

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 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 peer protocol version (see Deployment).

+

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 peer protocol version (see Deployment).

Specification

A new inv type MSG_TXV5 (0x00000005) is added, for use in both inv messages and getdata requests, indicating that the hash being referenced is the 64-byte value txid || auth_digest. This inv type MUST be used when announcing v5 transactions, and only for such transactions. The txid and auth_digest are as defined in 4.

diff --git a/zip-0239.rst b/zip-0239.rst index 79642406..832cd4a0 100644 --- a/zip-0239.rst +++ b/zip-0239.rst @@ -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