Protocol Nits and issues for LNPBP-3
Closed this issue · 0 comments
Suggested Nits:
Add to this number a previously-agreed values of
s
andc
, or, ifc
was not defined, use0
forc
value
by default. This will give a commitment-factorx = a + s + c
. Sinces
andc
is a 8-bit numbers anda
is a
32-bit number, the result MUST BE a 64-bit number, which will prevent any possible number overflows.
to ->
Add to this number a previously-agreed values ofs
andc
, (ifc
was not defined, use0
or the default value). This will give a commitment-factorx = a + s + c
. Sinces
andc
are 8-bit number anda
is a
32-bit number, as a resultmax(x)
wil be a 48-bit number which can be represented in a 64 bit integer without causing integer overflow.
Possible deviation from Impl.
Compute d as d = x mod n. The d will represent a number of transaction output which MUST contain a cryptographic commitment. All other transaction outputs under this protocol MUST NOT contain cryptographic commitments.
Let me know if I am missing something, but as per the implementation here, d
is the transaction index, not the number of outputs.
https://github.com/LNP-BP/rust-lnpbp/blob/2f6fee732417aad5c71fcd0120ed0db4b1e61061/src/bp/dbc/tx.rs#L35-L38
possible restructure of the statement
Compute d as d = x mod n. The d will represent the index of the output which MUST contain a cryptographic commitment. All other transaction outputs under this protocol MUST NOT contain any cryptographic commitments.