Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update multi-hop-locks to Musig2 #29

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified md/images/multi-hop-locks.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 10 additions & 10 deletions md/images/multi-hop-locks.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,21 +22,21 @@ participant Dave

== Update ==

Alice->Bob : add 2-of-2 MuSig(A,B) output with timelocked refund to A,\ncreate txB spending this to B, nonce(A,txB)
Bob->Alice : nonce(B,txB), psig(B,txB,(z+y0)*G)
Alice->Bob : add 2-of-2 MuSig(A,B) output with timelocked refund to A,\ncreate txB spending this to B
Bob->Alice : psig(B,txB,(z+y0)*G)
Alice->Bob : psig(A,txB,(z+y0)*G)
Bob->Carol : add 2-of-2 MuSig(B,C) output with timelocked refund to B,\ncreate txC spending this to C, nonce(B,txC)
Carol->Bob : nonce(C,txC), psig(C,txC,(z+y0+y1)*G)
Bob->Carol : add 2-of-2 MuSig(B,C) output with timelocked refund to B,\ncreate txC spending this to C
Carol->Bob : psig(C,txC,(z+y0+y1)*G)
Bob->Carol : psig(B,txC,(z+y0+y1)*G)
Carol->Dave : add 2-of-2 MuSig(C,D) output with timelocked refund to C,\ncreate txD spending this to D, nonce(C,txD)
Dave->Carol : nonce(D,txD), psig(D,txD,(z+y0+y1+y2)*G)
Carol->Dave : add 2-of-2 MuSig(C,D) output with timelocked refund to C,\ncreate txD spending this to D
Dave->Carol : psig(D,txD,(z+y0+y1+y2)*G)
Carol->Dave : psig(C,txD,(z+y0+y1+y2)*G)

== Settlement ==

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
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
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
Alice->Alice : compute z = adaptor_sig(B,txB,(z+y0)*G) - psig(B,txB,(z+y0)*G) - y0
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.
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.
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.
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.

@enduml
Loading