Building bitcoin lightning apps for the web has become a lot easier. Developers can rely on a better set of tools and building blocks. Hence the development of such apps enjoys increasing popularity. This article presents selected projects that took part in the Legends of Lightning tournament. It will have a closer look at how they manage to create a seamless user experience for bitcoin payments on the lightning network using the lightning web standard (WebLN).
Legends of Lightning
Legends of Lightning is a global online tournament for makers to learn, connect, collaborate, and build innovative applications and tools with bitcoin and lightning. Over several weeks makers accelerated their bitcoin projects through mentorship in design, development, and lightning integration. They formed teams to hack on new or existing projects and competed for up to three BTC in prizes. Since the start of the tournament 73 projects registered. That's an amazing number and clearly shows the interest of developers, designers and creators to build on bitcoin and lightning. The team behind bolt.fun, the organizer of the tournament, managed to bootstrap an active developer community during the last twelve month. After two hackathons earlier this year, the Legends of Lightning tournament is another milestone and sets the ground for even more bitcoin apps in terms of number, quality, and diversity.
Using existing building blocks
An ever-evolving ecosystem of building blocks facilitates the development of these apps. They abstract complexity, automate necessary services and provide important know-how. Just to name a few related to the lightning network in particular:
- Services and tools to bootstrap lightning nodes with Voltage, Amboss, bolt.observer, Lightning Terminal, etc.
- Improvement and adoption of protocols such as LNURL and WebLN
- Educational programs for developers and designers (e.g. Summer of Bitcoin), guides (e.g. Bolt.Fun), video content (e.g. Meet the Makers) and platforms to exchange ideas and know-how (e.g. Bitcoin Design)
As a result building bitcoin lightning applications becomes increasingly accessible for developers of any background.
Building on the lightning web standard
One such building block is WebLN. It is a set of specifications for lightning apps and client providers to facilitate communication between web apps and users' lightning nodes in a secure way. It provides a programmatic, permissioned interface for letting applications ask users to send and receive payments and much more.
Let's have a look at how projects of the Legends of Lightning Tournament leverage WebLN to integrate seamless bitcoin-based interactions of any kind.
BTC Map helps you to easily find places to spend sats anywhere on the planet.
BTC Map has a leaderboard of contributors of places. They added WebLN via the webln.sendPayment() call to trigger a payment from the wallet of the visitors and reward taggers. All payments are directly sent to the private wallet of the tagger via LNURL and lightning addresses. BTC Map is open-source and an important resource of knowledge for the ecosystem.
The PeerTube Lightning plugin allows you to send bitcoin payments to PeerTube creators.
Viewers of PeerTube videos can now support their favorite creators by sending Value 4 Value payments. You can choose to send one-time payments including a message (i.e. boostagram) or stream money by the minute. Payments from the viewer's wallet are triggered with webln.sendPayment() or webln.keysend(). Only if no WebLN-enabled wallet is detected, the plugin displays a QR code as a fallback option. It is recommended to check for a WebLN provider first to create a better user experience and avoid unnecessary QR codes. The WebLN guide offers a chapter with best practices and example code for situations like this.
Payments go directly to a lightning address with a ⚡as a suffix (e.g. ⚡firstname.lastname@example.org ) included in the PeerTube channel description. To enjoy seamless streaming of money and 1-click payments users can set a budget with the Alby browser extension.
Lightsats provides a no-coiner onramp platform using bitcoin tips.
Bitcoiners can now finally tip/gift sats without worrying about onboarding the user and also losing their sats. Lightsats created a user journey for a self-onboarding of no-coiners. Unclaimed sats can be reclaimed or are sent back after a predefined time. The app uses lnurl-auth to allow login without passwords and WebLN for funding tips/gifts. Lightsats was built completely in the open. Check out their code repository to learn more about their tech stack.
Web developers are lightning app developers
Therefore, it is not surprising that the community of makers building on lightning is growing. After all working with like-minded people is fun, creates a valuable network and relevant knowledge quickly. Building in the open is rewarding. Give it a try!
Do you need support or feedback? Let us know. Don't hesitate to contact us directly via e-mail or telegram if you have more questions about how to start your lightning web app. We are happy to help you become part of the maker community.