Visualizing Lightning Network Wallets Architecture
This article was originally published on the Veriphi Blog (now defunct) on June 2020.
Article Takeaway
Veriphi’s recommendations when it comes to Lightning Wallets:
Phoenix : Best Introduction to the Lightning Network
Zap : For advance use, a desktop or mobile experience
RTL : For advanced use, a desktop experience and for businesses
Nothing Like Grassroots Movements
Large budgets can only go so far, Blockchain and Altcoins have received BILLIONS OF DOLLARS in funding. What have they achieved? Barely anything. Meanwhile, Bitcoin has brought the biggest monetary revolution of all time & technological and market breakthroughts happen every week or so. The development ecosystem enthusiasm is grassroots and authentic like none other.
To what extent? Do I need to remind you that the whole thing was created by a pseudonymous user, Satoshi Nakamoto, who has BILLIONS OF DOLLARS worth of coins he’ll never touch and whose identity will never be revealed. Can it get more grassroots than that ?
*This is a joke.
That’s all history. Today, tens of high-skilled developers keep on innovating at the software, cryptography or conceptual level, without having the next cheque guaranteed. Real innovation only happens when motivation comes from the love of science, not monetary gain. Ironically enough, Bitcoin is the only world’s example to leverage software development to achieve monetary development, a revolution in of itself.
Even if many are willing to work for free, they shouldn’t and they won’t. Blockstream has hired developers to work on open-source projects since 2014 and many more companies are joining. 2020 has seen the apparition of many developer grants from diverse sources, even the Human Rights Foundation, who made a contribution of $50,000 to Chris Belcher for his work on CoinSwap, a new privacy technique. I’ll write another article about Privacy Technologies in a couple of weeks.
Lightning Wallet Development
Today we’re talking about the Lightning Wallet Ecosystem, who’s also been a major driver in Bitcoin’s ecosystem grassroots open-source innovation. We’ve published the most complete Lightning Wallets Features Comparison Table on the web with more than 55 features that you can consult here.
This data has been very useful, but it’s a load of information on a spreadsheet which makes it all but clear to many users. For those wishing to take an extra step in understanding how Lightning Wallets work and how their architecture, and consequently their user experience, might differ, this is for you.
Lightning Wallet Architecture
Here’s a graphical representation of many different categories of Lightning Wallets Architectures. Are they custodial? Do they require an external node? Is there an intermediary? These are all questions answered with many examples and the platforms to use noted as well.
Here's a written explanation of all the information and the 5 categories of wallets of the graphic above.
1 ) Full Lightning Nodes
Lightning works like Bitcoin, it’s a peer to peer network composed of nodes. However, unlike Bitcoin, there’s not a global consensus, since Bitcoin already delivers this for Lightning, so nodes are more modular and they can make transactions between themselves without other nodes being aware of them. It’s important to know that keys used on Lightning are owned by the Node which connects to the network.
This category is composed of wallets that have full Lightning Nodes that are fully independent on this network and don’t need another node’s or server’s assistance.
Like mentioned above, the keys are held by the Node, so they’re fully in the user’s control. The following attributes are part of a Full Lightning Node :
Key management
Network graph
Connection to a Bitcoin Full Node
Channel management, opening, closing and force closing
Transaction and liquidity handling
Peer establishment
Receive payments
Also, autopilot is a common functionality for LND-based full Lightning nodes apps, such as Zap and Lightning App. This type of wallet requires more responsibility in terms of counterparty channel risk, where the peer could try to cheat. This is why Lightning App and Electrum offer the ability to easily connect to a Watchtower.
Key management is another responsibility, it’s not as simple as a Bitcoin private key. Static channel backup is risky because if a more recent state to the channel exists and you recover from an older state, your channel counterparty might think you’re cheating and all your Bitcoin might be taken if he can publish a later state. These wallets also make you backup your keys as a regular Bitcoin wallet with a mnemonic seed phrase.
Here are the most popular examples of this category of wallet :
Eclair
It's available on all Desktop platforms as a GUI and CLI version of a Full Lightning Node but most use the Android Version that is suited for every day use. It's a full Bitcoin Wallet that allows you to connect to your Full Bitcoin Node through an Electrum Server. It's developed by ACINQ.
Lightning App
Lightning Labs released Lightning App in 2019 and it's widely available in all Desktop and Mobile platforms. It's Javascript based and it uses Neutrino to connect to a Bitcoin Node.
Zap
Zap is one of the greatest Lightning Wallets out there based on LND too. It's also Javascript based, offers great UX and will be adding Keysend in the next release.
Electrum
Electrum is one of the greatest Bitcoin Wallets out there for long-term hodling with hardware wallets & multi-signature schemes. Since 2019, they've been developing their own implementation for Lightning which is available at the master branch on their Github repository. Only desktop.
2 ) Partial Nodes
It’s well known in the industry that current Full Lightning Node responsibilities (key and channel management particularly) diminish the quality of the User Experience. The onboarding process requires education to answer questions such as :
Why can’t I receive funds after opening a channel to a peer?
Why can’t I send funds to a particular person on the Network if I have a channel open?
Why do I have to back up my channels on my Google Drive account?
Why does it take a few minutes before loading ?
Why does it take at least half an hour to begin transacting on the Lightning Network?
Many developer teams have taken a different approach to resolve this. They want to offer an improved UX (User Experience) in simplifying the onboarding process and this requires technical tradeoffs and more trust.
Here are a few examples of tradeoffs that have been implemented in Partial Nodes :
If the Lightning Network graph isn’t stored on the Wallet, a wallet can instantly load but relies on an external Node.
If at a recovery, the counterparty, in this case the wallet’s developer(s), sends the latest channel state to the user, he won’t need to worry about backing up channels.
If channel management is completely done by the wallet developer, the user can send funds to anyone without worrying about the path.
If the wallet developer opens a 0 confirmation channel with you, you can instantly make a transaction.
Partial Nodes always require an external server or Node. The connection can be done in a classic server / client HTTP REST API configuration or it can be done through the peer-to-peer Lightning Network.
Here are some examples :
BLW
It’s almost a full Lightning Node but it depends on an Olympus Server for the Network graph (Mandatory) and for watchtower purposes (optional).
Breez
Breez (company) opens a channel to every user that sets up a wallet at startup to facilitate the user’s onboarding process and remove completely the channel management responsibility from the user’s hands. The user saves his channel to his cloud (Google Drive or iCloud) but the private key can’t be backed up since Breez is fully Lightning.
Phoenix
Phoenix is made by ACINQ, the developers behind the popular Eclair wallet. Phoenix is in my opinion, the best Lightning Wallet in terms of user experience, not sovereignty. There’s no channel management since the user only connects with ACINQ and only the seed is needed for backup so no channel backup. Channels are functional without any confirmation and you can pay on chain transactions through a swap service.
3) Custodial Wallets
As on Bitcoin, there's an option to use Lightning with Custodial Wallets which makes the experience very similar to using a payment application like Venmo or Alipay since they can instantly receive and send funds. These wallets have huge security and privacy risks but at least allow for a quick onboarding process.
At first, when there were only Full Lightning Nodes, Custodial Wallets seemed like a good solution but now, we have many other types of wallets, particularly partial Nodes such as Phoenix that allow for an onboarding process as smooth as custodial without so much counterparty risk.
Veriphi doesn’t recommend Custodial Wallets for most scenarios including a Lightning Wallet. Here are the main examples of Lightning Custodial Wallets :
Blue Wallet
It is a great Bitcoin Wallet, probably the best mobile available on both iOS and Android alongside Green Wallet by Blockstream. In terms of Lightning, they provide a Custodial Wallet that is custodial by default but the backend is fully open-source ( as the wallet is) so one could run it as a Control Remote Wallet. The Backend is LNDHub and you can run your own Bank with it today.
Wallet of Satoshi
This one is one of the most popular Lightning Wallets, also available on both mobile platforms. It’s fully closed-source.
LNtxbot
This wallet is an interesting Custodial Wallet because it lives inside your Telegram App as a bot. This enables new use cases such as sending Sats over Telegram. This might be eventually replaced by a Lightning Native Chat application like Sphinx.
4) Swapping Service
What if I send you Bitcoin on-chain and you pay a Bitcoin invoice over Lightning for me? That’s called a Swap in its basic form and a Submarine Swap in its trustless form. Lightning Labs has released a Swapping Service API last year called Lightning Loop and it’s also becoming a feature included in Wallets.
Muun Wallet
It is an on-chain wallet where Lightning doesn’t appear on client-side code at all. However, you can pay Lightning invoices by making a swap with the wallet developer company server. The payment then gets executed on the Lightning Network through their Node that you have no connection to. Lightning is fully abstracted in this category of Wallets and Services.
5) Control Remote Nodes
If you want to use the Lightning Network through the browser, you will have to use fully custodial solutions or Control Remote Nodes which are only front-end management interfaces for a server Node. You might even want to Control Remote your Node with a mobile App.
The Full Lightning Nodes Wallets are very useful but since they’re built as applications, they can only get you so far. Many advanced users like to run their Lightning Network Nodes 24/7 on dedicated servers or mini-computers. It’s actually pretty easy to do so with plug-and-play solutions like MyNode or Nodl.
Here are the main wallets for this category :
Zeus
It's an Android Wallet that allows you to connect to many different backends such as LND, c-lightning, LNDConnect or BTCPay Server. It has recently added Keysend.
Spark
Spark is widely available as a self-hosted Web Application, a Mobile App on both iOS and Android or a Desktop App. It requires a NodeJS Spark Server that connects to c-lightning.
RTL
It's available as a self-hosted Web Application with AngularJS and it provides the most advanced interface to manage your Lightning Node. If you install BTCPay Server, RTL will be available as well. You can connect to both LND and c-lightning, with ptarmigan and Eclair implementations on the way as well.
Conclusion
A lot of work is still to be done on the Lightning Network and new features such as KeySend and MPP (Multi Part Payments) improve and reform the user experience in the near term. Over the next years, major changes such as Eltoo will revolutionize the protocol and move the Full Lightning Node user experience towards a seamless experience with less tradeoffs, eventually.
Hopefully, when the network really needs Lightning (once Bitcoin hits hundreds of thousands of dollars and fees are ridiculously high) there will be a lot of options available for the users. Square Crypto is helping the community move towards that goal by releasing their Lightning Wallet Mobile SDK.
For the moment, here are Veriphi’s recommendations when it comes to Lightning Wallets:
Phoenix : Best Introduction to the Lightning Network
Zap : For advance use, a desktop or mobile experience
RTL : For advanced use, a desktop experience and for businesses.
Contact me on Twitter if you have any questions or some feedback.