Spark: A new GUI for c-lightning

noun \ ˈspärk \: a short bright flash of electricity between two points


Spark is a brand new web-based GUI, Electron app (for Linux, Windows, and macOS), and mobile app (for Android, and soon for iOS) from independent developer Nadav Ivgi that uses c-lightning as its backend.

With Spark, bitcoins are easily spent and received over the Lightning Network with a simple interface. A user can now run their own fully validating Bitcoin node, their own c-lightningnode, and their own Spark GUI to use the Lightning Network as trustlessly as possible.

A quick demo of Spark’s user interface

Some of Spark’s features include:

Demo

Using nanopos, a Point-of-Sale Lightning application (LApp), we can use the Spark GUI on a mobile Android device with a tablet to demo a common way customers transact with merchants today, and how they might transact in the near future as the Lightning Network matures.

Buying a hat with Spark!

Spark is flexible in that it can be configured to be run in multiple ways. One way is to run Spark in order to access it remotely via a web browser. Another way is to run it locally with the Electron-based app. A third way is to run Spark as a server and connect to it with the Android app.

Spark installation

Requirements

  • A device with Linux, Android, Windows, or macOS installed
  • Some command line experience if installing on Linux
  • A running c-lightning instance, an install guide is here
  • nodejs v6.0 or newer

Installing Spark to be accessible remotely:

In this example, Ubuntu 18.04 is used. In prior versions of Ubuntu, nodejs must be installed differently. Look here to see how to install nodejs if using an older version of Ubuntu.

$ sudo apt install nodejs npm
$ sudo npm install -g spark-wallet
$ spark-wallet -l /path/to/lightning

That is all you need to run on Ubuntu 18.04.

Once started, Spark will generate and print a random username and password that will be used to login into the wallet. To customize the login credentials, pass --login user:pass . To bind on an address, pass -i <ip address>. -i allows the user to access the Spark server remotely. It also generates and enables a TLS self-signed certificate.

To view other options for Spark, pass --help. Command line options can also be added to a configuration file in ~/.spark-wallet/config.

To view Spark, open http://ip_address:9737/ in your browser and login with the username and password specified earlier.

LetsEncrypt integration:

Since Spark uses self-signed certificates by default when binding to an IP address other than localhost, web browsers will present a warning. Fortunately, Spark supports LetsEncrypt CA-signed certificates. All that is required is a registered domain.

To register a certificate with LetsEncrypt:

$ spark-wallet --host example.com --letsencrypt admin@example.com

More information on LetsEncrypt integration can be found here.

Tor support:

Spark also has support for creating Tor Hidden Service v3 .onion addresses which have some advantages versus having to purchase a domain and setup port forwarding for clearnet usage.

.onion addresses are self-authenticating and are pinned to your server’s public key, and also serve to authenticate the user accessing Spark since access to the server is only possible if the user knows the .onion address.

To start Spark to run as a Tor Hidden Service v3, simply set --onion on the command line:

$ spark-wallet --onion

Spark will automatically install Tor when first running with --onion, and present the v3 address in the command line output.

Desktop Electron app:

The Spark Electron app can simply be downloaded here as an AppImage.deb.tar.gz,.zip, or Windows installer / portable, and executed, installed, or decompressed. The Electron app bundles the Spark server-side component, so the user only has to input connection details for their c-lightning instance.

The macOS Electron App and the Starblocks coffee shop

Mobile Android (Cordova) app:

First, download the .apk from here and install it on your device, then run it. A configured Spark server (see the prior section on installing Spark to be accessible remotely) is required for the Cordova app to work correctly.

When the Cordova app is first run, the user must first pair their device with the remotely-accessible Spark server. A quick way to do this is to run Spark with -Q, which will generate and print the access key and .onion address of your Spark server. The QR code can then be scanned by the Cordova app to make inputting the address and access key much easier.

The pairing QR for a Spark server running as a Hidden Service!

Once paired with a Spark server, a user can then transact bitcoins over the Lightning Network!

A Spark-to-Spark transaction!

The simplicity and flexibility of Spark allows it to be used on a variety of devices; from desktops to laptops, as well as mobile devices. Up until now, c-lightning users had to take to a terminal emulator to use Lightning. Now, those users can spend and receive bitcoins over the Lightning Network with the tap of a finger or a click of a mouse!