user13061: 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:
https://github.com/andrerfneves/lightning-decoder/blob/0fd4bdcd9ec01e8bacd0a475543186ad2de3fe27/src/lib/bolt11.js#L386-L394
Does any one know how to get this? Preferably using Go and the invoice returned by LND


user13061: 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
hex.EncodeToString(inva.Destination.SerializeCompressed())


13061: <p>I'm trying to get the payees public key (destination node) from the payment request. You can <a href="https://lightningdecoder.com/lnbc4300n1p320r89pp59wlvxy3dky9t69q5jx5yupe9mrsxt8yp5dgwe3dnqn9fnjmz0zfsdp8xgcryv3dxqmj6vfn2scnjw33x5argwfwxv6nwkscqzpgxqyz5vqrzjq0nfr7qlprzkl2rke380tj0gkunm66pv7dtqt0396jrq02qz2fs9xzeqeyqqyucqqqqqqqqqqqqzwrcq9gsp5hc5nutnjdvalz4x3a8972s3rj4smh5c9hq857w2ksx357x34xx2q9qyyssq49mawcvxvr0faestf7f5xy8rnfpn9ls3uwjlkpsudk8lh9w9d2p5nal7plje0dfq54ww66pr6hgwucakp78k3ntcmxtsm9frpewm4ycq7sltp5" rel="nofollow noreferrer">see an example here</a>.</p>
<p>In the source code for (<a href="https://lightningdecoder.com/" rel="nofollow noreferrer">https://lightningdecoder.com/</a>) 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:</p>
<p><a href="https://github.com/andrerfneves/lightning-decoder/blob/0fd4bdcd9ec01e8bacd0a475543186ad2de3fe27/src/lib/bolt11.js#L386-L394" rel="nofollow noreferrer">https://github.com/andrerfneves/lightning-decoder/blob/0fd4bdcd9ec01e8bacd0a475543186ad2de3fe27/src/lib/bolt11.js#L386-L394</a></p>
<p><strong>Does any one know how to get this?</strong> Preferably using Go and the invoice returned by LND</p>
<p><a href="https://i.stack.imgur.com/48RPK.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/48RPK.png" alt="enter image description here" /></a></p>
 13061: <p>Here is the solution I ended up using:</p>
<pre><code>// var invoice *lnrpc.Invoice

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

fmt.Sprintf(&quot;%x&quot;, inva.Destination.SerializeCompressed())
</code></pre>
<p>Alternatively, I think you can replace the <code>fmt.Sprintf</code> with <code>hex.EncodeToString</code></p>
<pre><code>hex.EncodeToString(inva.Destination.SerializeCompressed())
</code></pre>
