HTML Lightning Links

Written by: Alp Uçkan

Seasoned IT consultant and web developer with a passion for helping businesses succeed online. Founder of Islamic Marketplace and ethical web development.

Did you know that it’s actually very easy to put up a Bitcoin donation button on a website?

All you need is plain HTML. No JavaScript, no fancy backend programming.

You just use the lightning protocol handler in a link’s href attribute. Lightning links allow users to interact with the Lightning Network directly from their web browser.

This is a standard web link which opens another URI in a web browser:

<a href="https://somewebsite.com/somepage">a link to another web page</a>

This is an email link, which opens your system’s default email program:

<a href="mailto:some@email.address">send me an email</a>

And this is a Lightning link:

<a href="lightning:my@walletofkobayashi.com">Send me some Sats!</a>

If you click a lightning link like this in a desktop web browser and have Alby installed, the Alby authentification dialog will pop up and after that request a connection to your Lightning address.

If you tap this link on a phone, the system will ask which Lightning app to open.

on phone.png 295x300 1

But not only that. Here are some more examples of how to use Lightning links to open external Bitcoin Lightning apps:

<a href="lightning:app://getalby/payinvoice?invoice=lnbc10u1px03j9n4pqwv67890">Pay with Getalby</a>
<a href="lightning:app://zeus/openchannel?node=02e0d304ea61db67dcee3c3c4b53b1c43e3ed0a52e369cc86fe6e3562579739aa7@wn6a26lrsaogs3dz2xm4nckoolpkqfm72q3vslspksqa2vcpb24wtjad.onion:9735">Open channel with Zeus</a>
<a href="lightning:app://strike/deposit">Deposit to Strike</a>

Overall, Lightning links are a powerful tool that can be used to open external Bitcoin Lightning apps. This makes it possible to create links that can be used to send and receive payments, open channels, and interact with other Lightning applications.

0 Comments

Read on