Skip to content

Commit be60698

Browse files
authored
Merge pull request #29 from t-bast/musig2-multi-hop-locks
Update multi-hop-locks to Musig2
2 parents 08aa31c + 82b4819 commit be60698

File tree

3 files changed

+60
-75
lines changed

3 files changed

+60
-75
lines changed

md/images/multi-hop-locks.png

540 Bytes
Loading

md/images/multi-hop-locks.txt

+10-10
Original file line numberDiff line numberDiff line change
@@ -22,21 +22,21 @@ participant Dave
2222

2323
== Update ==
2424

25-
Alice->Bob : add 2-of-2 MuSig(A,B) output with timelocked refund to A,\ncreate txB spending this to B, nonce(A,txB)
26-
Bob->Alice : nonce(B,txB), psig(B,txB,(z+y0)*G)
25+
Alice->Bob : add 2-of-2 MuSig(A,B) output with timelocked refund to A,\ncreate txB spending this to B
26+
Bob->Alice : psig(B,txB,(z+y0)*G)
2727
Alice->Bob : psig(A,txB,(z+y0)*G)
28-
Bob->Carol : add 2-of-2 MuSig(B,C) output with timelocked refund to B,\ncreate txC spending this to C, nonce(B,txC)
29-
Carol->Bob : nonce(C,txC), psig(C,txC,(z+y0+y1)*G)
28+
Bob->Carol : add 2-of-2 MuSig(B,C) output with timelocked refund to B,\ncreate txC spending this to C
29+
Carol->Bob : psig(C,txC,(z+y0+y1)*G)
3030
Bob->Carol : psig(B,txC,(z+y0+y1)*G)
31-
Carol->Dave : add 2-of-2 MuSig(C,D) output with timelocked refund to C,\ncreate txD spending this to D, nonce(C,txD)
32-
Dave->Carol : nonce(D,txD), psig(D,txD,(z+y0+y1+y2)*G)
31+
Carol->Dave : add 2-of-2 MuSig(C,D) output with timelocked refund to C,\ncreate txD spending this to D
32+
Dave->Carol : psig(D,txD,(z+y0+y1+y2)*G)
3333
Carol->Dave : psig(C,txD,(z+y0+y1+y2)*G)
3434

3535
== Settlement ==
3636

37-
Dave->Dave : create adaptor_sig(D,txD,(z+y0+y1+y2)*G),\nMuSig combine with psig(C,txD,(z+y0+y1+y2)*G),\nbroadcast txD with combined sig
38-
Carol->Carol : compute z+y0+y1 = adaptor_sig(D,txD,(z+y0+y1+y2)*G) - psig(D,txD,(z+y0+y1+y2)*G) - y2\nto create adaptor_sig(C,txC,(z+y0+y1)*G),\nMuSig combine with psig(B,txC,(z+y0+y1)*G),\nbroadcast txC with combined sig
39-
Bob->Bob : compute z+y0 = adaptor_sig(C,txC,(z+y0+y1)*G) - psig(C,txC,(z+y0+y1)*G) - y1\nto create adaptor_sig(B,txB,(z+y0)*G),\nMuSig combine with psig(A,txB,(z+y0)*G),\nbroadcast txB with combined sig
40-
Alice->Alice : compute z = adaptor_sig(B,txB,(z+y0)*G) - psig(B,txB,(z+y0)*G) - y0
37+
Dave->Dave : Create psig(D,txD,(z+y0+y1+y2)*G),\nsum with psig(C,txD,(z+y0+y1+y2)*G) and z+y0+y1+y2\nto create complete sig of txD and broadcast.
38+
Carol->Carol : Compute z+y0+y1 =\n sig(D,txD,(z+y0+y1+y2)*G)\n - psig(D,txD,(z+y0+y1+y2)*G)\n - psig(C,txD,(z+y0+y1+y2)*G) \n - y2,\nsum with psig(C,txC,(z+y0+y1)*G) and psig(B,txC,(z+y0+y1)*G)\nto create complete sig of txC and broadcast.
39+
Bob->Bob : Compute z+y0 =\n sig(C,txC,(z+y0+y1)*G)\n - psig(C,txC,(z+y0+y1)*G)\n - psig(B,txC,(z+y0+y1)*G)\n - y1,\nsum with psig(B,txB,(z+y0)*G) and psig(A,txB,(z+y0)*G)\nto create complete sig of txB and broadcast.
40+
Alice->Alice : Compute z =\n sig(B,txB,(z+y0)*G)\n - psig(A,txB,(z+y0)*G)\n - psig(B,txB,(z+y0)*G)\n - y0.
4141

4242
@enduml

0 commit comments

Comments
 (0)