<p></p>
<p>Thinking about this further, there is a serious issue that the initial loan/deposit tx would be malleable without using Segwit. So either Alice or Bob (or even a third party) could replace it with an equivalent one with a different ID, invalidating both the prepared repayment and confiscation transactions. Reading about all the various sources of malleability in non-Segwit transactions, I think it would be very difficult to prevent it without completing the upgrade of BitcoinJ to enable the publishing of Segwit transactions from within Bisq. All the loan tx inputs (but not the outputs) would need to have Segwit addresses to prevent malleability, I believe. Luckily, the <em>ANYONECANPAY</em> and <em>SINGLE</em> sighash types still work almost exactly the same way in Segwit scripts, according to BIP-0143, so the protocol should carry over unaltered. Also, I'm fairly sure Segwit BSQ transactions would validate fine in old Bisq clients.</p>
<p>One possible way to mitigate the issue without upgrading BitcoinJ would be to introduce an arbitrator key and make the BSQ collateral UXTO 2-out-of-3 instead of 2-out-of-2. Better I think would be to use a more complicated script which makes the UXTO spendable with either Alice+Bob's signature at any time or Alice/Bob + Arbitator's signature a day or two after the loan expires. That way if the protocol is followed correctly, the loan/deposit tx will have the correct output and the arbitrator will have no control over the funds (even in collusion with Alice or Bob). The abritrator's key would only be used (later) in the event that loan tx was replaced and confirmed with the wrong ID, preventing closure of the loan.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you are subscribed to this thread.<br />Reply to this email directly, <a href="https://github.com/bisq-network/proposals/issues/176#issuecomment-616942709">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AJFFTNSTZFAJ2KUKPPR43TLRNUNMDANCNFSM4KTG56VQ">unsubscribe</a>.<img src="https://github.com/notifications/beacon/AJFFTNVV24HEMR6OYBQTHBTRNUNMDA5CNFSM4KTG56V2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOETC4Y5I.gif" height="1" width="1" alt="" /></p>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/bisq-network/proposals/issues/176#issuecomment-616942709",
"url": "https://github.com/bisq-network/proposals/issues/176#issuecomment-616942709",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
}
]</script>