Skip to content

Commit

Permalink
Clarify numerical comparison of pubkeys (#743)
Browse files Browse the repository at this point in the history
We are using lexixographic order (which is the same as big-endian
when inputs have the same size, such as compressed public keys).
  • Loading branch information
t-bast authored Feb 18, 2020
1 parent a2afdfd commit dcbf858
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions .aspell.en.pws
Original file line number Diff line number Diff line change
Expand Up @@ -375,3 +375,4 @@ GitHub
IRC
bitmasks
CSPRNG
lexicographically
2 changes: 1 addition & 1 deletion 03-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Most transaction outputs used here are pay-to-witness-script-hash<sup>[BIP141](h

`2 <pubkey1> <pubkey2> 2 OP_CHECKMULTISIG`

* Where `pubkey1` is the numerically lesser of the two `funding_pubkey` in compressed format, and where `pubkey2` is the numerically greater of the two.
* Where `pubkey1` is the lexicographically lesser of the two `funding_pubkey` in compressed format, and where `pubkey2` is the lexicographically greater of the two.

## Commitment Transaction

Expand Down
4 changes: 2 additions & 2 deletions 07-routing-gossip.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@ The origin node:
as specified in [BOLT #2](02-peer-protocol.md#the-funding_locked-message).
- Note: the corresponding output MUST be a P2WSH, as described in [BOLT #3](03-transactions.md#funding-transaction-output).
- MUST set `node_id_1` and `node_id_2` to the public keys of the two nodes
operating the channel, such that `node_id_1` is the numerically-lesser of the
two DER-encoded keys sorted in ascending numerical order.
operating the channel, such that `node_id_1` is the lexicographically-lesser of the
two compressed keys sorted in ascending lexicographic order.
- MUST set `bitcoin_key_1` and `bitcoin_key_2` to `node_id_1` and `node_id_2`'s
respective `funding_pubkey`s.
- MUST compute the double-SHA256 hash `h` of the message, beginning at offset
Expand Down

0 comments on commit dcbf858

Please sign in to comment.