I'm trying to get the payees public key (destination node) from the payment request. You can see an example here.

In the source code for (https://lightningdecoder.com/) it seems like they get it from a tag or tag 19 (?) but I can't find this information in the decoded payment requests i get from LND:


Does any one know how to get this? Preferably using Go and the invoice returned by LND

enter image description here

  • 1
    It's not quoite a duplicate question but I think the answer you seek for was given in the past to a similar question: bitcoin.stackexchange.com/a/96205 Jun 13, 2022 at 20:32
  • Thank you Rene, I think I can solve my question based on the answer you posted above. I’ll update this post once I have an example of the solution for future reference here. Jun 15, 2022 at 8:34

1 Answer 1


Here is the solution I ended up using:

// var invoice *lnrpc.Invoice

inva, err := zpay32.Decode(invoice.PaymentRequest, &chaincfg.MainNetParams)
if err != nil {
    return err

fmt.Sprintf("%x", inva.Destination.SerializeCompressed())

Alternatively, I think you can replace the fmt.Sprintf with hex.EncodeToString


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.