Closed Sosthene00 closed 3 years ago
Thank you for catching this up, you are welcome to do a PR with all of this fixes.
1) removing (instead of P)
2) fixing references to steps as you described everywhere
3) remove use of LNPBP2
tag (we are not talking about tag
variable from LNPBP1)
Actually I wonder if the whole paragraph still makes sense, since it starts with Runs LNPBP-1 commitment protocol on message
msg, the selected public key
Pand public key
S*with the following modification*
, but all those modifications are already described in LNPBP-1:
S
instead of P
==> Compute HMAC-SHA256 of the lnbp1_msg
using sum of public keys S
.F
is added to the P
(a single original public key), resulting in key T
==> Add two elliptic curve points: the original public key Po
and point F
, derived from the tweaking-factor. This will give resulting tweaked public key T
: T = Po + F
.LNPBP2
tag MUST BE used instead of LNPBP1
==> it seems that it's not the case anymorelnpbp1_msg
, composed of the original message prefixed with a single SHA256 hash of LNPBP1
string and a single SHA256 hash of protocol-specific tagOn further reading I noticed more parts that probably need to be update and/or clarified, I made a PR #106 with all this, it will be easier to discuss there.
I may have missed something, but I think the commitment procedure of LNPBP-2 might refer to a previous stage of LNPBP-1 at steps 4:
on the second step of the protocol (according to LNPBP-1 specification [12]) HMAC-SHA256 is provided with the value of S (instead of P), i.e. hence we commit to the sum of all the original public keys;
: I think this actually refers to step 4 of LNPBP-1, not step 2Compute HMAC-SHA256 of the lnbp1_msg using sum of public keys S. The resulting value is named tweaking factor f: f = HMAC-SHA256(lnpbp1_msg, S)
. Besides, it looks like this whole sentence is not useful anymore and could be deleted (or at the very least delete the(instead of P)
part.on the forth step of the protocol the tweaking-factor based point F is added to the P (a single original public key), resulting in key T
: it is actually step 8.if the number of original public keys defined at step 1 exceeds one, LNPBP2 tag MUST BE used instead of LNPBP1;
does seem a bit confusing since the procedure described in LNPBP-1 only mentions"LNPBP1"
while commiting with multiple keys. Or maybe we're talking about thetag
variable in LNPBP-1, but then maybe a little clarification could help.I noticed some typos or little issues, maybe I can directly open a PR to correct those if you're ok with that.