Oddbean new post about | logout
 ⚡We've added Lightning invoice decoder to Amboss Space!

Invoice decoders deliver insights about payment requests that can come in the form of an invoice, an LNURL, or a Lightning Address.

To demonstrate the insights you can derive, we've prepared a thread of wallet invoices!
https://m.primal.net/IflK.png 

Starting simple, here an invoice from BitcoinJungleCR, a custodial lightning wallet:
https://amboss.space/lightning-decoder?request=lnbc26530n1pnxr0krpp5fzk3u3h46zwu2h9c020kkagaez33fhfgwtk4e0hkdvtg56pk6tvsdqqcqzpuxqyz5vqsp5gtp6m6xc8663lth4a07mrf434u0ryzusdzhafc44ukl6ahyw6w0q9qyyssq0dzfdugg4d9sykwmk3t4vcecwqwxtd5qr2zaj4dnldmm52rsvaq93ecddzdxlpzsqt06qexnruerznzh22u50v79ajtun8c75k9gkyqpxx7wna

Similar setups include: zbd, walletofsatoshi ,  and Strike

This is a BOLT11 invoice where it pays to a single node destination.  Routing  Node Operators will use the Payee Pubkey information to discover new nodes to connect to so that the network can have a variety of routes to pay BTC Jungle CR reliably.

https://amboss.space/node/03797da684da0b6de8a813f9d7ebb0412c5d7504619b3fa5255861b991a7f86960

Next up in complexity, a BOLT11 invoice from @Breez_Tech, a self-custodial lightning wallet:
https://amboss.space/lightning-decoder?request=lnbc140270n1pnxr0sppp5rzurtshg5e6dk9zgewt3p3jm8t33t9vspq55u6huu2yxvew6v76qdrgyp7q5nmjv9hxwefq2dhxz6m9yp7zqcnjv4jh5w309ac8ymmxd9kx2hmfd4skweflv9hxjmtpds74xmnpddjjvcm0d3hhy020wfskuem9cqzzsxqrrssrzjqvgptfurj3528snx6e3dtwepafxw5fpzdymw9pj20jj09sunnqmwpapyqqqqqqz3rsqqqqlgqqqqqqgq9qsp5ck43qflj7v764wzwmu68nw4u8a7nc2sxh3jg25u5x43epza4fzyq9qyyssq0t9pjqz9fkyk0cgfp7salwgs42urzvkdnk8cscucmxm3xeuuw8ypu6ypwdn5adcq73wuq8y820aevtgnledpfclytq7jnfxr6p8tjgspcpvw3x

If you check the Payee Pubkey of the Breez invoice, you'll reach a page that says "Unable to find this node". This isn't a error; this reveals that @Breez_Tech is using "private" node destinations.

To help the lightning payment reach the destination, it will require Route Hints!
https://m.primal.net/IflV.png 

In the Routing Info is a Pubkey, revealing a well-connected 28 BTC capacity node that will convey the payment to the "private" node destination.
https://amboss.space/node/031015a7839468a3c266d662d5bb21ea4cea24226936e2864a7ca4f2c3939836e0?section=General
Services with similar setups include: MuunWallet (uses a swap service), ElectrumWallet (yes they do lightning!)

"Private node" here only means unannounced to the network (like not listed in the phone book), not a guarantee of privacy.

There are many reasons to use private nodes in practice and most of them are operational: load balancing, payment reliability, failover protection, etc.

Even more complex, we have @CashApp invoices, which include 2 separate paths to reach a private node destination. https://amboss.space/lightning-decoder?request=lnbc1pnxrdk6dqdgdshx6pqg9c8qpp59d8cvaf5209myfkn9wk67ywa5exyt230gjpkjs7dh0yxzczaqk4ssp5e8e6wehwurw4zdfs6lkj5s9my702vpxjs26zfyv3vmrw00x64k0q9qrsgqcqpcxqy8ayqrzjqv06k0m23t593pngl0jt7n9wznp64fqngvctz7vts8nq4tukvtljqz3rvvqq88sqqsqqqqqqqqqqqqqq9grzjqtsjy9p55gdceevp36fvdmrkxqvzfhy8ak2tgc5zgtjtra9xlaz97pmylyqqt0gqquqqqqqqqqqqqqqq9gwmef3kht3jvnnft2yqagtdr6qsp0mw00mcs334wmjakjxf7m0suy3dm0cjcr9vd03c500225tf4suxu9ufrsqrl2p3k748ctvlygm3cpcr888n

Instead of only one potential path to pay, there are now two which can be attempted. This allows one of the public nodes to undergo maintenance while the other remains online to ensure higher payment reliability.

Makes sense when you have 50 million potential users!

Okay now it gets crazy complex: @fedibtc Bravo includes not only two separate routing paths, but there are multiple hops in the second path!
https://amboss.space/lightning-decoder?request=lnbc14020n1pnxr074dqqpp5xzdnu633p42vkzff63smmvwnq6sceaulhv7dzsjznwagnapa56xqsp57g7ryur6wu5nm8jujm0cud8mtuhl7xapzrvlz0dqk5p9ct6ultgq9qrsgqcqpjnp4qv0q27a396eh8yxewxpmnydkwghn4rj4f79n3305e9hats65u4ctjxqyz5vqrzjqtcv0de3efq29pwhcy42r3w8cl92gkvd84knfyzvxu2v6r28s5nyqqqqqqqqqqqqpvqqqqqqqqqqqqqqrcr9yqdjfz0gc5xwxwxandhgy66k4hc873u5fgv2vx65ak0crct2pfyr7zrxmuuqq2ccqqyqqqqlgqqqqqqgq2qp0p3ahx89ypg596lqj4gw9clru4fze357k6dysfsm3fngdg7zjvsqqqqqqqqqqqq9sqqqqqqqqqqqqqq0qg3ttsncut24rz2a3ztnzh739rqad26d2gta7p4frktpynac6c3rpdz3kfexv44jqd3tqjkuwyqp97laun39nf2p0vp7hf5afdnaerxqpt97cd0

Look how long the invoice string is! That is a lot of data to pack into an invoice, which can also make the invoices more difficult to scan as QR codes or be unable to fit into a tweet!

Setups like this one are fascinating, but each decision is a tradeoff.

In the 2-hop path, the first stop is @LQWDTech followed by "Henwen 🐷", which was also used in the 1-hop path.

This must make Henwen one of the "Gateways" into the ecash Federation.
https://amboss.space/node/0364913d18a19c671bb36dd04d6ad5be0fe8f2894314c36a9db3f03c2d414907e1
https://amboss.space/node/02f0c7b731ca40a285d7c12aa1c5c7c7caa4598d3d6d34904c3714cd0d47852640

Mind blower time. Let's talk about @AquaBitcoin invoices.
https://amboss.space/lightning-decoder?request=lnbc10u1pnx8q58sp5cvup8kkedrjfam0yqvhtydml82fg9tmpep8nxcqhm0s8jvppac9spp52zywkv3exryqemtuphutpfrmh6qz09epvln74y0mjn3sg3fzyqrqdpz2djkuepqw3hjqnpdgf2yxgrpv3j8yetnwvxqyp2xqcqz95rzjqgjw2dner5zaawm3q3tj30wgu8k56gsg9seprne6hyr7kj4v3gmpxzzxeyqq28qqqqqqqqqqqqqqq9gq2y9qxpqysgqwks76mx5zmy2gyvzlrqdpwqdru3m0rnrdm7nek7xh9398upyhfxsy8txfhm07hmvzdw7sajstv2zt75hjdhhsktyfx6edz4jhtm5cdqpx69erp

Aqua invoices only include a single route hint, but the route hint is to a private node!

The payee pubkey is a public node, @Boltzhq, which swaps between the @lightning network and @Liquid_BTC.

Boltz is using "magic routing hints" allowing Liquid to Liquid payments within LN.
https://docs.boltz.exchange/v/api/magic-routing-hints


We hope you learned a lot from this thread!
What else would you like to know about invoices?
What other insights can you gain from this tool? 
 What data do you store from this decoder? Is this something I could run myself and self host?  
 We don't store any requests from this. You can definitely run this yourself! Basic open source decoders are available on GitHub.  
 Is the decoding done on the client side? Did you write a tool for it or is it based on lightweight-bolt11-decoder?

If you did write a tool for it, is it open source and typed?

I have got about a gazillion projects that could use that lmao 
 The decoding is done server side and based off the open source decoders.

If it's useful, you can use our GraphQL API for fast responses. 
 I went full lightning nerd here, but you can derive a ton of information about infrastructure from a simple lightning invoice: 

https://x.com/ambosstech/status/1800183281071374524?t=33EkRUIgVUa6xcquZFHETg&s=19

nostr:nevent1qqsdq0a5ke84ewkk9srkw88rwc3wxxg2ljal0pjps094a4rxjkf852cpz4mhxue69uhhyetvv9ujuerpd46hxtnfduhsygp27q0q6673h8amnc75x9tav3vslvnae772hc58sjjcxtshhmac0vpsgqqqqqqshy3ksp 
 Shout out bitcoin jungle 
 Very useful, thanks, but I think this should be in a separate and dedicated tool section and be able to link it and save on browser bookmarks 
 Tools section is in development 💪

Right now, the decoder is a section on the amboss.space homepage. 
 Neat. What does this do in excess of the open source decoders? 
 I dunno, but this one works great

https://github.com/andrerfneves/lightning-decoder 
 It's based on this one, but includes lightning address, LNURL, and it interoperates with our explorer.