Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.
Sign up to join this communityAnybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
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
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())
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments