diff --git a/md/images/multi-hop-locks.png b/md/images/multi-hop-locks.png index e1b11f6..9dd1841 100644 Binary files a/md/images/multi-hop-locks.png and b/md/images/multi-hop-locks.png differ diff --git a/md/images/multi-hop-locks.txt b/md/images/multi-hop-locks.txt index 2741449..cf97521 100644 --- a/md/images/multi-hop-locks.txt +++ b/md/images/multi-hop-locks.txt @@ -7,7 +7,7 @@ participant Dave == Setup == - Dave->Alice : z*G + Dave->Alice : z*G note left z can be a proof of payment end note @@ -15,10 +15,10 @@ participant Dave note left Alice sets up tuple (L,y,R) for every hop end note - Alice->Alice: z*G, y0, (z+y0)*G - Alice->Bob : (z+y0)*G, y1, (z+y0+y1)*G - Alice->Carol: (z+y0+y1)*G, y2, (z+y0+y1+y2)*G - Alice->Dave : (z+y0+y1+y2)*G, y0+y1+y2 + Alice->Alice : z*G, y0, (z+y0)*G + Alice->Bob : (z+y0)*G, y1, (z+y0+y1)*G + Alice->Carol : (z+y0+y1)*G, y2, (z+y0+y1+y2)*G + Alice->Dave : (z+y0+y1+y2)*G, y0+y1+y2 == Update == @@ -34,8 +34,9 @@ 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 +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 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 +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 @enduml diff --git a/md/multi-hop-locks.md b/md/multi-hop-locks.md index 051adf7..51a6142 100644 --- a/md/multi-hop-locks.md +++ b/md/multi-hop-locks.md @@ -26,97 +26,105 @@ Protocol ![multi-hop-locks](images/multi-hop-locks.png) -In the setup phase the payee chooses `z` at random and sends the payer `z*G`. -The payer will set up the multi-hop locks such that a successful payment reveals `z` to her and only her. +In the setup phase the recipient chooses `z` at random and sends the sender `z*G`. +The sender will set up the multi-hop locks such that a successful payment reveals `z` to her and only her. Knowledge of `z` can be a proof of payment which is similar in concept to payment preimages in the Lightning v1.0 (see section below for details). -We picture the payment starting from the payer on the left side through intermediate hops to the payee on the right side. -The setup phase continues with the payer setting up a tuple `(Li,yi,Ri)` consisting of the *left lock* `Li` and *right lock* `Ri` for every hop `i` in the following way: -Every `yi` is a scalar uniformly chosen at random. -The payers own left lock `L0` is set to `z*G` which was previously received from the payer. -Now for every lock `Ri` for hop `0<=i