Twelve months building the Zap Desktop wallet
By: Tom Kirkpatrick
Tags: Lightning Network, Bitcoin, Bitcoin Development, Bitcoin Wallet, Lnd

About a year ago I wrote an article entitled “A journey into the World of Bitcoin Lightning Development” in which I talked about my experience of getting involved with Bitcoin development. About a year has passed and I thought it might be nice to do a follow up and share a little of my experience since then.

In a nutshell, I’ve been working on Zap Desktop every day for the past year and through that effort I have been helping bring the Lightning Network that little bit closer to fruition.

Functionality

When I started working on Zap, it was pretty much the only Lightning wallet out there. Jack Mallers was a trail blazer and his first version of Zap Desktop helped people visualise what the Lightning Network might become. He turned it from a command line only piece of tech that only the tech crowd could use, into a viable end user product that anyone could download and start to play with.

Zap Desktop v0.1

That first version of Zap inspired a new generation of Bitcoin developers.

Zap Dekstop v0.2

A few months on, and things were starting to take shape. A lot of effort was put into the user experience and trying to make it look and feel somewhat familiar to people that may have used a Bitcoin wallet before. It had simple Pay and Receive buttons, an activity list, and a Network list. The Network list was a necessary evil at this stage as to use the Lightning network you really needed to understand a fair bit about how it works under the hood, particularly with regard to channels. This is still somewhat the case today, but things are starting to mature.

Zap Desktop v0.3

For version 3, we did some major refactoring of our backend code, some minor UI tweaks and a bunch of new features. We introduced dark & light modes, multiple currencies, multiple languages, and things started to become more stable with lnd 0.5.x on the backend, and with our own codebase as well.

Zap Desktop v0.4

With the most recent version of Zap (0.4.x) we finally made a push to completely remove the Network sidebar, which we had been talking about since the early days. It was never intended to be a user facing part of the product, at least not for average users.

Zap Desktop v0.4 — Channel UI

The Channel Management UI now lives in its own dedicated section of the app and out of the way for general users and day to day usage. The goal is that most users will not need to think about channels — Autopilot will do that for them (Autopilot is a feature in lnd that automates the process of opening channels). Whilst Autopilot is still a work in progress, great strides are being made on that front and this will continue to improve with each release.

Supporting Code

Where it makes sense to do so, I have extracted general purpose code out of Zap Desktop and into standalone libraries. These are all published under the MIT licence and freely available on github.

These libraries are mostly a bi-product of my efforts to build cool new features into the wallet. And whilst these libraries are all free and open source, this is not unique to our supporting libraries. The entire Zap Desktop wallet codebase (as well as our other products) are also free and open source.

First, there was lnd-binary. A simple way to install lnd in a Nodejs environment. This was one of the first things that I built for Zap. This helped us streamline our devops processes.

lnd can expose both a REST and gRPC interface that clients can use to control the daemon. At Zap we leverage the gRPC interface. However, working with the lnd gRPC interface has some nuances. Our gRPC integration has been through a number of iterations. Just this week I spent some time decoupling our lower level, more generic lnd gRPC wrapper code from our Zap specific code and published it as a standalone library.

lndconnect was a specification that we developed to streamline the process of connecting to a remote lnd node. It defines a standard format for encoding lnd credentials (host, port, cert, macaroon) and displaying as a scannable QRCode both in the Desktop and iOS Zap apps. I wrote a node library to handle the encoding and decoding which we use in Zap Desktop.

In order to support our Neutrino clients we run some backend infrastructure. Specifically, we run several btcd node clusters (the only Bitcoin fullnode implementation that currently support Neutrino). Users running our Neutrino light client implementation connect to these nodes in order to pull down data about the blockchain. In the future, we imagine that as Neutrino becomes more widely supported it may be possible for our clients to connect to random nodes on the p2p network. But until then, we run these nodes on behalf of our users. These two docker images enable us to deploy out to a Kubernetes node cluster in a controlled manor with high uptime availability.

I’ve made a few contributions to the bolt11 library such as some improvements to its handling of uppercase bolt11 invoices (which are a little better optimised for use in QRcodes). I also added support for Litecoin as the Zap Desktop wallet is somewhat coin agnostic and does support Litecoin in addition to Bitcoin.

Community Support

In my year working on Zap, I have watched our slack room grow from a few hundred to over a thousand users:

It’s not just our slack users that have grown in number. The number of actual contributors has more than doubled in that same time from about 20 to over 40, and we have tens of thousands of users downloading each release of Zap.

My own contributions now stand at almost 1000 commits, hundreds of Pull Requests covering lots of new features, and probably an even greater amount of refactoring and refinements to our existing code.

I also went to one of the Lightning Hack days in Berlin and gave a presentation about Zap Desktop:

I’ve been trying to help educate people about Lightning and counter some of the common misconceptions and FUD that is out there. There are lots of valid criticisms of the Lightning Network and there are lots of things still to be worked out. Just like Bitcoin, the Lightning Network is an evolving technology. It’s in its infancy and is not a silver bullet that will solve all of Bitcoin’s scaling issues. It is however a very promising system that is already enabling new use cases and helping to take the load off of the Bitcoin blockchain.

I’m a believer in technology and people. Bitcoin is both a technology and a people. I’m proud to be an active contributor to the space and to give what I can to help push things forward.

Over the last year Zap has grown from something for hobbyists and enthusiasts to something that general users can get their teeth around. We have a long way to go, but we have some amazing new things in the pipelines at Zap. I’m excited to continue to build and to roll out some great new features over the coming months.

If you want to get involved with Zap, join us over in our Slack community, download the wallet and give us your feedback, or just get stuck in and start coding!