Lightning Addresses for EVERYONE on Hive!

avatar
(Edited)

WORKING AGAIN!

I think it's all back to normal.... whatever normal actually is....

Earlier today 2022-05-20:

Coingeck's @coingecko 's API is still not working and I can't restart without it. Following this I will obviously work on adding another price service so I'm better prepared for this kind of thing.... living and learning!

Overnight Coingecko's API started going wrong and so I've got to clean up some stuff, all should be working again soon I hope.


You know that thing on Twitter where people (mostly) in the US can receive BTC Lightning tips direct through Twitter?

Well now literally EVERY ACCOUNT ON HIVE can receive Lightning tips!

untitled.gif

If you like my work on bridging Lightning and Hive, please vote for my continuation proposal:


Support Proposal 222 on PeakD
Support Proposal 222 with Hivesigner
Support Proposal 222 on Ecency


You heard it right. Your very own human memorable Lightning Address looks just like this (yes it does look just like an email address):

[email protected]

Just replace brianoflondon with your own Hive account name. Any BTC lightning sent to that address will end up as Hive in your Hive account.

You can also get yourself a QR code like the one I have at the bottom of the page.

This link will give you a QR code: just replace my hive account name with your own.

https://v4v.app/v1/lnurlp/qrcode/brianoflondon

You can save that image and put it anywhere.

And a special shout out to all Hive Devs: you can add "tip with Lightning" buttons to any Hive UI. You just need to call the api to generate the QR code (you can even cache this, it doesn't change!).

Demo

Hive Lightning Address demo

I've sped up the typing part but the rest of this is real speed. The wallet I'm using here is Breez which is a non-custodial wallet (meaning I really do hold the keys). There are custodial wallets which might shave a few seconds off the Lightning sending time.

How it works

Behind the scenes there is quite a lot going on to make this happen.

As I've written extensively before, Lightning is not a blockchain based crypto system. Lightning can only be received by a Lightning Node which is online and working 24/7 and which has "channels" open to the rest of the Lightning Network.

So in order for you to "receive" Lightning on a static address, just as you can receive Hive on your username or BTC on an address you can generate, things get interesting.

LNURL

What Lightning needed was a way to have a pointer to something on the web which could then generate a Lightning Invoice as a way to receive funds. I kind of built this from scratch myself in order for my v4v.app system to receive Hive and send Lightning: behind the scenes I don't really just receive Lightning, I generate an invoice which a mobile wallet can pay.

DIY was the way I learned

Having built this all from scratch myself, I then realised I had built most of the components I would need to implement something which has been growing in adoption on the Lightning Side: Lightning Addresses. There's a fancy website to tell you all about this and it gives you dozens of ways to grab a Lightning Address but almost all are custodial.

There is a way to set this up with your own node but it's seriously tedious work (here's a 20 min video for you to plough through.

The Flow

Part 1 flow

The background for what is going on here is in this Github repo: LNURL RFC. I'm specifically making use of LUD-01, LUD-06 and LUD-12

  • LUD-01: Base LNURL encoding and decoding
  • LUD-06: payRequest base spec
  • LUD-12: Comments in payRequest.

Zeus Wallet Lightning Address Payment screen

When a compatible Lightning wallet scans the QR Code I produce or a user types an address like [email protected] into a compatible wallet they are presented with a screen like this screen from Zeus. There's a visual reminder of the destination (my avatar), space to enter an amount between 1,000 and 100,000 Sats and space for an optional comment.

Part 1 technical

The Lightning Address is encoded in the QR Code as a BECH32 string and actually looks like this:

lightning:LNURL1DP68GURN8GHJ7A35WCHXZURS9UH8WETVDSKKKMN0WAHZ7MRWW4EXCUP0VFEXJCTWDANXCMMWV3HKU64WYHS

The lightning: prefix is mostly to help Mobile apps route these strings. On my iPhone, the Breez app grabs these strings automatically if the camera sees a QR code with this encoding. On Android the same thing happens but I believe you have the option to chose which app takes over.

The Lightning app then sends a GET request to the URL encoded in that string which is actually this:

https://v4v.app/.well-known/lnurlp/brianoflondon (you can click on it, you'll get some JSON).

If you manually type [email protected] into a Lightning wallet as an address it just reorganizes that to make the same call.

That GET request returns a JSON which looks like something like this:

{
  "tag": "payRequest",
  "callback": "https://v4v.app/v1/lnurlp/callback/brianoflondon?no_image=true",
  "minSendable": 1000000,
  "maxSendable": 100000000,
  "metadata": "[[\"text/plain\", \"v4v.app Lightning to Hive @brianoflondon\"], [\"text/identifier\", \"[email protected]\"], [\"text/long-desc\", \"Sending Lightning to Hive account: @brianoflondon\"]]",
  "commentAllowed": 1000
}

However I've actually excluded a big chunk of data from the "metadata" field because an encoded version of the Hive avatar is sent in there as well.

Part 2 flow

The user can now be shown a range for the amount to send and an image to help identify where the payment is going: that's where I use the Hive avatar. The user can then add a comment and hit send, there will be one more confirmation and then the sats will be sent.

Part 2 technical

The wallet app can now call the "callback" address with the parameters set by the user. When that happens my API generates a unique invoice specifically for this payment in the form of another BECH32 encoded string. This is the "regular" Lightning way of making exchanges of value.

Once the Wallet receives that invoice, it pays it.

Part 3 Hive

From here on in the rest of my @v4vapp apparatus takes over. It watches incoming payments to my Lightning node and acts on them based on various metadata in the comment field and embedded in the Invoice itself (which my software generated in part 2 above). I receive the sats and immediately make a conversion to Hive and send the Hive out. That bit is generally quicker than the Lightning side.

And the final result....

You Got Hive!


Support Proposal 222 on PeakD
Support Proposal 222 with Hivesigner
Support Proposal 222 on Ecency


Send Lightning to Me!



0
0
0.000
116 comments
avatar

I appreciate every work you put to this which is really nice and awesome and also I have voted on your proposal as well to appreciate your good work.

0
0
0.000
avatar

I shall definitely use this. I have a qr code, then I let people scan the code to pay me. Its so useful, I will try it out when I send this comment !

0
0
0.000
avatar

This some awesome stuff!

0
0
0.000
avatar

Wow, that’s great! Will have to test it if it really works. 👏🏻 Excellent work.

0
0
0.000
avatar

Really awesome

I did wonder if one could tip accounts with btc here like we do hive.

But doesn't it defeat the purpose? 🤔

0
0
0.000
avatar

You know that thing on Twitter where people (mostly) in the US can receive BTC Lightning tips direct through Twitter?

Well now literally EVERY ACCOUNT ON HIVE can receive Lightning tips

This is the only part of this post that makes sense to me.. the rest is nerdery and jibberish.. but that's good.. we need more nerds building shit here.. great job. Proposal supported.

!PIMP

Think you can invent a !NERD token next? 🤣😂

0
0
0.000
avatar

We don't need to know how all tjses things work thanks God.
We just need to know that there are great Devs on hive that can make it happen for us.

Thanks Brian. This looks amazing.

0
0
0.000
avatar

You can receive Satoshis which get converted to HIVE which you can convert to HBD..

...which can be used to buy weed.

Skip the jibberish and get to the use cases.

Posted Using LeoFinance Beta

0
0
0.000
avatar
avatar

This is a great work, thank you for making it happens real good 🤗

0
0
0.000
avatar

Lightning is not a blockchain based crypto system.

I thought all crypto was based on the blockchain. Mehn, I got a lot to learn with this crypto thing.

0
0
0.000
avatar

This is really awesome! Thanks for working int his :D

0
0
0.000
avatar

This looks incredible, although reading all that confuses me, there are still many things I don't understand about Hive and the crypto world, I don't know much.

But what you show here looks awesome. I have to read it again in greater detail. Understanding how the funds can get to my Hive account, but from the side of the person giving the advice I don't quite understand that part of what to do. Maybe I read it too fast or got confused by so many things I don't understand. But it looks super fabulous, thank you very much @brianoflondon 😎

0
0
0.000
avatar

You are the real MVP BOL. :')

0
0
0.000
avatar

Thank you for this Brain.

Any BTC lightning sent to that address will end up as Hive in your Hive account

It worked perfectly for me :)

Screenshot 20220519 at 13.23.49.png

Posted Using LeoFinance Beta

0
0
0.000
avatar

You need to try it once more Nathan. Let's see if it works again.

image.png

0
0
0.000
avatar

This is exactly why I put the avatar in the middle of these :-) Very important part of the plan!

0
0
0.000
avatar

So there's only one time we can generate this unique QR??

Posted Using LeoFinance Beta

0
0
0.000
avatar

You can generate it as much as you like but it shouldn't change. Behind the scenes it's just a complicated way to encode this address:

https://v4v.app/.well-known/lnurlp/finguru?no_image=false

So unless I change something, that doesn't really need to change so the QR code remains static.

0
0
0.000
avatar
(Edited)

Got it. Just to confirm one last time, my QR code will not change even if I change my DP?

Posted Using LeoFinance Beta

0
0
0.000
avatar

i was wondering this too... if DP means profile pic that is...

0
0
0.000
avatar

no worries, just saw below. So each time you generate a new qr code it updates your profile pic in the centre. Thats cool. Proposal supported btw. amazing work

0
0
0.000
avatar

You deserve to be voted as witness, which I just did. Thank you for sharing this with us dear.

0
0
0.000
avatar

This is so cool! Thank you for helping to grow our ecosystem

0
0
0.000
avatar

I couldn't get [email protected] to work with Strike. However, invoicing through v4v does work with Strike. I'll have to play with another Lightning wallet.

This is the bridge to HIVE I have been waiting for. I look forward to seeing the platform scale. Although, this alone is huge.

0
0
0.000
avatar

Absolutely brilliant!

Now we just have to wait until the BTC Lightning network becomes useful :)

0
0
0.000
avatar

What if I change my Profile Picture?

0
0
0.000
avatar

You can regenerate a new QR and it'll put your new image in it.

0
0
0.000
avatar

Wow, this is great news and it makes the process simple for everyone here on Hive. I think this is a great addition to the entire blockchain.

Posted Using LeoFinance Beta

0
0
0.000
avatar

The amount of work you did by yourself is impressive, especially as you started from scratch. That's super cool! Too bad I won't be able to connect to the CTT show tonight.

Cheers!

0
0
0.000
avatar

This is freaking EPIC!!! We need got all use these addresses on Twitter for our usernames! Changing mine now actually!

untitled.gif

0
0
0.000
avatar

Question… How would we approve the invoice on our end… For instance I attempted to send from Cash app and they require an invoice approval.

I am going to try again from my Blue wallet which is non custodial to see how it reacts there.

Just something I ran into…

0
0
0.000
avatar

Can this (or anything similar) be used by exchanges as a transfer method, when people buy/sell Hive and/or Hive Dollars (HBD)?

0
0
0.000
avatar

Well my friend!!! lets try this out!!!

image.png

0
0
0.000
avatar

Proposal voted!

0
0
0.000
avatar

Esta es una valiosa información, muchas gracias por compartir

0
0
0.000
avatar

Good work! It would be interesting to see this integrated clearly into onboarding processes to make initial power ups of new accounts more efficient.

0
0
0.000
avatar

Thank you so much for this! This is the kind of work that makes HIVE to excel! I already support your proposal!!! Much success in your endeavors!!! I can't give much in gratitude but just a few tokens !PIZZA !PGM !LOLZ !CTP !HBIT


cpol.png

0
0
0.000
avatar

Sent 0.1 PGM - 0.1 LVL- 1 STARBITS - 0.01 MOTA - 0.05 DEC - 15 SBT tokens to @brianoflondon

remaining commands 1

BUY AND STAKE THE PGM TO SEND A LOT OF TOKENS!

The tokens that the command sends are: 0.1 PGM-0.1 LVL-2.5 BUDS-0.01 MOTA-0.05 DEC-15 SBT-1 STARBITS-0.00000001 BTC (SWWAP.BTC)

image.png
Discord image.png

Support the curation account @ pgm-curator with a delegation 10 HP - 50 HP - 100 HP - 500 HP - 1000 HP

Get potential votes from @ pgm-curator by paying in PGM, here is a guide

I'm a bot, if you want a hand ask @ zottone444


0
0
0.000
avatar

That is amazing! Thank you for what you are doing and just voted for your proposal.

Posted Using LeoFinance Beta

0
0
0.000
avatar

So by using the Lightning address you can buy Hive with bitcoin without using an exchange, and it goes straight to your Hive account?

Does it work in reverse? Say you send Hive to the Lightning node and receive satoshis?

0
0
0.000
avatar

This is pretty cool, I am curious how much it ends up getting used.

0
0
0.000
avatar

Is there a % cut from what is tipped outside of transaction fees?

0
0
0.000
avatar

I'm taking 200 sats + 0.8% per transaction. That's about as low as I think it should be. I'm taking rates from Coingeko.

0
0
0.000
avatar

Man....This is just awesome on so many levels!

Thank you for all the hard work you put into this community. Appreciate you sir!

0
0
0.000
avatar
(Edited)

Hello Brian, there seems to be a bug in your code. I received multiple HIVE payments for a single lightning transmission.

image.png

0
0
0.000
avatar

Yes! Coingeko's API has broken and this has caused my code to malfunction. I've turned everything off right now and will try to work out what's going on. and fix.

0
0
0.000
avatar

I send you the Hive I received later

0
0
0.000
avatar

Thank you, i'm still trying to figure out what happened. Did you also send me (separately) a payment direct to me as lightning?

0
0
0.000
avatar

Yes, i sent you two Times 1000 sats.

0
0
0.000
avatar

Don't send me anything back yet, there was a huge problem at my end caused by @coingecko 's API not working (and me not anticipating that failure properly).

I'll work through all the problems and let you know. I think you probably got around $5 worth of Hive more than you should but it will take me a while to untangle this and Coingecko's price feed is still not working anyway.

0
0
0.000
avatar

5 years this has been happening to me, it started here, around people that are still here. Homeland security has done nothing at all, they are not here to protect us. Dont we pay them to stop shit like this? The NSA, CIA, FBI, Police and our Government has done nothing. Just like they did with the Havana Syndrome, nothing. Patriot Act my ass. The American government is completely incompetent. The NSA should be taken over by the military and contained Immediately for investigation. I bet we can get to the sources of V2K and RNM then. https://peakd.com/gangstalking/@acousticpulses/electronic-terrorism-and-gaslighting--if-you-downvote-this-post-you-are-part-of-the-problem

0
0
0.000
avatar

Awesome work, Brian! You've got my vote. I also like how Taskmaster put it: Bitcoin's Lightning Network - 2nd layer for Hive. :)

Posted Using LeoFinance Beta

0
0
0.000
avatar

Bro you deserve a whole storm for this, congratulations for your excellent work.

0
0
0.000
avatar

Supported, amazing stuff, well done

0
0
0.000
avatar

This is next level stuff… appreciate these tools man 🫡

0
0
0.000
avatar

You're a freaking genius dude. This is exactly what Hive has needed for the longest time. Thank you, thank you, thank you.

0
0
0.000
avatar

This is too cool.

I used the lightning the other. Super fast.

0
0
0.000
avatar

Thanks for all your hard work on this project @brianoflondon :-)
I think this is a great feature that will help the community keep moving forward as more people adopt micro payments and tipping using the LN. Your proposal has a vote from me!

0
0
0.000
avatar

This is really amazing! Congratz! 💜

0
0
0.000
avatar

Greetings friend @brianoflondon pleased to say hello. I have been testing the lightning bridge, trying to send some satoshis to my wallet Tippin.me but there has been no way for the application to take the invoice. In the image you can see the message it gives me every time I try.

Saludos amigo @brianoflondon complacido de saludar. He estado probando el puente Lightning, tratando de enviar algunos satoshis a mi billetera Tippin.me pero no ha habido manera de que la aplicacion me tome el invoice. En la imagen puedes ver el mensaje que me entrega cada vez que lo intento.

image

Now, I sent satoshis to my Hive account and this transaction was carried out without problems and very quickly. My question: what could be happening? Are there any restrictions with this wallet or something like that? Or am I doing it wrong? I know how to thank you very much for your support and help. Greetings.

Ahora bien realice un envió de satoshis a mi cuenta de Hive y esta transacción se realizo sin problemas y muy rápido. Mi consulta: ¿Que puede estar sucediendo? ¿Existe alguna restricción con esta billetera o algo por el estilo? ¿O sera que lo estoy haciendo mal? Mucho sabre agradecer tu soporte y ayuda. Saludos.

0
0
0.000
avatar

You’re right my code has a problem with Tippin. I’ll look at this today and hopefully get it working. Thanks for finding this!

0
0
0.000
avatar

Fixed it and it should be working with Tippin now. I sent you 2000 sats :-)

0
0
0.000
avatar

@brianoflondon, huge respects for your continuous and tireless work!!

I've tried just now to send some BTC to Hive, from a "Chivo" wallet, and it seems to not be compatible with my v4v.app LN address (nor its QR code version). It does recognize the address - a green check shows up when I type it - but when pressing the "next" button, nothing happens, contrarily to when the recipient is a LN contact added through his phone number.

Have you received feedback from "Strike" users, indicating that it does work on that app?

0
0
0.000
avatar

Wow, this is some amazing work Brian. I'll keep tabs on this project, your work will be supported. Keep going mate!!!

0
0
0.000
avatar

This is absolutely amazing work! Thank you so much for your brilliant contribution to our glorious Hive Blockchain!

img_0.5611251430334441

0
0
0.000
avatar

Show me normal and I'll give you a some HIVE.

Bit in awe of your abilities. Very cool! I'll follow along and learn some new things. 👍

0
0
0.000
avatar

I think it's all back to normal.... whatever normal actually is....

😆 Yeah.

Found it. Very clever!

Posted Using LeoFinance Beta

0
0
0.000
avatar

What about doing it in the opposite direction, say Hive to BTC?

0
0
0.000