Skip to content

Commit

Permalink
Payment Request: add comment to explain why we don't check the signat…
Browse files Browse the repository at this point in the history
…ure [skip ci]
  • Loading branch information
sstone committed Nov 13, 2019
1 parent 28b678e commit 323fd2a
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -473,6 +473,9 @@ object PaymentRequest {
val message: ByteVector = ByteVector.view(hrp.getBytes) ++ data.dropRight(520).toByteVector // we drop the sig bytes
val recid = bolt11Data.signature.last
val pub = Crypto.recoverPublicKey(signature, Crypto.sha256(message), recid)
// README: since we use pubkey recovery to compute the node id from the message and signature, we don't check the signature
// (it will
// If instead we read the node id from the `n` field (which nobody uses afaict) then we would have to check the signature
val amount_opt = Amount.decode(hrp.drop(prefix.length))
PaymentRequest(
prefix = prefix,
Expand Down

0 comments on commit 323fd2a

Please sign in to comment.