Commit 8242a5c
committed
Restructure redeem script to reduce size of redirect & claim txs
Deduplicate the public key used in the claim path of the warning escrow
output redeem script, of the v5 protocol, reducing the size of the
redirect & claim txs by 8 vbytes (32 WUs) each. The claim public key
doubles up as the trader's 2-of-2 multisig public key, used for both the
regular escrow output of the deposit tx and the redirection spend path
of the warning escrow output, so it may be reused through some
manipulation of the bitcoin stack.
Also reverse the order of the buyer & seller pubKeys & signatures, so
that the buyer signature is always higher up in the stack, for
consistency with the deposit tx redeem script.
This leads to the following two warning escrow output redeem scripts,
structured slightly differently:
Buyer's warning escrow output redeem script:
<buyerPubKey> OP_SWAP
OP_IF
2 <sellerPubKey> OP_ROT 2 OP_CHECKMULTISIG
OP_ELSE
<claimDelay> OP_CHECKSEQUENCEVERIFY OP_DROP OP_CHECKSIG
OP_ENDIF
Seller's warning escrow output redeem script:
<sellerPubKey> OP_SWAP
OP_IF
2 OP_SWAP <buyerPubKey> 2 OP_CHECKMULTISIG
OP_ELSE
<claimDelay> OP_CHECKSEQUENCEVERIFY OP_DROP OP_CHECKSIG
OP_ENDIF1 parent 8b9ff7f commit 8242a5c
File tree
3 files changed
+23
-13
lines changed- core/src/main/java/bisq/core
- btc/wallet
- trade/protocol/bisq_v5/model
3 files changed
+23
-13
lines changedLines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
140 | 140 | | |
141 | 141 | | |
142 | 142 | | |
143 | | - | |
144 | | - | |
| 143 | + | |
| 144 | + | |
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| |||
Lines changed: 19 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
141 | 140 | | |
142 | | - | |
143 | | - | |
144 | | - | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
149 | 160 | | |
150 | 161 | | |
151 | 162 | | |
152 | 163 | | |
153 | 164 | | |
154 | | - | |
155 | 165 | | |
156 | 166 | | |
157 | 167 | | |
| |||
Lines changed: 2 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
| 30 | + | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
0 commit comments