[bisq-network/bisq] [WIP] Segwit for the trade protocol (#4612)

Oscar Guindzberg notifications at github.com
Thu Oct 22 14:12:50 UTC 2020


@oscarguindzberg commented on this pull request.



> @@ -1181,6 +1181,11 @@ private RawTransactionInput getRawInputFromTransactionInput(@NotNull Transaction
                 "input.getConnectedOutput().getParentTransaction() must not be null");
         checkNotNull(input.getValue(), "input.getValue() must not be null");
 
+        // If we would be sure all bisq nodes migrated to bitcoinj 0.15, bitcoinSerialize(true) can be used.
+        // Since there is no way to check migration to bitcoinj 0.15,
+        // Config.SEGWIT_TRADE_PROTOCOL_ACTIVE could be checked instead.
+        // Actually, given the serialized tx is used just as the connected tx of an input,
+        // we don't need the the connected tx's witness data.

> Isn't the input always from the users own wallet (not the peers input)? If so I don't understand the above comment. Then this code is only execute anyway if the user runs the new version and segwit could be used.

When creating the deposit tx, traders will have a tx with an input from her wallet and an input from the counterparty.  Traders collaborate creating the deposit tx. They send RawTransactionInput over p2p. So, if you are trading with a node that was not upgraded to bitcoinj 0.15 and RawTransactionInput.parentTransaction is serialized with segwit data, the other node won't be able to parse RawTransactionInput.parentTransaction correctly. 
Extra comments:
- RawTransactionInput.parentTransaction could be replaced with RawTransactionInput.parentTransactionHash since the tx is only used to obtain its hash.
- Since we upgraded the trade protocol version, it is not possible to take a trade from a not-upgraded node, but better be on the safe side. This comment made probably more sense for the previous release.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/bisq-network/bisq/pull/4612#discussion_r510195140
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bisq.network/pipermail/bisq-github/attachments/20201022/c268ce2b/attachment.html>


More information about the bisq-github mailing list