forked from lightning/bolts
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
offer_id: fix calculation method (breaking change).
The "LnAll" nonce adjacent each TLV leaf did *not* hide other values from a merkle proof, since the nonce had to be revealed as part of such a proof, and the value was the same on every other leaf! Each "nonce" leaf is now based on all the other leaves, but tweaked for this particular tlv. Real cryptographers wanted a separate secret for the nonce here, but: 1. It complicates the calculation of the merkle tree, requiring an additional non-included field. 2. There is already a suitable secret (payer_info) in-tree. 3. We can always add a dummy nonce later without changing the merkle algo. I also changed the prefix use for branches, nonces and leaves from a simple prepend `tag` to the BIP-340 prepend SHA(`tag`)|SHA(`tag`) which can be optimized (we already used this for the signatures themselves, now we use it for the merkle calc too). Signed-off-by: Rusty Russell <[email protected]>
- Loading branch information
1 parent
99be822
commit 56ff7fa
Showing
1 changed file
with
28 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters