doc: Describe reverse adaptor sig protocol.

This commit is contained in:
tecnovert 2023-07-06 15:13:19 +02:00
parent f6fb11f452
commit be46d8a7bd
No known key found for this signature in database
GPG key ID: 8ED6D8750C4E3F93
19 changed files with 1182 additions and 61 deletions

View file

@ -1,3 +1,3 @@
name = "basicswap"
__version__ = "0.11.63"
__version__ = "0.11.64"

View file

@ -2515,7 +2515,7 @@ class BasicSwap(BaseApp):
session.close()
session.remove()
self.log.info('Sent XMR_BID_FL %s', xmr_swap.bid_id.hex())
self.log.info('Sent ADS_BID_LF %s', xmr_swap.bid_id.hex())
return xmr_swap.bid_id
msg_buf = XmrBidMessage()
@ -4100,15 +4100,14 @@ class BasicSwap(BaseApp):
try:
ci_part = self.ci(Coins.PART)
rpc_conn = ci_part.open_rpc()
now: int = self.getTime()
options = {'encoding': 'none'}
ro = ci_part.json_request(rpc_conn, 'smsginbox', ['all', '', options])
num_messages = 0
num_removed = 0
for msg in ro['messages']:
num_messages: int = 0
num_removed: int = 0
def remove_if_expired(msg):
nonlocal num_messages, num_removed
try:
num_messages += 1
expire_at = msg['sent'] + msg['ttl']
expire_at: int = msg['sent'] + msg['ttl']
if expire_at < now:
options = {'encoding': 'none', 'delete': True}
del_msg = ci_part.json_request(rpc_conn, 'smsg', [msg['msgid'], options])
@ -4116,7 +4115,15 @@ class BasicSwap(BaseApp):
except Exception as e:
if self.debug:
self.log.error(traceback.format_exc())
continue
now: int = self.getTime()
options = {'encoding': 'none'}
inbox_messages = ci_part.json_request(rpc_conn, 'smsginbox', ['all', '', options])['messages']
for msg in inbox_messages:
remove_if_expired(msg)
outbox_messages = ci_part.json_request(rpc_conn, 'smsgoutbox', ['all', '', options])['messages']
for msg in outbox_messages:
remove_if_expired(msg)
if num_messages + num_removed > 0:
self.log.info('Expired {} / {} messages.'.format(num_removed, num_messages))
@ -4481,15 +4488,23 @@ class BasicSwap(BaseApp):
self.log.debug('Evaluating against strategy {}'.format(strategy.record_id))
if not offer.amount_negotiable:
if bid.amount != offer.amount_from:
raise AutomationConstraint('Need exact amount match')
if reverse_bid:
if abs(bid_amount - offer.amount_from) >= 20: # TODO: Tolerance?
raise AutomationConstraint('Need exact amount match')
else:
if bid_amount != offer.amount_from:
raise AutomationConstraint('Need exact amount match')
if bid_amount < offer.min_bid_amount:
raise AutomationConstraint('Bid amount below offer minimum')
if opts.get('exact_rate_only', False) is True:
if bid_rate != offer.rate:
raise AutomationConstraint('Need exact rate match')
if reverse_bid:
if abs(bid_rate - offer.rate) >= 20: # TODO: Tolerance?
raise AutomationConstraint('Need exact rate match')
else:
if bid_rate != offer.rate:
raise AutomationConstraint('Need exact rate match')
active_bids, total_bids_value = self.getCompletedAndActiveBidsValue(offer, use_session)

View file

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View file

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

View file

@ -0,0 +1,391 @@
<svg xmlns="http://www.w3.org/2000/svg" id="mscgenjsreplaceme" width="1264" height="1971.25" class="mscgenjsreplaceme" style="font-family:Helvetica,sans-serif;font-size:12px;font-weight:400;font-style:normal;text-decoration:none;background-color:#fff;stroke:#000;stroke-width:2" version="1.1">
<defs>
<marker id="mscgenjsreplacemecallback-#0000FF" class="arrow-marker" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="9" refY="3" viewBox="0 0 10 10">
<path d="m1 1 8 2-8 2" class="arrow-style" style="stroke-dasharray:100,1;stroke:#00f"/>
</marker>
<marker id="mscgenjsreplacemecallback-l-#0000FF" class="arrow-marker" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="9" refY="3" viewBox="0 0 10 10">
<path d="M17 1 9 3l8 2" class="arrow-style" style="stroke-dasharray:100,1;stroke:#00f"/>
</marker>
<marker id="mscgenjsreplacemecallback-#008800" class="arrow-marker" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="9" refY="3" viewBox="0 0 10 10">
<path d="m1 1 8 2-8 2" class="arrow-style" style="stroke-dasharray:100,1;stroke:#080"/>
</marker>
<marker id="mscgenjsreplacemecallback-l-#008800" class="arrow-marker" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="9" refY="3" viewBox="0 0 10 10">
<path d="M17 1 9 3l8 2" class="arrow-style" style="stroke-dasharray:100,1;stroke:#080"/>
</marker>
<marker id="mscgenjsreplacemecallback-#FF0000" class="arrow-marker" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="9" refY="3" viewBox="0 0 10 10">
<path d="m1 1 8 2-8 2" class="arrow-style" style="stroke-dasharray:100,1;stroke:red"/>
</marker>
<marker id="mscgenjsreplacemecallback-l-#FF0000" class="arrow-marker" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="9" refY="3" viewBox="0 0 10 10">
<path d="M17 1 9 3l8 2" class="arrow-style" style="stroke-dasharray:100,1;stroke:red"/>
</marker>
<marker id="mscgenjsreplacememethod-#0000FF" class="arrow-marker" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="9" refY="3" viewBox="0 0 10 10">
<path fill="#00F" stroke="#00F" d="m1 1 8 2-8 2z" class="arrow-style"/>
</marker>
<marker id="mscgenjsreplacememethod-l-#0000FF" class="arrow-marker" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="9" refY="3" viewBox="0 0 10 10">
<path fill="#00F" stroke="#00F" d="M17 1 9 3l8 2z" class="arrow-style"/>
</marker>
<marker id="mscgenjsreplacememethod-#FF0000" class="arrow-marker" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="9" refY="3" viewBox="0 0 10 10">
<path fill="red" stroke="red" d="m1 1 8 2-8 2z" class="arrow-style"/>
</marker>
<marker id="mscgenjsreplacememethod-l-#FF0000" class="arrow-marker" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="9" refY="3" viewBox="0 0 10 10">
<path fill="red" stroke="red" d="M17 1 9 3l8 2z" class="arrow-style"/>
</marker>
<style>
.mscgenjsreplaceme path,.mscgenjsreplaceme rect{fill:none}.mscgenjsreplaceme .label-text-background{fill:#fff;stroke:#fff;stroke-width:0}.mscgenjsreplaceme .return{stroke-dasharray:5,3}.mscgenjsreplaceme text{color:inherit;stroke:none;text-anchor:middle}.mscgenjsreplaceme text.anchor-start{text-anchor:start}.mscgenjsreplaceme .arrow-marker{overflow:visible}.mscgenjsreplaceme .arrow-style{stroke-width:1}.mscgenjsreplaceme .arcrow{stroke-linecap:butt}.mscgenjsreplaceme .box,.mscgenjsreplaceme .entity{fill:#fff;stroke-linejoin:round}
</style>
</defs>
<g id="mscgenjsreplaceme_body" transform="translate(47 3)">
<path id="mscgenjsreplaceme_background" d="M-47-3h1264v1971.25H-47z" class="bglayer" style="fill:#fff;stroke:#fff;stroke-width:0"/>
<path id="mscgenjsreplaceme_arcspans" d="M-39 816.05h1040v1130.2H-39z" class="box inline_expression alt"/>
<g id="mscgenjsreplaceme_lifelines">
<path d="M65 38v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 38v38" class="arcrow" style="stroke:#080"/>
<path d="M481 38v38" class="arcrow" style="stroke:red"/>
<path d="M689 38v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 38v38M1105 38v38M65 76v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 76v38" class="arcrow" style="stroke:#080"/>
<path d="M481 76v38" class="arcrow" style="stroke:red"/>
<path d="M689 76v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 76v38M1105 76v38M65 114v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 114v38" class="arcrow" style="stroke:#080"/>
<path d="M481 114v38" class="arcrow" style="stroke:red"/>
<path d="M689 114v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 114v38M1105 114v38M65 152v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 152v38" class="arcrow" style="stroke:#080"/>
<path d="M481 152v38" class="arcrow" style="stroke:red"/>
<path d="M689 152v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 152v38M1105 152v38M65 190v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 190v38" class="arcrow" style="stroke:#080"/>
<path d="M481 190v38" class="arcrow" style="stroke:red"/>
<path d="M689 190v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 190v38M1105 190v38M65 228v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 228v38" class="arcrow" style="stroke:#080"/>
<path d="M481 228v38" class="arcrow" style="stroke:red"/>
<path d="M689 228v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 228v38M1105 228v38M65 266v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 266v38" class="arcrow" style="stroke:#080"/>
<path d="M481 266v38" class="arcrow" style="stroke:red"/>
<path d="M689 266v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 266v38M1105 266v38M65 304v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 304v38" class="arcrow" style="stroke:#080"/>
<path d="M481 304v38" class="arcrow" style="stroke:red"/>
<path d="M689 304v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 304v38M1105 304v38M65 342v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 342v38" class="arcrow" style="stroke:#080"/>
<path d="M481 342v38" class="arcrow" style="stroke:red"/>
<path d="M689 342v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 342v38M1105 342v38M65 380v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 380v38" class="arcrow" style="stroke:#080"/>
<path d="M481 380v38" class="arcrow" style="stroke:red"/>
<path d="M689 380v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 380v38M1105 380v38M65 418v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 418v38" class="arcrow" style="stroke:#080"/>
<path d="M481 418v38" class="arcrow" style="stroke:red"/>
<path d="M689 418v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 418v38M1105 418v38M65 456v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 456v38" class="arcrow" style="stroke:#080"/>
<path d="M481 456v38" class="arcrow" style="stroke:red"/>
<path d="M689 456v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 456v38M1105 456v38M65 494v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 494v38" class="arcrow" style="stroke:#080"/>
<path d="M481 494v38" class="arcrow" style="stroke:red"/>
<path d="M689 494v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 494v38M1105 494v38M65 532v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 532v38" class="arcrow" style="stroke:#080"/>
<path d="M481 532v38" class="arcrow" style="stroke:red"/>
<path d="M689 532v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 532v38M1105 532v38M65 570v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 570v38" class="arcrow" style="stroke:#080"/>
<path d="M481 570v38" class="arcrow" style="stroke:red"/>
<path d="M689 570v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 570v38M1105 570v38M65 608v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 608v38" class="arcrow" style="stroke:#080"/>
<path d="M481 608v38" class="arcrow" style="stroke:red"/>
<path d="M689 608v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 608v38M1105 608v38M65 646v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 646v38" class="arcrow" style="stroke:#080"/>
<path d="M481 646v38" class="arcrow" style="stroke:red"/>
<path d="M689 646v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 646v38M1105 646v38M65 684v75.05" class="arcrow" style="stroke:transparent"/>
<path d="M273 684v75.05" class="arcrow" style="stroke:#080"/>
<path d="M481 684v75.05" class="arcrow" style="stroke:red"/>
<path d="M689 684v75.05" class="arcrow" style="stroke:#00f"/>
<path d="M897 684v75.05M1105 684v75.05M65 759.05v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 759.05v38" class="arcrow" style="stroke:#080"/>
<path d="M481 759.05v38" class="arcrow" style="stroke:red"/>
<path d="M689 759.05v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 759.05v38M1105 759.05v38M65 797.05v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 797.05v38" class="arcrow" style="stroke:#080"/>
<path d="M481 797.05v38" class="arcrow" style="stroke:red"/>
<path d="M689 797.05v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 797.05v38M1105 797.05v38M65 835.05v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 835.05v38" class="arcrow" style="stroke:#080"/>
<path d="M481 835.05v38" class="arcrow" style="stroke:red"/>
<path d="M689 835.05v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 835.05v38M1105 835.05v38M65 873.05v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 873.05v38" class="arcrow" style="stroke:#080"/>
<path d="M481 873.05v38" class="arcrow" style="stroke:red"/>
<path d="M689 873.05v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 873.05v38M1105 873.05v38M65 911.05v75.05" class="arcrow" style="stroke:transparent"/>
<path d="M273 911.05v75.05" class="arcrow" style="stroke:#080"/>
<path d="M481 911.05v75.05" class="arcrow" style="stroke:red"/>
<path d="M689 911.05v75.05" class="arcrow" style="stroke:#00f"/>
<path d="M897 911.05v75.05M1105 911.05v75.05M65 986.1v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 986.1v38" class="arcrow" style="stroke:#080"/>
<path d="M481 986.1v38" class="arcrow" style="stroke:red"/>
<path d="M689 986.1v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 986.1v38M1105 986.1v38M65 1024.1v86" class="arcrow" style="stroke:transparent"/>
<path d="M273 1024.1v86" class="arcrow" style="stroke:#080"/>
<path d="M481 1024.1v86" class="arcrow" style="stroke:red"/>
<path d="M689 1024.1v86" class="arcrow" style="stroke:#00f"/>
<path d="M897 1024.1v86M1105 1024.1v86M65 1110.1v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1110.1v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1110.1v38" class="arcrow" style="stroke:red"/>
<path d="M689 1110.1v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1110.1v38M1105 1110.1v38M65 1148.1v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1148.1v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1148.1v38" class="arcrow" style="stroke:red"/>
<path d="M689 1148.1v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1148.1v38M1105 1148.1v38M65 1186.1v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1186.1v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1186.1v38" class="arcrow" style="stroke:red"/>
<path d="M689 1186.1v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1186.1v38M1105 1186.1v38M65 1224.1v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1224.1v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1224.1v38" class="arcrow" style="stroke:red"/>
<path d="M689 1224.1v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1224.1v38M1105 1224.1v38M65 1262.1v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1262.1v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1262.1v38" class="arcrow" style="stroke:red"/>
<path d="M689 1262.1v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1262.1v38M1105 1262.1v38M65 1300.1v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1300.1v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1300.1v38" class="arcrow" style="stroke:red"/>
<path d="M689 1300.1v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1300.1v38M1105 1300.1v38M65 1338.1v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1338.1v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1338.1v38" class="arcrow" style="stroke:red"/>
<path d="M689 1338.1v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1338.1v38M1105 1338.1v38M65 1376.1v75.05" class="arcrow" style="stroke:transparent"/>
<path d="M273 1376.1v75.05" class="arcrow" style="stroke:#080"/>
<path d="M481 1376.1v75.05" class="arcrow" style="stroke:red"/>
<path d="M689 1376.1v75.05" class="arcrow" style="stroke:#00f"/>
<path d="M897 1376.1v75.05M1105 1376.1v75.05M65 1451.15v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1451.15v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1451.15v38" class="arcrow" style="stroke:red"/>
<path d="M689 1451.15v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1451.15v38M1105 1451.15v38M65 1489.15v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1489.15v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1489.15v38" class="arcrow" style="stroke:red"/>
<path d="M689 1489.15v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1489.15v38M1105 1489.15v38M65 1527.15v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1527.15v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1527.15v38" class="arcrow" style="stroke:red"/>
<path d="M689 1527.15v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1527.15v38M1105 1527.15v38M65 1565.15v75.05" class="arcrow" style="stroke:transparent"/>
<path d="M273 1565.15v75.05" class="arcrow" style="stroke:#080"/>
<path d="M481 1565.15v75.05" class="arcrow" style="stroke:red"/>
<path d="M689 1565.15v75.05" class="arcrow" style="stroke:#00f"/>
<path d="M897 1565.15v75.05M1105 1565.15v75.05M65 1640.2v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1640.2v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1640.2v38" class="arcrow" style="stroke:red"/>
<path d="M689 1640.2v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1640.2v38M1105 1640.2v38M65 1678.2v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1678.2v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1678.2v38" class="arcrow" style="stroke:red"/>
<path d="M689 1678.2v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1678.2v38M1105 1678.2v38M65 1716.2v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1716.2v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1716.2v38" class="arcrow" style="stroke:red"/>
<path d="M689 1716.2v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1716.2v38M1105 1716.2v38M65 1754.2v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1754.2v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1754.2v38" class="arcrow" style="stroke:red"/>
<path d="M689 1754.2v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1754.2v38M1105 1754.2v38M65 1792.2v59.05" class="arcrow" style="stroke:transparent"/>
<path d="M273 1792.2v59.05" class="arcrow" style="stroke:#080"/>
<path d="M481 1792.2v59.05" class="arcrow" style="stroke:red"/>
<path d="M689 1792.2v59.05" class="arcrow" style="stroke:#00f"/>
<path d="M897 1792.2v59.05M1105 1792.2v59.05M65 1851.25v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1851.25v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1851.25v38" class="arcrow" style="stroke:red"/>
<path d="M689 1851.25v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1851.25v38M1105 1851.25v38M65 1889.25v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1889.25v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1889.25v38" class="arcrow" style="stroke:red"/>
<path d="M689 1889.25v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1889.25v38M1105 1889.25v38M65 1927.25v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1927.25v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1927.25v38" class="arcrow" style="stroke:red"/>
<path d="M689 1927.25v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1927.25v38M1105 1927.25v38" class="arcrow" style="stroke:transparent"/>
</g>
<g id="mscgenjsreplaceme_sequence">
<path d="M0 0h130v38H0z" class="entity" style="stroke:transparent"/>
<text x="65" y="22.75" class="entity-text"><tspan> </tspan></text>
<path d="M208 0h130v38H208z" class="entity" style="fill:#cfc;stroke:#080"/>
<text x="273" y="22.75" class="entity-text"><tspan>Network</tspan></text>
<path d="M416 0h130v38H416z" class="entity" style="fill:#fcc;stroke:red"/>
<text x="481" y="22.75" class="entity-text"><tspan>Offerer</tspan></text>
<path d="M624 0h130v38H624z" class="entity" style="fill:#ccf;stroke:#00f"/>
<text x="689" y="22.75" class="entity-text"><tspan>Bidder</tspan></text>
<path d="M832 0h130v38H832z" class="entity" style="stroke:transparent"/>
<text x="897" y="22.75" class="entity-text"><tspan> </tspan></text>
<path d="M1040 0h130v38h-130z" class="entity" style="stroke:transparent"/>
<text x="1105" y="22.75" class="entity-text"><tspan> </tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#FF0000)" d="M481 95H273" class="arc directional callback" style="stroke:red"/>
<path d="M345.09 79.25h63.83v14h-63.83z" class="label-text-background"/>
<text x="377" y="90.25" class="directional-text callback-text"><tspan>Sends Offer</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#008800)" d="M273 133h416" class="arc directional return" style="stroke:#080"/>
<path d="M445.76 117.25h70.48v14h-70.48z" class="label-text-background"/>
<text x="481" y="128.25" class="directional-text return-text"><tspan>Detects Offer</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#0000FF)" d="M689 171H481" class="arc directional callback" style="stroke:#00f"/>
<path d="M516.62 155.25H653.7v14H516.62z" class="label-text-background"/>
<text x="585" y="166.25" class="directional-text callback-text"><tspan>Sends BidIntent message</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#FF0000)" d="M481 285h208" class="arc directional callback" style="stroke:red"/>
<path d="M498.28 269.25h173.76v14H498.28z" class="label-text-background"/>
<text x="585" y="280.25" class="directional-text callback-text"><tspan>Sends BidIntentAccept message</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#0000FF)" d="M689 361H481" class="arc directional callback" style="stroke:#00f"/>
<path d="M513.29 345.25h143.74v14H513.29z" class="label-text-background"/>
<text x="585" y="356.25" class="directional-text callback-text"><tspan>Sends BidAccept message</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#FF0000)" d="M481 437h208" class="arc directional callback" style="stroke:red"/>
<path d="M491.29 421.25h187.74v14H491.29z" class="label-text-background"/>
<text x="585" y="432.25" class="directional-text callback-text"><tspan>Sends XmrBidLockTxSigsMessage</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#0000FF)" d="M689 513H273" class="arc directional callback" style="stroke:#00f"/>
<path d="M415.64 497.25h130.72v14H415.64z" class="label-text-background"/>
<text x="481" y="508.25" class="directional-text callback-text"><tspan>Sends script-coin-lock-tx</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#0000FF)" d="M689 589H481" class="arc directional callback" style="stroke:#00f"/>
<path d="M485.61 573.25H684.7v14H485.61z" class="label-text-background"/>
<text x="585" y="584.25" class="directional-text callback-text"><tspan>Sends XmrBidLockSpendTxMessage</tspan></text>
<path marker-end="url(#mscgenjsreplacememethod-#FF0000)" d="M481 713.92c104 .1 104 22.8 0 22.8" class="arc directional method" style="stroke:red"/>
<path d="M484 665.67h40.91v14H484z" class="label-text-background"/>
<text x="484" y="676.67" class="directional-text method-text anchor-start"><tspan>Wait for</tspan></text>
<path d="M484 681.67h107.01v14H484z" class="label-text-background"/>
<text x="484" y="692.67" class="directional-text method-text anchor-start"><tspan>script-coin-lock-tx to</tspan></text>
<path d="M484 697.67h39.34v14H484z" class="label-text-background"/>
<text x="484" y="708.67" class="directional-text method-text anchor-start"><tspan>confirm</tspan></text>
<path marker-end="url(#mscgenjsreplacememethod-#0000FF)" d="M689 713.92c104 .1 104 22.8 0 22.8" class="arc directional method" style="stroke:#00f"/>
<path d="M692 665.67h40.91v14H692z" class="label-text-background"/>
<text x="692" y="676.67" class="directional-text method-text anchor-start"><tspan>Wait for</tspan></text>
<path d="M692 681.67h107.01v14H692z" class="label-text-background"/>
<text x="692" y="692.67" class="directional-text method-text anchor-start"><tspan>script-coin-lock-tx to</tspan></text>
<path d="M692 697.67h39.34v14H692z" class="label-text-background"/>
<text x="692" y="708.67" class="directional-text method-text anchor-start"><tspan>confirm</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#FF0000)" d="M481 854.05H273" class="arc directional callback" style="stroke:red"/>
<path d="M304.97 838.3h144.06v14H304.97z" class="label-text-background"/>
<text x="377" y="849.3" class="directional-text callback-text"><tspan>Sends noscript-coin-lock-tx</tspan></text>
<path marker-end="url(#mscgenjsreplacememethod-#0000FF)" d="M689 940.97c104 .1 104 22.8 0 22.8" class="arc directional method" style="stroke:#00f"/>
<path d="M692 892.72h40.91v14H692z" class="label-text-background"/>
<text x="692" y="903.72" class="directional-text method-text anchor-start"><tspan>Wait for</tspan></text>
<path d="M692 908.72h120.36v14H692z" class="label-text-background"/>
<text x="692" y="919.72" class="directional-text method-text anchor-start"><tspan>noscript-coin-lock-tx to</tspan></text>
<path d="M692 924.72h39.34v14H692z" class="label-text-background"/>
<text x="692" y="935.72" class="directional-text method-text anchor-start"><tspan>confirm</tspan></text>
<path marker-end="url(#mscgenjsreplacememethod-#0000FF)" d="M689 1067.1H481" class="arc directional method" style="stroke:#00f"/>
<path d="M519.64 1051.35h130.72v14H519.64z" class="label-text-background"/>
<text x="585" y="1062.35" class="directional-text method-text"><tspan>Sends script-coin-lock-tx</tspan></text>
<path d="M539.3 1069.35h91.71v14H539.3z" class="label-text-background"/>
<text x="585" y="1080.35" class="directional-text method-text"><tspan>release message</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#FF0000)" d="M481 1167.1H273" class="arc directional callback" style="stroke:red"/>
<path d="M293.3 1151.35h167.41v14H293.3z" class="label-text-background"/>
<text x="377" y="1162.35" class="directional-text callback-text"><tspan>Sends script-coin-lock-spend-tx</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#008800)" d="M273 1205.1h416" class="arc directional return" style="stroke:#080"/>
<path d="M393.97 1189.35h174.06v14H393.97z" class="label-text-background"/>
<text x="481" y="1200.35" class="directional-text return-text"><tspan>Detects script-coin-lock-spend-tx</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#0000FF)" d="M689 1281.1H273" class="arc directional callback" style="stroke:#00f"/>
<path d="M390.63 1265.35h180.75v14H390.63z" class="label-text-background"/>
<text x="481" y="1276.35" class="directional-text callback-text"><tspan>Sends noscript-coin-lock-spend-tx</tspan></text>
<path marker-end="url(#mscgenjsreplacememethod-#0000FF)" d="M689 1406.02c104 .1 104 22.8 0 22.8" class="arc directional method" style="stroke:#00f"/>
<path d="M692 1357.77h40.91v14H692z" class="label-text-background"/>
<text x="692" y="1368.77" class="directional-text method-text anchor-start"><tspan>Wait for</tspan></text>
<path d="M692 1373.77h143.39v14H692z" class="label-text-background"/>
<text x="692" y="1384.77" class="directional-text method-text anchor-start"><tspan>noscript-coin-lock-spend-tx</tspan></text>
<path d="M692 1389.77h52.69v14H692z" class="label-text-background"/>
<text x="692" y="1400.77" class="directional-text method-text anchor-start"><tspan>to confirm</tspan></text>
<path d="M-39 1508.15h1040" class="inline_expression_divider" style="stroke-dasharray:10,5"/>
<path d="M459.98 1500.9h42.03v14h-42.03z" class="label-text-background"/>
<text x="481" y="1511.9" class="empty-text comment-row-text"><tspan>fail path</tspan></text>
<path marker-end="url(#mscgenjsreplacememethod-#0000FF)" d="M689 1595.07c104 .1 104 22.8 0 22.8" class="arc directional method" style="stroke:#00f"/>
<path d="M692 1546.82h40.91v14H692z" class="label-text-background"/>
<text x="692" y="1557.82" class="directional-text method-text anchor-start"><tspan>Wait for</tspan></text>
<path d="M692 1562.82h93.36v14H692z" class="label-text-background"/>
<text x="692" y="1573.82" class="directional-text method-text anchor-start"><tspan>script-coin-lock-tx</tspan></text>
<path d="M692 1578.82h93.7v14H692z" class="label-text-background"/>
<text x="692" y="1589.82" class="directional-text method-text anchor-start"><tspan>locktime to expire</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#0000FF)" d="M689 1659.2H273" class="arc directional callback" style="stroke:#00f"/>
<path d="M385.96 1643.45h190.08v14H385.96z" class="label-text-background"/>
<text x="481" y="1654.45" class="directional-text callback-text"><tspan>Sends script-coin-lock-pre-refund-tx</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#008800)" d="M273 1697.2h416" class="arc directional return" style="stroke:#080"/>
<path d="M404.64 1681.45h152.72v14H404.64z" class="label-text-background"/>
<text x="481" y="1692.45" class="directional-text return-text"><tspan>script-coin-lock-pre-refund-tx</tspan></text>
<path marker-end="url(#mscgenjsreplacememethod-#0000FF)" d="M689 1814.12c104 .1 104 22.8 0 22.8" class="arc directional method" style="stroke:#00f"/>
<path d="M692 1781.87h40.91v14H692z" class="label-text-background"/>
<text x="692" y="1792.87" class="directional-text method-text anchor-start"><tspan>Wait for</tspan></text>
<path d="M692 1797.87h124.06v14H692z" class="label-text-background"/>
<text x="692" y="1808.87" class="directional-text method-text anchor-start"><tspan>pre-refund tx to confirm</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#0000FF)" d="M689 1870.25H273" class="arc directional callback" style="stroke:#00f"/>
<path d="M367.62 1854.5h226.77v14H367.62z" class="label-text-background"/>
<text x="481" y="1865.5" class="directional-text callback-text"><tspan>Sends script-coin-lock-pre-refund-spend-tx</tspan></text>
</g>
<g id="mscgenjsreplaceme_notes">
<path d="m589 209 3-17h194l3 17-3 17H592z" class="box abox" style="stroke:#00f"/>
<text x="689" y="212.75" class="box-text abox-text"><tspan>Bid Request sent</tspan></text>
<path d="M381 230h200v34H381z" class="box" style="stroke:red"/>
<text x="481" y="250.75" class="box-text"><tspan>User accepts bid</tspan></text>
<path d="M797 268h399v9h9m-9-9 9 9v25H797v-34z" class="box note" style="fill:#ffc"/>
<text x="1001" y="280.75" class="box-text note-text"><tspan>The BidAccept message contains the pubkeys the offerer will use and a</tspan></text>
<text x="1001" y="296.75" class="box-text note-text"><tspan>DLEAG proof one key will work across both chains of the swapping coins</tspan></text>
<path d="m589 323 3-17h194l3 17-3 17H592z" class="box abox" style="stroke:#00f"/>
<text x="689" y="326.75" class="box-text abox-text"><tspan>Bid Receiving accept</tspan></text>
<path d="m589 399 3-17h194l3 17-3 17H592z" class="box abox" style="stroke:#00f"/>
<text x="689" y="402.75" class="box-text abox-text"><tspan>Bid Accepted</tspan></text>
<path d="M797 420h399v9h9m-9-9 9 9v25H797v-34z" class="box note" style="fill:#ffc"/>
<text x="1001" y="432.75" class="box-text note-text"><tspan>The XmrBidLockTxSigsMessage contains the offerer&apos;s signatures for the</tspan></text>
<text x="1001" y="448.75" class="box-text note-text"><tspan>script-coin-lock-refund and script-coin-lock-refund-spend txns.</tspan></text>
<path d="m589 475 3-17h194l3 17-3 17H592z" class="box abox" style="stroke:#00f"/>
<text x="689" y="470.75" class="box-text abox-text"><tspan>Exchanged script lock tx sigs</tspan></text>
<text x="689" y="486.75" class="box-text abox-text"><tspan>msg</tspan></text>
<path d="m589 551 3-17h194l3 17-3 17H592z" class="box abox" style="stroke:#00f"/>
<text x="689" y="554.75" class="box-text abox-text"><tspan>Bid Script coin spend tx valid</tspan></text>
<path d="M797 572h399v9h9m-9-9 9 9v25H797v-34z" class="box note" style="fill:#ffc"/>
<text x="1001" y="584.75" class="box-text note-text"><tspan>The XmrBidLockSpendTxMessage contains the script-coin-lock-tx and</tspan></text>
<text x="1001" y="600.75" class="box-text note-text"><tspan>proof the bidder can sign it.</tspan></text>
<path d="m589 627 3-17h194l3 17-3 17H592z" class="box abox" style="stroke:#00f"/>
<text x="689" y="622.75" class="box-text abox-text"><tspan>Exchanged script lock spend tx</tspan></text>
<text x="689" y="638.75" class="box-text abox-text"><tspan>msg</tspan></text>
<path d="m589 778.05 3-17h194l3 17-3 17H592z" class="box abox" style="stroke:#00f"/>
<text x="689" y="781.8" class="box-text abox-text"><tspan>Bid Script coin locked</tspan></text>
<path d="M-38 816.05h98.39v11l-7 7H-38" class="box inline_expression_label"/>
<text x="-36" y="829.3" class="inline_expression-text alt-text anchor-start"><tspan>alt: success path</tspan></text>
<path d="m589 1005.1 3-17h194l3 17-3 17H592z" class="box abox" style="stroke:#00f"/>
<text x="689" y="1008.85" class="box-text abox-text"><tspan>Bid Scriptless coin locked</tspan></text>
<path d="M797 1026.1h399v9h9m-9-9 9 9v73H797v-82z" class="box note" style="fill:#ffc"/>
<text x="1001" y="1038.85" class="box-text note-text"><tspan>The XmrBidLockReleaseMessage contains the bidder&apos;s OTVES for the</tspan></text>
<text x="1001" y="1054.85" class="box-text note-text"><tspan>script-coin-lock-tx. The offerer decodes the</tspan></text>
<text x="1001" y="1070.85" class="box-text note-text"><tspan>bidder&apos;s signature from the OTVES. When the</tspan></text>
<text x="1001" y="1086.85" class="box-text note-text"><tspan>bidder has the plaintext signature, they can decode the offerer&apos;s key</tspan></text>
<text x="1001" y="1102.85" class="box-text note-text"><tspan>for the noscript-lock-tx.</tspan></text>
<path d="m589 1129.1 3-17h194l3 17-3 17H592z" class="box abox" style="stroke:#00f"/>
<text x="689" y="1132.85" class="box-text abox-text"><tspan>Bid Script coin lock released</tspan></text>
<path d="m589 1243.1 3-17h194l3 17-3 17H592z" class="box abox" style="stroke:#00f"/>
<text x="689" y="1246.85" class="box-text abox-text"><tspan>Bid Script tx redeemed</tspan></text>
<path d="M797 1226.1h399v9h9m-9-9 9 9v25H797v-34z" class="box note" style="fill:#ffc"/>
<text x="1001" y="1238.85" class="box-text note-text"><tspan>The bidder extracts the offerer&apos;s plaintext signature and derives the</tspan></text>
<text x="1001" y="1254.85" class="box-text note-text"><tspan>offerer&apos;s noscript-lock-tx keyhalf.</tspan></text>
<path d="m589 1319.1 3-17h194l3 17-3 17H592z" class="box abox" style="stroke:#00f"/>
<text x="689" y="1322.85" class="box-text abox-text"><tspan>Bid Scriptless tx redeemed</tspan></text>
<path d="m589 1470.15 3-17h194l3 17-3 17H592z" class="box abox" style="stroke:#00f"/>
<text x="689" y="1473.9" class="box-text abox-text"><tspan>Bid Completed</tspan></text>
<path d="M797 1642.2h399v9h9m-9-9 9 9v25H797v-34z" class="box note" style="fill:#ffc"/>
<text x="1001" y="1662.95" class="box-text note-text"><tspan>tx can be sent by either party.</tspan></text>
<path d="m589 1735.2 3-17h194l3 17-3 17H592z" class="box abox" style="stroke:#00f"/>
<text x="689" y="1730.95" class="box-text abox-text"><tspan>Bid Script pre-refund tx in</tspan></text>
<text x="689" y="1746.95" class="box-text abox-text"><tspan>chain</tspan></text>
<path d="M797 1853.25h399v9h9m-9-9 9 9v25H797v-34z" class="box note" style="fill:#ffc"/>
<text x="1001" y="1866" class="box-text note-text"><tspan>Refunds the script lock tx, with the bidder&apos;s cleartext signature the</tspan></text>
<text x="1001" y="1882" class="box-text note-text"><tspan>offerer can refund the noscript lock tx.</tspan></text>
<path d="m589 1908.25 3-17h194l3 17-3 17H592z" class="box abox" style="stroke:#00f"/>
<text x="689" y="1912" class="box-text abox-text"><tspan>Bid Failed, refunded</tspan></text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 36 KiB

View file

@ -0,0 +1,420 @@
<svg xmlns="http://www.w3.org/2000/svg" id="mscgenjsreplaceme" width="1272" height="2063.25" class="mscgenjsreplaceme" style="font-family:Helvetica,sans-serif;font-size:12px;font-weight:400;font-style:normal;text-decoration:none;background-color:#fff;stroke:#000;stroke-width:2" version="1.1">
<defs>
<marker id="mscgenjsreplacemecallback-#0000FF" class="arrow-marker" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="9" refY="3" viewBox="0 0 10 10">
<path d="m1 1 8 2-8 2" class="arrow-style" style="stroke-dasharray:100,1;stroke:#00f"/>
</marker>
<marker id="mscgenjsreplacemecallback-l-#0000FF" class="arrow-marker" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="9" refY="3" viewBox="0 0 10 10">
<path d="M17 1 9 3l8 2" class="arrow-style" style="stroke-dasharray:100,1;stroke:#00f"/>
</marker>
<marker id="mscgenjsreplacemecallback-#008800" class="arrow-marker" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="9" refY="3" viewBox="0 0 10 10">
<path d="m1 1 8 2-8 2" class="arrow-style" style="stroke-dasharray:100,1;stroke:#080"/>
</marker>
<marker id="mscgenjsreplacemecallback-l-#008800" class="arrow-marker" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="9" refY="3" viewBox="0 0 10 10">
<path d="M17 1 9 3l8 2" class="arrow-style" style="stroke-dasharray:100,1;stroke:#080"/>
</marker>
<marker id="mscgenjsreplacemecallback-#FF0000" class="arrow-marker" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="9" refY="3" viewBox="0 0 10 10">
<path d="m1 1 8 2-8 2" class="arrow-style" style="stroke-dasharray:100,1;stroke:red"/>
</marker>
<marker id="mscgenjsreplacemecallback-l-#FF0000" class="arrow-marker" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="9" refY="3" viewBox="0 0 10 10">
<path d="M17 1 9 3l8 2" class="arrow-style" style="stroke-dasharray:100,1;stroke:red"/>
</marker>
<marker id="mscgenjsreplacememethod-#0000FF" class="arrow-marker" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="9" refY="3" viewBox="0 0 10 10">
<path fill="#00F" stroke="#00F" d="m1 1 8 2-8 2z" class="arrow-style"/>
</marker>
<marker id="mscgenjsreplacememethod-l-#0000FF" class="arrow-marker" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="9" refY="3" viewBox="0 0 10 10">
<path fill="#00F" stroke="#00F" d="M17 1 9 3l8 2z" class="arrow-style"/>
</marker>
<marker id="mscgenjsreplacememethod-#FF0000" class="arrow-marker" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="9" refY="3" viewBox="0 0 10 10">
<path fill="red" stroke="red" d="m1 1 8 2-8 2z" class="arrow-style"/>
</marker>
<marker id="mscgenjsreplacememethod-l-#FF0000" class="arrow-marker" markerHeight="10" markerUnits="strokeWidth" markerWidth="10" orient="auto" refX="9" refY="3" viewBox="0 0 10 10">
<path fill="red" stroke="red" d="M17 1 9 3l8 2z" class="arrow-style"/>
</marker>
<style>
.mscgenjsreplaceme path,.mscgenjsreplaceme rect{fill:none}.mscgenjsreplaceme .label-text-background{fill:#fff;stroke:#fff;stroke-width:0}.mscgenjsreplaceme .return{stroke-dasharray:5,3}.mscgenjsreplaceme .inline_expression_divider{stroke-dasharray:10,5}.mscgenjsreplaceme text{color:inherit;stroke:none;text-anchor:middle}.mscgenjsreplaceme text.anchor-start{text-anchor:start}.mscgenjsreplaceme .arrow-marker{overflow:visible}.mscgenjsreplaceme .arrow-style{stroke-width:1}.mscgenjsreplaceme .arcrow{stroke-linecap:butt}.mscgenjsreplaceme .box,.mscgenjsreplaceme .entity{fill:#fff;stroke-linejoin:round}
</style>
</defs>
<g id="mscgenjsreplaceme_body" transform="translate(51 3)">
<path id="mscgenjsreplaceme_background" d="M-51-3h1272v2063.25H-51z" class="bglayer" style="fill:#fff;stroke:#fff;stroke-width:0"/>
<g id="mscgenjsreplaceme_arcspans">
<path d="M-41 869.1h1044v1169.15H-41z" class="box inline_expression alt"/>
<path d="M-37 1410.15H999v590.1H-37z" class="box inline_expression alt"/>
</g>
<g id="mscgenjsreplaceme_lifelines">
<path d="M65 38v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 38v38" class="arcrow" style="stroke:#080"/>
<path d="M481 38v38" class="arcrow" style="stroke:red"/>
<path d="M689 38v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 38v38M1105 38v38M65 76v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 76v38" class="arcrow" style="stroke:#080"/>
<path d="M481 76v38" class="arcrow" style="stroke:red"/>
<path d="M689 76v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 76v38M1105 76v38M65 114v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 114v38" class="arcrow" style="stroke:#080"/>
<path d="M481 114v38" class="arcrow" style="stroke:red"/>
<path d="M689 114v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 114v38M1105 114v38M65 152v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 152v38" class="arcrow" style="stroke:#080"/>
<path d="M481 152v38" class="arcrow" style="stroke:red"/>
<path d="M689 152v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 152v38M1105 152v38M65 190v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 190v38" class="arcrow" style="stroke:#080"/>
<path d="M481 190v38" class="arcrow" style="stroke:red"/>
<path d="M689 190v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 190v38M1105 190v38M65 228v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 228v38" class="arcrow" style="stroke:#080"/>
<path d="M481 228v38" class="arcrow" style="stroke:red"/>
<path d="M689 228v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 228v38M1105 228v38M65 266v54" class="arcrow" style="stroke:transparent"/>
<path d="M273 266v54" class="arcrow" style="stroke:#080"/>
<path d="M481 266v54" class="arcrow" style="stroke:red"/>
<path d="M689 266v54" class="arcrow" style="stroke:#00f"/>
<path d="M897 266v54M1105 266v54M65 320v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 320v38" class="arcrow" style="stroke:#080"/>
<path d="M481 320v38" class="arcrow" style="stroke:red"/>
<path d="M689 320v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 320v38M1105 320v38M65 358v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 358v38" class="arcrow" style="stroke:#080"/>
<path d="M481 358v38" class="arcrow" style="stroke:red"/>
<path d="M689 358v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 358v38M1105 358v38M65 396v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 396v38" class="arcrow" style="stroke:#080"/>
<path d="M481 396v38" class="arcrow" style="stroke:red"/>
<path d="M689 396v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 396v38M1105 396v38M65 434v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 434v38" class="arcrow" style="stroke:#080"/>
<path d="M481 434v38" class="arcrow" style="stroke:red"/>
<path d="M689 434v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 434v38M1105 434v38M65 472v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 472v38" class="arcrow" style="stroke:#080"/>
<path d="M481 472v38" class="arcrow" style="stroke:red"/>
<path d="M689 472v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 472v38M1105 472v38M65 510v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 510v38" class="arcrow" style="stroke:#080"/>
<path d="M481 510v38" class="arcrow" style="stroke:red"/>
<path d="M689 510v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 510v38M1105 510v38M65 548v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 548v38" class="arcrow" style="stroke:#080"/>
<path d="M481 548v38" class="arcrow" style="stroke:red"/>
<path d="M689 548v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 548v38M1105 548v38M65 586v75.05" class="arcrow" style="stroke:transparent"/>
<path d="M273 586v75.05" class="arcrow" style="stroke:#080"/>
<path d="M481 586v75.05" class="arcrow" style="stroke:red"/>
<path d="M689 586v75.05" class="arcrow" style="stroke:#00f"/>
<path d="M897 586v75.05M1105 586v75.05M65 661.05v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 661.05v38" class="arcrow" style="stroke:#080"/>
<path d="M481 661.05v38" class="arcrow" style="stroke:red"/>
<path d="M689 661.05v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 661.05v38M1105 661.05v38M65 699.05v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 699.05v38" class="arcrow" style="stroke:#080"/>
<path d="M481 699.05v38" class="arcrow" style="stroke:red"/>
<path d="M689 699.05v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 699.05v38M1105 699.05v38M65 737.05v75.05" class="arcrow" style="stroke:transparent"/>
<path d="M273 737.05v75.05" class="arcrow" style="stroke:#080"/>
<path d="M481 737.05v75.05" class="arcrow" style="stroke:red"/>
<path d="M689 737.05v75.05" class="arcrow" style="stroke:#00f"/>
<path d="M897 737.05v75.05M1105 737.05v75.05M65 812.1v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 812.1v38" class="arcrow" style="stroke:#080"/>
<path d="M481 812.1v38" class="arcrow" style="stroke:red"/>
<path d="M689 812.1v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 812.1v38M1105 812.1v38M65 850.1v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 850.1v38" class="arcrow" style="stroke:#080"/>
<path d="M481 850.1v38" class="arcrow" style="stroke:red"/>
<path d="M689 850.1v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 850.1v38M1105 850.1v38M65 888.1v86" class="arcrow" style="stroke:transparent"/>
<path d="M273 888.1v86" class="arcrow" style="stroke:#080"/>
<path d="M481 888.1v86" class="arcrow" style="stroke:red"/>
<path d="M689 888.1v86" class="arcrow" style="stroke:#00f"/>
<path d="M897 888.1v86M1105 888.1v86M65 974.1v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 974.1v38" class="arcrow" style="stroke:#080"/>
<path d="M481 974.1v38" class="arcrow" style="stroke:red"/>
<path d="M689 974.1v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 974.1v38M1105 974.1v38M65 1012.1v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1012.1v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1012.1v38" class="arcrow" style="stroke:red"/>
<path d="M689 1012.1v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1012.1v38M1105 1012.1v38M65 1050.1v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1050.1v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1050.1v38" class="arcrow" style="stroke:red"/>
<path d="M689 1050.1v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1050.1v38M1105 1050.1v38M65 1088.1v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1088.1v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1088.1v38" class="arcrow" style="stroke:red"/>
<path d="M689 1088.1v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1088.1v38M1105 1088.1v38M65 1126.1v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1126.1v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1126.1v38" class="arcrow" style="stroke:red"/>
<path d="M689 1126.1v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1126.1v38M1105 1126.1v38M65 1164.1v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1164.1v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1164.1v38" class="arcrow" style="stroke:red"/>
<path d="M689 1164.1v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1164.1v38M1105 1164.1v38M65 1202.1v75.05" class="arcrow" style="stroke:transparent"/>
<path d="M273 1202.1v75.05" class="arcrow" style="stroke:#080"/>
<path d="M481 1202.1v75.05" class="arcrow" style="stroke:red"/>
<path d="M689 1202.1v75.05" class="arcrow" style="stroke:#00f"/>
<path d="M897 1202.1v75.05M1105 1202.1v75.05M65 1277.15v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1277.15v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1277.15v38" class="arcrow" style="stroke:red"/>
<path d="M689 1277.15v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1277.15v38M1105 1277.15v38M65 1315.15v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1315.15v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1315.15v38" class="arcrow" style="stroke:red"/>
<path d="M689 1315.15v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1315.15v38M1105 1315.15v38M65 1353.15v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1353.15v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1353.15v38" class="arcrow" style="stroke:red"/>
<path d="M689 1353.15v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1353.15v38M1105 1353.15v38M65 1391.15v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1391.15v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1391.15v38" class="arcrow" style="stroke:red"/>
<path d="M689 1391.15v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1391.15v38M1105 1391.15v38M65 1429.15v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1429.15v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1429.15v38" class="arcrow" style="stroke:red"/>
<path d="M689 1429.15v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1429.15v38M1105 1429.15v38M65 1467.15v59.05" class="arcrow" style="stroke:transparent"/>
<path d="M273 1467.15v59.05" class="arcrow" style="stroke:#080"/>
<path d="M481 1467.15v59.05" class="arcrow" style="stroke:red"/>
<path d="M689 1467.15v59.05" class="arcrow" style="stroke:#00f"/>
<path d="M897 1467.15v59.05M1105 1467.15v59.05M65 1526.2v54" class="arcrow" style="stroke:transparent"/>
<path d="M273 1526.2v54" class="arcrow" style="stroke:#080"/>
<path d="M481 1526.2v54" class="arcrow" style="stroke:red"/>
<path d="M689 1526.2v54" class="arcrow" style="stroke:#00f"/>
<path d="M897 1526.2v54M1105 1526.2v54M65 1580.2v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1580.2v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1580.2v38" class="arcrow" style="stroke:red"/>
<path d="M689 1580.2v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1580.2v38M1105 1580.2v38M65 1618.2v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1618.2v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1618.2v38" class="arcrow" style="stroke:red"/>
<path d="M689 1618.2v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1618.2v38M1105 1618.2v38M65 1656.2v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1656.2v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1656.2v38" class="arcrow" style="stroke:red"/>
<path d="M689 1656.2v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1656.2v38M1105 1656.2v38M65 1694.2v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1694.2v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1694.2v38" class="arcrow" style="stroke:red"/>
<path d="M689 1694.2v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1694.2v38M1105 1694.2v38M65 1732.2v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1732.2v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1732.2v38" class="arcrow" style="stroke:red"/>
<path d="M689 1732.2v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1732.2v38M1105 1732.2v38M65 1770.2v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1770.2v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1770.2v38" class="arcrow" style="stroke:red"/>
<path d="M689 1770.2v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1770.2v38M1105 1770.2v38M65 1808.2v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1808.2v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1808.2v38" class="arcrow" style="stroke:red"/>
<path d="M689 1808.2v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1808.2v38M1105 1808.2v38M65 1846.2v59.05" class="arcrow" style="stroke:transparent"/>
<path d="M273 1846.2v59.05" class="arcrow" style="stroke:#080"/>
<path d="M481 1846.2v59.05" class="arcrow" style="stroke:red"/>
<path d="M689 1846.2v59.05" class="arcrow" style="stroke:#00f"/>
<path d="M897 1846.2v59.05M1105 1846.2v59.05M65 1905.25v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1905.25v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1905.25v38" class="arcrow" style="stroke:red"/>
<path d="M689 1905.25v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1905.25v38M1105 1905.25v38M65 1943.25v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1943.25v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1943.25v38" class="arcrow" style="stroke:red"/>
<path d="M689 1943.25v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1943.25v38M1105 1943.25v38M65 1981.25v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 1981.25v38" class="arcrow" style="stroke:#080"/>
<path d="M481 1981.25v38" class="arcrow" style="stroke:red"/>
<path d="M689 1981.25v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 1981.25v38M1105 1981.25v38M65 2019.25v38" class="arcrow" style="stroke:transparent"/>
<path d="M273 2019.25v38" class="arcrow" style="stroke:#080"/>
<path d="M481 2019.25v38" class="arcrow" style="stroke:red"/>
<path d="M689 2019.25v38" class="arcrow" style="stroke:#00f"/>
<path d="M897 2019.25v38M1105 2019.25v38" class="arcrow" style="stroke:transparent"/>
</g>
<g id="mscgenjsreplaceme_sequence">
<path d="M0 0h130v38H0z" class="entity" style="stroke:transparent"/>
<text x="65" y="22.75" class="entity-text"><tspan> </tspan></text>
<path d="M208 0h130v38H208z" class="entity" style="fill:#cfc;stroke:#080"/>
<text x="273" y="22.75" class="entity-text"><tspan>Network</tspan></text>
<path d="M416 0h130v38H416z" class="entity" style="fill:#fcc;stroke:red"/>
<text x="481" y="22.75" class="entity-text"><tspan>Offerer</tspan></text>
<path d="M624 0h130v38H624z" class="entity" style="fill:#ccf;stroke:#00f"/>
<text x="689" y="22.75" class="entity-text"><tspan>Bidder</tspan></text>
<path d="M832 0h130v38H832z" class="entity" style="stroke:transparent"/>
<text x="897" y="22.75" class="entity-text"><tspan> </tspan></text>
<path d="M1040 0h130v38h-130z" class="entity" style="stroke:transparent"/>
<text x="1105" y="22.75" class="entity-text"><tspan> </tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#FF0000)" d="M481 95H273" class="arc directional callback" style="stroke:red"/>
<path d="M345.09 79.25h63.83v14h-63.83z" class="label-text-background"/>
<text x="377" y="90.25" class="directional-text callback-text"><tspan>Sends Offer</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#008800)" d="M273 133h416" class="arc directional return" style="stroke:#080"/>
<path d="M445.76 117.25h70.48v14h-70.48z" class="label-text-background"/>
<text x="481" y="128.25" class="directional-text return-text"><tspan>Detects Offer</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#0000FF)" d="M689 171H481" class="arc directional callback" style="stroke:#00f"/>
<path d="M516.62 155.25H653.7v14H516.62z" class="label-text-background"/>
<text x="585" y="166.25" class="directional-text callback-text"><tspan>Sends BidIntent message</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#FF0000)" d="M481 293h208" class="arc directional callback" style="stroke:red"/>
<path d="M498.28 277.25h173.76v14H498.28z" class="label-text-background"/>
<text x="585" y="288.25" class="directional-text callback-text"><tspan>Sends BidIntentAccept message</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#0000FF)" d="M689 339H481" class="arc directional callback" style="stroke:#00f"/>
<path d="M513.29 323.25h143.74v14H513.29z" class="label-text-background"/>
<text x="585" y="334.25" class="directional-text callback-text"><tspan>Sends BidAccept message</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#FF0000)" d="M481 415h208" class="arc directional callback" style="stroke:red"/>
<path d="M491.29 399.25h187.74v14H491.29z" class="label-text-background"/>
<text x="585" y="410.25" class="directional-text callback-text"><tspan>Sends XmrBidLockTxSigsMessage</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#0000FF)" d="M689 491H481" class="arc directional callback" style="stroke:#00f"/>
<path d="M485.61 475.25H684.7v14H485.61z" class="label-text-background"/>
<text x="585" y="486.25" class="directional-text callback-text"><tspan>Sends XmrBidLockSpendTxMessage</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#0000FF)" d="M689 529H273" class="arc directional callback" style="stroke:#00f"/>
<path d="M415.64 513.25h130.72v14H415.64z" class="label-text-background"/>
<text x="481" y="524.25" class="directional-text callback-text"><tspan>Sends script-coin-lock-tx</tspan></text>
<path marker-end="url(#mscgenjsreplacememethod-#FF0000)" d="M481 615.92c104 .1 104 22.8 0 22.8" class="arc directional method" style="stroke:red"/>
<path d="M484 567.67h40.91v14H484z" class="label-text-background"/>
<text x="484" y="578.67" class="directional-text method-text anchor-start"><tspan>Wait for</tspan></text>
<path d="M484 583.67h107.01v14H484z" class="label-text-background"/>
<text x="484" y="594.67" class="directional-text method-text anchor-start"><tspan>script-coin-lock-tx to</tspan></text>
<path d="M484 599.67h39.34v14H484z" class="label-text-background"/>
<text x="484" y="610.67" class="directional-text method-text anchor-start"><tspan>confirm</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#FF0000)" d="M481 718.05H273" class="arc directional callback" style="stroke:red"/>
<path d="M304.97 702.3h144.06v14H304.97z" class="label-text-background"/>
<text x="377" y="713.3" class="directional-text callback-text"><tspan>Sends noscript-coin-lock-tx</tspan></text>
<path marker-end="url(#mscgenjsreplacememethod-#FF0000)" d="M481 766.97c104 .1 104 22.8 0 22.8" class="arc directional method" style="stroke:red"/>
<path d="M484 718.72h40.91v14H484z" class="label-text-background"/>
<text x="484" y="729.72" class="directional-text method-text anchor-start"><tspan>Wait for</tspan></text>
<path d="M484 734.72h120.36v14H484z" class="label-text-background"/>
<text x="484" y="745.72" class="directional-text method-text anchor-start"><tspan>noscript-coin-lock-tx to</tspan></text>
<path d="M484 750.72h39.34v14H484z" class="label-text-background"/>
<text x="484" y="761.72" class="directional-text method-text anchor-start"><tspan>confirm</tspan></text>
<path marker-end="url(#mscgenjsreplacememethod-#0000FF)" d="M689 766.97c104 .1 104 22.8 0 22.8" class="arc directional method" style="stroke:#00f"/>
<path d="M692 718.72h40.91v14H692z" class="label-text-background"/>
<text x="692" y="729.72" class="directional-text method-text anchor-start"><tspan>Wait for</tspan></text>
<path d="M692 734.72h120.36v14H692z" class="label-text-background"/>
<text x="692" y="745.72" class="directional-text method-text anchor-start"><tspan>noscript-coin-lock-tx to</tspan></text>
<path d="M692 750.72h39.34v14H692z" class="label-text-background"/>
<text x="692" y="761.72" class="directional-text method-text anchor-start"><tspan>confirm</tspan></text>
<path marker-end="url(#mscgenjsreplacememethod-#0000FF)" d="M689 931.1H481" class="arc directional method" style="stroke:#00f"/>
<path d="M519.64 915.35h130.72v14H519.64z" class="label-text-background"/>
<text x="585" y="926.35" class="directional-text method-text"><tspan>Sends script-coin-lock-tx</tspan></text>
<path d="M539.3 933.35h91.71v14H539.3z" class="label-text-background"/>
<text x="585" y="944.35" class="directional-text method-text"><tspan>release message</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#FF0000)" d="M481 1031.1H273" class="arc directional callback" style="stroke:red"/>
<path d="M293.3 1015.35h167.41v14H293.3z" class="label-text-background"/>
<text x="377" y="1026.35" class="directional-text callback-text"><tspan>Sends script-coin-lock-spend-tx</tspan></text>
<path d="M-41 1145.1h1044" class="inline_expression_divider"/>
<path d="M459.98 1137.85h42.03v14h-42.03z" class="label-text-background"/>
<text x="481" y="1148.85" class="empty-text comment-row-text"><tspan>fail path</tspan></text>
<path marker-end="url(#mscgenjsreplacememethod-#FF0000)" d="M481 1232.02c104 .1 104 22.8 0 22.8" class="arc directional method" style="stroke:red"/>
<path d="M484 1183.77h40.91v14H484z" class="label-text-background"/>
<text x="484" y="1194.77" class="directional-text method-text anchor-start"><tspan>Wait for</tspan></text>
<path d="M484 1199.77h131.69v14H484z" class="label-text-background"/>
<text x="484" y="1210.77" class="directional-text method-text anchor-start"><tspan>script-coin-lock-tx lock to</tspan></text>
<path d="M484 1215.77h33.01v14H484z" class="label-text-background"/>
<text x="484" y="1226.77" class="directional-text method-text anchor-start"><tspan>expire</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#0000FF)" d="M689 1296.15H273" class="arc directional callback" style="stroke:#00f"/>
<path d="M385.96 1280.4h190.08v14H385.96z" class="label-text-background"/>
<text x="481" y="1291.4" class="directional-text callback-text"><tspan>Sends script-coin-lock-pre-refund-tx</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#008800)" d="M273 1334.15h416" class="arc directional return" style="stroke:#080"/>
<path d="M404.64 1318.4h152.72v14H404.64z" class="label-text-background"/>
<text x="481" y="1329.4" class="directional-text return-text"><tspan>script-coin-lock-pre-refund-tx</tspan></text>
<path marker-end="url(#mscgenjsreplacememethod-#0000FF)" d="M689 1489.07c104 .1 104 22.8 0 22.8" class="arc directional method" style="stroke:#00f"/>
<path d="M692 1456.82h40.91v14H692z" class="label-text-background"/>
<text x="692" y="1467.82" class="directional-text method-text anchor-start"><tspan>Wait for</tspan></text>
<path d="M692 1472.82h124.06v14H692z" class="label-text-background"/>
<text x="692" y="1483.82" class="directional-text method-text anchor-start"><tspan>pre-refund tx to confirm</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#0000FF)" d="M689 1553.2H273" class="arc directional callback" style="stroke:#00f"/>
<path d="M367.62 1537.45h226.77v14H367.62z" class="label-text-background"/>
<text x="481" y="1548.45" class="directional-text callback-text"><tspan>Sends script-coin-lock-pre-refund-spend-tx</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#008800)" d="M273 1637.2h208" class="arc directional return" style="stroke:#080"/>
<path d="M356.66 1621.45h40.69v14h-40.69z" class="label-text-background"/>
<text x="377" y="1632.45" class="directional-text return-text"><tspan>Detects</tspan></text>
<path d="M282.3 1639.45h189.41v14H282.3z" class="label-text-background"/>
<text x="377" y="1650.45" class="directional-text return-text"><tspan>script-coin-lock-pre-refund-spend-tx</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#FF0000)" d="M481 1675.2H273" class="arc directional callback" style="stroke:red"/>
<path d="M359.98 1659.45h34.03v14h-34.03z" class="label-text-background"/>
<text x="377" y="1670.45" class="directional-text callback-text"><tspan>Sends</tspan></text>
<path d="M297.65 1677.45h158.7v14h-158.7z" class="label-text-background"/>
<text x="377" y="1688.45" class="directional-text callback-text"><tspan>scriptless-coin-lock-recover-tx</tspan></text>
<path d="M-37 1789.2H999" class="inline_expression_divider"/>
<path d="M396.41 1781.95h169.17v14H396.41z" class="label-text-background"/>
<text x="481" y="1792.95" class="empty-text comment-row-text"><tspan>offerer swipes script coin lock tx</tspan></text>
<path marker-end="url(#mscgenjsreplacememethod-#FF0000)" d="M481 1868.12c104 .1 104 22.8 0 22.8" class="arc directional method" style="stroke:red"/>
<path d="M484 1835.87h40.91v14H484z" class="label-text-background"/>
<text x="484" y="1846.87" class="directional-text method-text anchor-start"><tspan>Wait for</tspan></text>
<path d="M484 1851.87h142.39v14H484z" class="label-text-background"/>
<text x="484" y="1862.87" class="directional-text method-text anchor-start"><tspan>pre-refund tx lock to expire</tspan></text>
<path marker-end="url(#mscgenjsreplacemecallback-#FF0000)" d="M481 1924.25H273" class="arc directional callback" style="stroke:red"/>
<path d="M359.98 1908.5h34.03v14h-34.03z" class="label-text-background"/>
<text x="377" y="1919.5" class="directional-text callback-text"><tspan>Sends</tspan></text>
<path d="M283.3 1926.5h187.39v14H283.3z" class="label-text-background"/>
<text x="377" y="1937.5" class="directional-text callback-text"><tspan>script-coin-lock-pre-refund-swipe-tx</tspan></text>
</g>
<g id="mscgenjsreplaceme_notes">
<path d="m383 209 3-17h190l3 17-3 17H386z" class="box abox" style="stroke:red"/>
<text x="481" y="212.75" class="box-text abox-text"><tspan>Bid Received</tspan></text>
<path d="M383 230h196v34H383z" class="box" style="stroke:red"/>
<text x="481" y="250.75" class="box-text"><tspan>User accepts bid</tspan></text>
<path d="M799 268h395v9h9m-9-9 9 9v41H799v-50z" class="box note" style="fill:#ffc"/>
<text x="1001" y="280.75" class="box-text note-text"><tspan>The BidAccept message contains the pubkeys the offerer will use and</tspan></text>
<text x="1001" y="296.75" class="box-text note-text"><tspan>a DLEAG proof one key will work across both chains of the swapping</tspan></text>
<text x="1001" y="312.75" class="box-text note-text"><tspan>coins</tspan></text>
<path d="M799 322h395v9h9m-9-9 9 9v25H799v-34z" class="box note" style="fill:#ffc"/>
<text x="1001" y="334.75" class="box-text note-text"><tspan>The BidAccept message contains the pubkeys the bidder will use and a</tspan></text>
<text x="1001" y="350.75" class="box-text note-text"><tspan>DLEAG proof one key will work across both chains of the swapping coins</tspan></text>
<path d="m383 377 3-17h190l3 17-3 17H386z" class="box abox" style="stroke:red"/>
<text x="481" y="380.75" class="box-text abox-text"><tspan>Bid Accepted</tspan></text>
<path d="M799 398h395v9h9m-9-9 9 9v25H799v-34z" class="box note" style="fill:#ffc"/>
<text x="1001" y="410.75" class="box-text note-text"><tspan>The XmrBidLockTxSigsMessage contains the offerer&apos;s signatures for</tspan></text>
<text x="1001" y="426.75" class="box-text note-text"><tspan>the script-coin-lock-refund and script-coin-lock-refund-spend txns.</tspan></text>
<path d="m383 453 3-17h190l3 17-3 17H386z" class="box abox" style="stroke:red"/>
<text x="481" y="448.75" class="box-text abox-text"><tspan>Exchanged script lock tx sigs</tspan></text>
<text x="481" y="464.75" class="box-text abox-text"><tspan>msg</tspan></text>
<path d="M799 474h395v9h9m-9-9 9 9v25H799v-34z" class="box note" style="fill:#ffc"/>
<text x="1001" y="486.75" class="box-text note-text"><tspan>The XmrBidLockSpendTxMessage contains the script-coin-lock-tx and</tspan></text>
<text x="1001" y="502.75" class="box-text note-text"><tspan>proof the bidder can sign it.</tspan></text>
<path d="m383 529 3-17h190l3 17-3 17H386z" class="box abox" style="stroke:red"/>
<text x="481" y="532.75" class="box-text abox-text"><tspan>Bid Script coin spend tx valid</tspan></text>
<path d="m383 567 3-17h190l3 17-3 17H386z" class="box abox" style="stroke:red"/>
<text x="481" y="562.75" class="box-text abox-text"><tspan>Exchanged script lock spend tx</tspan></text>
<text x="481" y="578.75" class="box-text abox-text"><tspan>msg</tspan></text>
<path d="m383 680.05 3-17h190l3 17-3 17H386z" class="box abox" style="stroke:red"/>
<text x="481" y="683.8" class="box-text abox-text"><tspan>Bid Script coin locked</tspan></text>
<path d="m383 831.1 3-17h190l3 17-3 17H386z" class="box abox" style="stroke:red"/>
<text x="481" y="834.85" class="box-text abox-text"><tspan>Bid Scriptless coin locked</tspan></text>
<path d="M-40 869.1h98.39v11l-7 7H-40" class="box inline_expression_label"/>
<text x="-38" y="882.35" class="inline_expression-text alt-text anchor-start"><tspan>alt: success path</tspan></text>
<path d="M799 890.1h395v9h9m-9-9 9 9v73H799v-82z" class="box note" style="fill:#ffc"/>
<text x="1001" y="902.85" class="box-text note-text"><tspan>The XmrBidLockReleaseMessage contains the bidder&apos;s OTVES for it. </tspan></text>
<text x="1001" y="918.85" class="box-text note-text"><tspan> The offerer decodes the bidder&apos;s signature</tspan></text>
<text x="1001" y="934.85" class="box-text note-text"><tspan>from the OTVES. When the bidder has the</tspan></text>
<text x="1001" y="950.85" class="box-text note-text"><tspan>plaintext signature, they can decode the offerer&apos;s noscript-coin-lock-tx</tspan></text>
<text x="1001" y="966.85" class="box-text note-text"><tspan>signature.</tspan></text>
<path d="m383 993.1 3-17h190l3 17-3 17H386z" class="box abox" style="stroke:red"/>
<text x="481" y="996.85" class="box-text abox-text"><tspan>Script coin lock released</tspan></text>
<path d="m383 1069.1 3-17h190l3 17-3 17H386z" class="box abox" style="stroke:red"/>
<text x="481" y="1072.85" class="box-text abox-text"><tspan>Script tx redeemed</tspan></text>
<path d="m383 1107.1 3-17h190l3 17-3 17H386z" class="box abox" style="stroke:red"/>
<text x="481" y="1110.85" class="box-text abox-text"><tspan>Bid Completed</tspan></text>
<path d="M799 1279.15h395v9h9m-9-9 9 9v25H799v-34z" class="box note" style="fill:#ffc"/>
<text x="1001" y="1299.9" class="box-text note-text"><tspan>tx can be sent by either party.</tspan></text>
<path d="m383 1372.15 3-17h190l3 17-3 17H386z" class="box abox" style="stroke:red"/>
<text x="481" y="1367.9" class="box-text abox-text"><tspan>Bid Script pre-refund tx in</tspan></text>
<text x="481" y="1383.9" class="box-text abox-text"><tspan>chain</tspan></text>
<path d="M-36 1410.15h199.77v11l-7 7H-36" class="box inline_expression_label"/>
<text x="-34" y="1423.4" class="inline_expression-text alt-text anchor-start"><tspan>alt: bidder refunds script coin lock tx</tspan></text>
<path d="M799 1528.2h395v9h9m-9-9 9 9v41H799v-50z" class="box note" style="fill:#ffc"/>
<text x="1001" y="1540.95" class="box-text note-text"><tspan>Refunds the script lock tx, with the bidder&apos;s cleartext signature</tspan></text>
<text x="1001" y="1556.95" class="box-text note-text"><tspan>the offerer can refund the noscript lock tx. </tspan></text>
<text x="1001" y="1572.95" class="box-text note-text"><tspan>Once the lock expires the pre-refund tx can be spent by the offerer.</tspan></text>
<path d="m591 1599.2 3-17h190l3 17-3 17H594z" class="box abox" style="stroke:#00f"/>
<text x="689" y="1602.95" class="box-text abox-text"><tspan>Bid Failed, refunded</tspan></text>
<path d="M799 1620.2h395v9h9m-9-9 9 9v25H799v-34z" class="box note" style="fill:#ffc"/>
<text x="1001" y="1640.95" class="box-text note-text"><tspan>offerer recovers the bidder&apos;s scriptless chain key-shard.</tspan></text>
<path d="m383 1713.2 3-17h190l3 17-3 17H386z" class="box abox" style="stroke:red"/>
<text x="481" y="1716.95" class="box-text abox-text"><tspan>Bid Scriptless tx recovered</tspan></text>
<path d="m383 1751.2 3-17h190l3 17-3 17H386z" class="box abox" style="stroke:red"/>
<text x="481" y="1754.95" class="box-text abox-text"><tspan>Bid Failed, refunded</tspan></text>
<path d="m383 1962.25 3-17h190l3 17-3 17H386z" class="box abox" style="stroke:red"/>
<text x="481" y="1966" class="box-text abox-text"><tspan>Bid Failed, swiped</tspan></text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 39 KiB

View file

@ -639,7 +639,11 @@
<div class="overflow-x-auto items-center justify-center relative">
<div class="flex items-center justify-center min-h-screen">
<div class="flex items-center justify-between text-white">
<img class="h-full py-2 pr-4 ml-8" src="/static/sequence_diagrams/xmr.bidder.alt.xu.min.svg">
{% if data.reverse_bid %}
<img class="h-full py-2 pr-4 ml-8" src="/static/sequence_diagrams/ads.rev.bidder.xu.min.svg">
{% else %}
<img class="h-full py-2 pr-4 ml-8" src="/static/sequence_diagrams/ads.bidder.alt.xu.min.svg">
{% endif %}
</div>
</div>
</div>
@ -673,7 +677,11 @@
<div class="overflow-x-auto items-center justify-center relative">
<div class="flex items-center justify-center min-h-screen">
<div class="flex items-center justify-between text-white">
<img class="h-full py-2 pr-4 ml-8" src="/static/sequence_diagrams/xmr.offerer.alt.xu.min.svg">
{% if data.reverse_bid %}
<img class="h-full py-2 pr-4 ml-8" src="/static/sequence_diagrams/ads.rev.offerer.xu.min.svg">
{% else %}
<img class="h-full py-2 pr-4 ml-8" src="/static/sequence_diagrams/ads.offerer.alt.xu.min.svg">
{% endif %}
</div>
</div>
</div>

View file

@ -155,8 +155,8 @@ def describeBid(swap_client, bid, xmr_swap, offer, xmr_offer, bid_events, edit_b
ci_leader = ci_to if reverse_bid else ci_from
ci_follower = ci_from if reverse_bid else ci_to
bid_amount = bid.amount
bid_rate = offer.rate if bid.rate is None else bid.rate
bid_amount: int = bid.amount
bid_rate: int = offer.rate if bid.rate is None else bid.rate
if reverse_bid:
bid_amount, bid_rate = reverseBidAmountAndRate(swap_client, bid, offer)
@ -271,6 +271,7 @@ def describeBid(swap_client, bid, xmr_swap, offer, xmr_offer, bid_events, edit_b
'can_abandon': can_abandon,
'events': bid_events,
'debug_ui': swap_client.debug_ui,
'reverse_bid': reverse_bid,
}
if edit_bid:

View file

@ -1,4 +1,4 @@
# XMR protocol
# Adaptor Signature Swap protocol
## WIP
@ -10,21 +10,24 @@ An OtVES:
- The encrypting private key (b) can be recovered using both the encrypted and decrypted signatures.
Leader - sends the first lock tx.
Offerer - Sends the offer
Bidder - Sends the bid
Leader - Sends the first lock tx (ITX)
Follower - Sends the second lock tx (PTX)
NOSCRIPT_COIN lock tx:
- sent second
- is sent to a combined key using a private key from each participant.
- Sent second.
- Is sent to a combined key using a private key from each participant.
SCRIPT_COIN lock tx:
- Sent first
- Requires two signatures to spend from.
- Refund to sender txn is presigned for and can only be mined in the future.
- Spending the refund tx reveals the leader's NOSCRIPT_COIN split private key
- Spending the refund tx reveals the leader's NOSCRIPT_COIN split private key.
- Sender withholds signature until NOSCRIPT_COIN lock tx is confirmed.
- spending the spend txn reveals the follower's NOSCRIPT_COIN split private key
- spending the spend txn reveals the follower's NOSCRIPT_COIN split private key.
```
@ -32,48 +35,49 @@ Offerer (Leader) | Bidder
------------------------------------------------------------------------|-------------------------------------------------------------------------------|
o1. Sends offer | |
- x SCRIPT_COIN for y NOSCRIPT_COIN | |
- sends smsg OfferMessage | |
- Sends smsg OfferMessage | |
| b1. Receives offer |
| - validates offer |
| - Validates offer |
| b2. Sends bid |
| - sends smsgs XmrBidMessage + 2x XmrSplitMessage |
| - Sends smsgs XmrBidMessage + 2x XmrSplitMessage |
| |
o2. Receives bid | |
- validates bid | |
- Validates bid | |
o3. Accepts bid | |
- sends smsgs XmrBidAcceptMessage + 2x XmrSplitMessage | |
- Sends smsgs XmrBidAcceptMessage + 2x XmrSplitMessage | |
| |
| b3. Receives bid accept |
| - validates |
| - signs for lock tx refund |
| - sends smsg XmrBidLockTxSigsMessage |
| - Validates |
| - Signs for lock tx refund |
| - Sends smsg XmrBidLockTxSigsMessage |
| |
o4. Receives bidder lock refund tx signatures | |
- sends smsg XmrBidLockSpendTxMessage | |
- full SCRIPT_COIN lock tx | |
- signature to prove leader can sign for split key | |
- submits SCRIPT_COIN lock tx to network | |
- Sends smsg XmrBidLockSpendTxMessage | |
- Full SCRIPT_COIN lock tx | |
- Signature to prove leader can sign for split key | |
- Submits SCRIPT_COIN lock tx to network | |
| |
| b4. Receives XmrBidLockSpendTxMessage |
| - validates SCRIPT_COIN lock tx and signature |
| - waits for SCRIPT_COIN lock tx to confirm in chain |
| - Validates SCRIPT_COIN lock tx and signature |
| - Waits for SCRIPT_COIN lock tx to confirm in chain |
| b5. Sends NOSCRIPT_COIN lock tx |
| |
o5. Waits for NOSCRIPT_COIN lock tx to confirm in chain | |
o6. Sends SCRIPT_COIN lock release. | |
- sends smsg XmrBidLockReleaseMessage | |
- includes OtVES ciphertext signature for the SCRIPT_COIN lock | |
- Sends smsg XmrBidLockReleaseMessage | |
- Includes OtVES ciphertext signature for the SCRIPT_COIN lock | |
spend tx. | |
| |
| b6. Receives offerer OtVES for SCRIPT_COIN lock spend tx. |
| - submits SCRIPT_COIN lock spend tx to network. |
| - Submits SCRIPT_COIN lock spend tx to network. |
| |
o7. Waits for SCRIPT_COIN lock spend tx. | |
- Extracts the NOSCRIPT_COIN bidders key using the signature | |
o8. Combines the keys to spend from the NOSCRIPT_COIN lock tx | |
- submits NOSCRIPT_COIN lock spend tx to network | |
- Submits NOSCRIPT_COIN lock spend tx to network | |
```
Per swap (including the offer smsg):
Offerer sent 6 smsgs (2 extra from split messages)
Bidder sent 4 smsgs (2 extra from split messages)

View file

@ -0,0 +1,85 @@
# Reverse Adaptor Signature Swap protocol
## WIP
Offerer - Sends the offer
Bidder - Sends the bid
Leader - Sends the first lock tx (ITX)
Follower - Sends the second lock tx (PTX)
The ITX must be sent from the script chain (coin A).
The side sending the ITX can be switched and the system can abstract to
users that the protocol is running in the opposite direction.
NOSCRIPT_COIN lock tx:
- Sent second.
- Is sent to a combined key using a private key from each participant.
SCRIPT_COIN lock tx:
- Sent first.
- Requires two signatures to spend from.
- Refund to sender txn is presigned for and can only be mined in the future.
- Spending the refund tx reveals the leader's NOSCRIPT_COIN split private key.
- Sender withholds signature until NOSCRIPT_COIN lock tx is confirmed.
- spending the spend txn reveals the follower's NOSCRIPT_COIN split private key.
```
Offerer (Follower) | Bidder (Leader) |
------------------------------------------------------------------------|-------------------------------------------------------------------------------|
o1. Sends offer | |
- x NOSCRIPT_COIN for y SCRIPT_COIN | |
- Sends smsg OfferMessage | |
| b1. Receives offer |
| - Validates offer |
| b2. Sends bid intent message |
| - Sends smsg ADSBidIntentMessage |
| |
o2. Receives bid intent message | |
- Validates bid intent | |
o3. Accepts bid intent message | |
- Sends smsgs ADSBidIntentAcceptMessage + 2x XmrSplitMessage | |
| |
| b3. Receives bid intent message |
| - Sends smsgs XmrBidAcceptMessage + 2x XmrSplitMessage |
| |
o4. Receives bid accept | |
- Validates | |
- Signs for lock tx refund | |
- Sends smsg XmrBidLockTxSigsMessage | |
| |
| b4. Receives bidder lock refund tx signatures |
| - Sends smsg XmrBidLockSpendTxMessage |
| - Full SCRIPT_COIN lock tx |
| - Signature to prove leader can sign for split key |
| - Submits SCRIPT_COIN lock tx to network |
| |
o5. Receives XmrBidLockSpendTxMessage | |
- Validates SCRIPT_COIN lock tx and signature | |
- Waits for SCRIPT_COIN lock tx to confirm in chain | |
o6. Sends NOSCRIPT_COIN lock tx | |
| |
| b5. Waits for NOSCRIPT_COIN lock tx to confirm in chain |
| b6. Sends SCRIPT_COIN lock release. |
| - Sends smsg XmrBidLockReleaseMessage |
| - Includes OtVES ciphertext signature for the SCRIPT_COIN lock |
| spend tx. |
| |
o7. Receives leader OtVES for SCRIPT_COIN lock spend tx. | |
- Submits SCRIPT_COIN lock spend tx to network. | |
| |
| b7. Waits for SCRIPT_COIN lock spend tx. |
| - Extracts the NOSCRIPT_COIN follower's key using the signature |
| b8. Combines the keys to spend from the NOSCRIPT_COIN lock tx |
| - Submits NOSCRIPT_COIN lock spend tx to network |
```
Per swap (including the offer smsg):
Offerer sent 5 smsgs (2 extra from split messages)
Bidder sent 6 smsgs (2 extra from split messages)

View file

@ -0,0 +1,79 @@
xu {
hscale="1.3", wordwraparcs=on;
CB [label=" ", linecolor="transparent"],
N [label="Network", linecolor="#008800", textbgcolor="#CCFFCC", arclinecolor="#008800"],
O [label="Offerer", linecolor="#FF0000", textbgcolor="#FFCCCC", arclinecolor="#FF0000"],
B [label="Bidder", linecolor="#0000FF", textbgcolor="#CCCCFF", arclinecolor="#0000FF"],
C [label=" ", linecolor="transparent"], C2 [label=" ", linecolor="transparent"];
O =>> N [label="Sends Offer"];
N >> B [label="Detects Offer"];
B =>> O [label="Sends BidIntent message"];
B abox B [label="Bid Request sent"];
O box O [label="User accepts bid"];
O =>> B [label="Sends BidIntentAccept message"],
C note C2
[label="The BidAccept message contains the pubkeys the offerer will use and a DLEAG proof one key will work across both chains of the swapping coins",
textbgcolor="#FFFFCC"];
B abox B [label="Bid Receiving accept"];
B =>> O [label="Sends BidAccept message"];
B abox B [label="Bid Accepted"];
O =>> B [label="Sends XmrBidLockTxSigsMessage"],
C note C2
[label="The XmrBidLockTxSigsMessage contains the offerer's signatures for the script-coin-lock-refund and script-coin-lock-refund-spend txns.",
textbgcolor="#FFFFCC"];
B abox B [label="Exchanged script lock tx sigs msg"];
B =>> N [label="Sends script-coin-lock-tx"];
B abox B [label="Bid Script coin spend tx valid"];
B =>> O [label="Sends XmrBidLockSpendTxMessage"],
C note C2
[label="The XmrBidLockSpendTxMessage contains the script-coin-lock-tx and proof the bidder can sign it.",
textbgcolor="#FFFFCC"];
B abox B [label="Exchanged script lock spend tx msg"];
|||;
O => O [label="Wait for script-coin-lock-tx to confirm"], B => B [label="Wait for script-coin-lock-tx to confirm"];
B abox B [label="Bid Script coin locked"];
CB alt C [label="success path"] {
O =>> N [label="Sends noscript-coin-lock-tx"];
|||;
B => B [label="Wait for noscript-coin-lock-tx to confirm"];
B abox B [label="Bid Scriptless coin locked"];
B => O [label="Sends script-coin-lock-tx release message"],
C note C2
[label="The XmrBidLockReleaseMessage contains the bidder's OTVES for the script-coin-lock-tx.
The offerer decodes the bidder's signature from the OTVES.
When the bidder has the plaintext signature, they can decode the offerer's key for the noscript-lock-tx.",
textbgcolor="#FFFFCC"];
B abox B [label="Bid Script coin lock released"];
O =>> N [label="Sends script-coin-lock-spend-tx"];
N >> B [label="Detects script-coin-lock-spend-tx"];
B abox B [label="Bid Script tx redeemed"],
C note C2
[label="The bidder extracts the offerer's plaintext signature and derives the offerer's noscript-lock-tx keyhalf.",
textbgcolor="#FFFFCC"];
B =>> N [label="Sends noscript-coin-lock-spend-tx"];
B abox B [label="Bid Scriptless tx redeemed"];
|||;
B => B [label="Wait for noscript-coin-lock-spend-tx to confirm"];
B abox B [label="Bid Completed"];
--- [label="fail path"];
|||;
B => B [label="Wait for script-coin-lock-tx locktime to expire"];
B =>> N [label="Sends script-coin-lock-pre-refund-tx"],
C note C2
[label="tx can be sent by either party.",
textbgcolor="#FFFFCC"];
N >> B [label="script-coin-lock-pre-refund-tx"];
B abox B [label="Bid Script pre-refund tx in chain"];
|||;
B => B [label="Wait for pre-refund tx to confirm"];
B =>> N [label="Sends script-coin-lock-pre-refund-spend-tx"],
C note C2
[label="Refunds the script lock tx, with the bidder's cleartext signature the offerer can refund the noscript lock tx.",
textbgcolor="#FFFFCC"];
B abox B [label="Bid Failed, refunded"];
};
}

View file

@ -0,0 +1,86 @@
xu {
hscale="1.3", wordwraparcs=on;
CB [label=" ", linecolor="transparent"],
N [label="Network", linecolor="#008800", textbgcolor="#CCFFCC", arclinecolor="#008800"],
O [label="Offerer", linecolor="#FF0000", textbgcolor="#FFCCCC", arclinecolor="#FF0000"],
B [label="Bidder", linecolor="#0000FF", textbgcolor="#CCCCFF", arclinecolor="#0000FF"],
C [label=" ", linecolor="transparent"], C2 [label=" ", linecolor="transparent"];
O =>> N [label="Sends Offer"];
N >> B [label="Detects Offer"];
B =>> O [label="Sends BidIntent message"];
O abox O [label="Bid Received"];
O box O [label="User accepts bid"];
O =>> B [label="Sends BidIntentAccept message"],
C note C2
[label="The BidAccept message contains the pubkeys the offerer will use and a DLEAG proof one key will work across both chains of the swapping coins",
textbgcolor="#FFFFCC"];
B =>> O [label="Sends BidAccept message"],
C note C2
[label="The BidAccept message contains the pubkeys the bidder will use and a DLEAG proof one key will work across both chains of the swapping coins",
textbgcolor="#FFFFCC"];
O abox O [label="Bid Accepted"];
O =>> B [label="Sends XmrBidLockTxSigsMessage"],
C note C2
[label="The XmrBidLockTxSigsMessage contains the offerer's signatures for the script-coin-lock-refund and script-coin-lock-refund-spend txns.",
textbgcolor="#FFFFCC"];
O abox O [label="Exchanged script lock tx sigs msg"];
B =>> O [label="Sends XmrBidLockSpendTxMessage"],
C note C2
[label="The XmrBidLockSpendTxMessage contains the script-coin-lock-tx and proof the bidder can sign it.",
textbgcolor="#FFFFCC"];
B =>> N [label="Sends script-coin-lock-tx"],
O abox O [label="Bid Script coin spend tx valid"];
O abox O [label="Exchanged script lock spend tx msg"];
O => O [label="Wait for script-coin-lock-tx to confirm"];
O abox O [label="Bid Script coin locked"];
# offerer would only send noscript-coin-lock-tx if script-coin-lock-tx validates
O =>> N [label="Sends noscript-coin-lock-tx"];
O => O [label="Wait for noscript-coin-lock-tx to confirm"], B => B [label="Wait for noscript-coin-lock-tx to confirm"];
O abox O [label="Bid Scriptless coin locked"];
CB alt C [label="success path"] {
B => O [label="Sends script-coin-lock-tx release message"],
C note C2
[label="The XmrBidLockReleaseMessage contains the bidder's OTVES for it.
The offerer decodes the bidder's signature from the OTVES.
When the bidder has the plaintext signature, they can decode the offerer's noscript-coin-lock-tx signature.",
textbgcolor="#FFFFCC"];
O abox O [label="Script coin lock released"];
O =>> N [label="Sends script-coin-lock-spend-tx"];
O abox O [label="Script tx redeemed"];
O abox O [label="Bid Completed"];
--- [label="fail path"];
|||;
O => O [label="Wait for script-coin-lock-tx lock to expire"];
B =>> N [label="Sends script-coin-lock-pre-refund-tx"],
C note C2
[label="tx can be sent by either party.",
textbgcolor="#FFFFCC"];
N >> B [label="script-coin-lock-pre-refund-tx"];
O abox O [label="Bid Script pre-refund tx in chain"];
CB alt C [label="bidder refunds script coin lock tx"] {
|||;
B => B [label="Wait for pre-refund tx to confirm"];
B =>> N [label="Sends script-coin-lock-pre-refund-spend-tx"],
C note C2
[label="Refunds the script lock tx, with the bidder's cleartext signature the offerer can refund the noscript lock tx.
Once the lock expires the pre-refund tx can be spent by the offerer.",
textbgcolor="#FFFFCC"];
B abox B [label="Bid Failed, refunded"];
N >> O [label="Detects script-coin-lock-pre-refund-spend-tx"],
C note C2
[label="offerer recovers the bidder's scriptless chain key-shard.",
textbgcolor="#FFFFCC"];
O =>> N [label="Sends scriptless-coin-lock-recover-tx"];
O abox O [label="Bid Scriptless tx recovered"];
O abox O [label="Bid Failed, refunded"];
--- [label="offerer swipes script coin lock tx"];
|||;
O => O [label="Wait for pre-refund tx lock to expire"];
O =>> N [label="Sends script-coin-lock-pre-refund-swipe-tx"];
O abox O [label="Bid Failed, swiped"];
};
};
}

View file

@ -11,13 +11,17 @@ npm install -g mscgenjs-cli
mscgenjs -T svg -i bidder.alt.xu -o bidder.alt.xu.svg
mscgenjs -T svg -i offerer.alt.xu -o offerer.alt.xu.svg
mscgenjs -T svg -i xmr.bidder.alt.xu -o xmr.bidder.alt.xu.svg
mscgenjs -T svg -i xmr.offerer.alt.xu -o xmr.offerer.alt.xu.svg
mscgenjs -T svg -i ads.bidder.alt.xu -o ads.bidder.alt.xu.svg
mscgenjs -T svg -i ads.offerer.alt.xu -o ads.offerer.alt.xu.svg
mscgenjs -T svg -i ads.rev.bidder.xu -o ads.rev.bidder.xu.svg
mscgenjs -T svg -i ads.rev.offerer.xu -o ads.rev.offerer.xu.svg
npm -g install svgo
svgo --pretty bidder.alt.xu.svg -o bidder.alt.xu.min.svg
svgo --pretty offerer.alt.xu.svg -o offerer.alt.xu.min.svg
svgo --pretty xmr.bidder.alt.xu.svg -o xmr.bidder.alt.xu.min.svg
svgo --pretty xmr.offerer.alt.xu.svg -o xmr.offerer.alt.xu.min.svg
svgo --pretty ads.bidder.alt.xu.svg -o ads.bidder.alt.xu.min.svg
svgo --pretty ads.offerer.alt.xu.svg -o ads.offerer.alt.xu.min.svg
svgo --pretty ads.rev.bidder.xu.svg -o ads.rev.bidder.xu.min.svg
svgo --pretty ads.rev.offerer.xu.svg -o ads.rev.offerer.xu.min.svg

View file

@ -1,4 +1,13 @@
0.0.64
==============
- protocol: Added reversed Adaptor sig protocol.
- Runs the adaptor-sig protocol with leader and follower swapped to
enable offers from no-script coins to script coins.
- smsg: Outbox messages are removed when expired.
0.0.63
==============

View file

@ -279,8 +279,22 @@ class BasicSwapTest(BaseTest):
logging.info('---------- Test {} to {}'.format(coin_from.name, coin_to.name))
swap_clients = self.swap_clients
reverse_bid: bool = coin_from in swap_clients[0].scriptless_coins
ci_from = swap_clients[0].ci(coin_from)
ci_to = swap_clients[1].ci(coin_to)
ci_part0 = swap_clients[0].ci(Coins.PART)
ci_part1 = swap_clients[1].ci(Coins.PART)
# Offerer sends the offer
# Bidder sends the bid
id_offerer: int = 0
id_bidder: int = 1
# Leader sends the initial (chain a) lock tx.
# Follower sends the participate (chain b) lock tx.
id_leader: int = 1 if reverse_bid else 0
id_follower: int = 0 if reverse_bid else 1
logging.info(f'Offerer, bidder, leader, follower: {id_offerer}, {id_bidder}, {id_leader}, {id_follower}')
js_0 = read_json_api(1800, 'wallets')
node0_from_before = self.getBalance(js_0, coin_from)
@ -291,20 +305,23 @@ class BasicSwapTest(BaseTest):
js_0_to = read_json_api(1800, 'wallets/{}'.format(coin_to.name.lower()))
js_1_to = read_json_api(1801, 'wallets/{}'.format(coin_to.name.lower()))
node0_sent_messages_before: int = ci_part0.rpc_callback('smsgoutbox', ['count',])['num_messages']
node1_sent_messages_before: int = ci_part1.rpc_callback('smsgoutbox', ['count',])['num_messages']
amt_swap = ci_from.make_int(random.uniform(0.1, 2.0), r=1)
rate_swap = ci_to.make_int(random.uniform(0.2, 20.0), r=1)
offer_id = swap_clients[0].postOffer(coin_from, coin_to, amt_swap, rate_swap, amt_swap, SwapTypes.XMR_SWAP)
wait_for_offer(test_delay_event, swap_clients[1], offer_id)
offers = swap_clients[0].listOffers(filters={'offer_id': offer_id})
offer = offers[0]
offer_id = swap_clients[id_offerer].postOffer(coin_from, coin_to, amt_swap, rate_swap, amt_swap, SwapTypes.XMR_SWAP)
wait_for_offer(test_delay_event, swap_clients[id_bidder], offer_id)
offer = swap_clients[id_bidder].listOffers(filters={'offer_id': offer_id})[0]
assert (offer.offer_id == offer_id)
bid_id = swap_clients[1].postXmrBid(offer_id, offer.amount_from)
wait_for_bid(test_delay_event, swap_clients[0], bid_id, BidStates.BID_RECEIVED)
swap_clients[0].acceptBid(bid_id)
wait_for_bid(test_delay_event, swap_clients[id_offerer], bid_id, BidStates.BID_RECEIVED)
swap_clients[id_offerer].acceptBid(bid_id)
wait_for_bid(test_delay_event, swap_clients[0], bid_id, BidStates.SWAP_COMPLETED, wait_for=180)
wait_for_bid(test_delay_event, swap_clients[1], bid_id, BidStates.SWAP_COMPLETED, sent=True)
wait_for_bid(test_delay_event, swap_clients[id_offerer], bid_id, BidStates.SWAP_COMPLETED, wait_for=180)
wait_for_bid(test_delay_event, swap_clients[id_bidder], bid_id, BidStates.SWAP_COMPLETED, sent=True)
amount_from = float(ci_from.format_amount(amt_swap))
js_1 = read_json_api(1801, 'wallets')
@ -328,6 +345,13 @@ class BasicSwapTest(BaseTest):
if False: # TODO: set stakeaddress and xmr rewards to non wallet addresses
assert (node1_to_after < node1_to_before - amount_to_float)
node0_sent_messages_after: int = ci_part0.rpc_callback('smsgoutbox', ['count',])['num_messages']
node1_sent_messages_after: int = ci_part1.rpc_callback('smsgoutbox', ['count',])['num_messages']
node0_sent_messages: int = node0_sent_messages_after - node0_sent_messages_before
node1_sent_messages: int = node1_sent_messages_after - node1_sent_messages_before
assert (node0_sent_messages == (5 if reverse_bid else 6))
assert (node1_sent_messages == (6 if reverse_bid else 4))
def test_01_a_full_swap(self):
if not self.has_segwit:
return
@ -355,13 +379,8 @@ class BasicSwapTest(BaseTest):
ci_from = swap_clients[0].ci(coin_from)
ci_to = swap_clients[0].ci(coin_to)
# Offerer sends the offer
# Bidder sends the bid
id_offerer: int = 0
id_bidder: int = 1
# Leader sends the initial (chain a) lock tx.
# Follower sends the participate (chain b) lock tx.
id_leader: int = 1 if reverse_bid else 0
id_follower: int = 0 if reverse_bid else 1
logging.info(f'Offerer, bidder, leader, follower: {id_offerer}, {id_bidder}, {id_leader}, {id_follower}')

View file

@ -347,8 +347,8 @@ class BaseTest(unittest.TestCase):
logger.addHandler(stream_stdout)
diagrams_dir = 'doc/protocols/sequence_diagrams'
cls.states_bidder = extract_states_from_xu_file(os.path.join(diagrams_dir, 'xmr.bidder.alt.xu'), 'B')
cls.states_offerer = extract_states_from_xu_file(os.path.join(diagrams_dir, 'xmr.offerer.alt.xu'), 'O')
cls.states_bidder = extract_states_from_xu_file(os.path.join(diagrams_dir, 'ads.bidder.alt.xu'), 'B')
cls.states_offerer = extract_states_from_xu_file(os.path.join(diagrams_dir, 'ads.offerer.alt.xu'), 'O')
if os.path.isdir(TEST_DIR):
if RESET_TEST: