Saturday, 19 September 2020

Announcing Lightning Desktop App, Now Available for Testing

This is official announcement of Lighning Labs on 12th of October 2017:
Today, we’re thrilled to be releasing a new cross-platform demo Desktop App for lnd.The release of this new demo wallet kicks-off a two-week “testing blitz” during which we hope Lightning users with a technical inclination can start testing the wallet, giving feedback, filing bugs, etc.

You can download the Lightning Desktop App from our official release on Github!





The Lightning Protocol specifications are nearly complete, however a breaking change may land before the specs are finalized. As a result, we’ll only be maintaining compatibility with the desktop application for approximately the next two weeks before switching to a regular release cycle once the specifications have been frozen and we’ve achieved cross-implementation compatibility.

POWERED BY NEUTRINO

The Lightning Desktop App is powered by neutrino, our new open source, light client operating mode for Bitcoin. Neutrino light clients don’t rely on bloom filters (BIP 37) as most light clients currently do. Instead, neutrino relies on client side filtering which has numerous benefits including: increased privacy, less active load on full nodes, and a more flexible application model which is particularly useful for lightweight Lightning nodes. The full technical details for neutrino can be found in our soon to be finalized BIP draft.

With this new backend for lnd in place, users will be able to run Lightning applications without having a synced full node, reducing the barrier to entry for Lightning users.

Once you’ve unzipped and launched the Desktop App, neutrino will commence its initial sync of Bitcoin’s testnet blockchain. Since the current testnet chain has over 1.2 million blocks (over twice as many as Bitcoin mainnet), the initial sync will take 10-15 minutes. A blue “Syncing to Chain” icon will flash in the lower left corner until lnd has finished syncing the testnet chain.




SEGWIT ENABLED
The Desktop App is fully segwit enabled, capable of sending funds to and receiving funds from native segwit addresses, which look like:

tb1q62cgd0u7h654rpu4fm9y4fe47x5khesyd9k2q9

Note that in the Desktop App, for incoming payments, we currently display nested P2SH addresses. This format is used so that non-segwit enabled services (such as faucets) can send funds to the wallet. For outgoing funds, the wallet will only send to segwit outputs in order to prevent new channels from being subject to transaction malleability. Before proceeding, you’ll need to get your hands on some testnet coins! Testnet coins are available at faucets here and here.

PLUG AND PLAY LIGHTNING
At a glance, the wallet may look very simple, but the bulk of the complexity has been pushed into the backend in order to ensure a seamless user experience when interacting with Lightning. Once lnd is fully synced, p2p connection bootstrapping combined with lnd’s autopilot will kick into action, automatically making the wallet truly plug-and-play.

P2P CONNECTION  BOOTSTRAPPING
Once lnd has fully synced, it will attempt to automatically establish connections to existing peers on the network in order to sync the latest channel graph state. After a sufficient number of connections has been established, the next phase of the wallet’s network initialization will kick off. Users will know the wallet is fully synced to the chain, as the “Syncing to Chain” icon will disappear, replaced with the public key of your new Lightning node.



autopilot: SELF-DRIVING LIGHTNING

The latest build of lnd comes equipped with a new experimental option for any planned flavors of automatic channel management, meaning users won’t necessarily need to manually establish channels. We call this new operating node autopilot as it will automatically manage the opening of channels within the network.

autopilot is essentially a closed-loop control system: it takes inputs such as the number of channels opened, time when channels are closed, and changes to the wallet’s balance. Once those signals are received, it consults a set of heuristic to decide if it needs more channels, and if so, to whom those channels should be opened. The Agent then carries out the recommendations of its heuristics.

Once your wallet is loaded with testnet coins, you’ll start to see autopilot at work on the Channels page. The autopilot agent will begin opening channels driven by its heuristics. This process also helps drive the network graph toward a scale-free topology.



Channels are shown in two statuses: PENDING-OPEN, and ACTIVE. The PENDING-OPEN stage indicates that the funding transaction has been broadcast, but is still awaiting confirmation on the blockchain. The ACTIVE status indicates that a channel is fully open and ready to send and receive payments.

Interacting With Live Network Applications
For sending/receiving funds over Lightning, the wallet implements BOLT-11 which defines an extensible invoicing protocol for Lightning payments. Using this encoding, a standard payment request to receive funds over Lightning looks like:

lntb4200n1pvaue4ypp5k86jth0zefkje0u88ftmp37rvy64p8fl5el7jla0cgn3av6nhmpsd8s0
v3xzun5d93kce2ld9jzyw3zxy6nsefev93kyttp8psnwtf5xycrwttpxu6nyttz8p3rvv3jxpsny
erzxg3zcgnyv4ekxunfwp6xjmmwygazy5n9v9jzqstjw35kxmr98gs9y3f6yp28yctwwdskxarfd
ah8xgrpdejzq5mrwf5hqarn8gsyg42sypyyz56gxymrqgpw9chzq32324q5c4j92fy5vkfqgdyy2
s6t2dy5wgnayhq8y6pw5957tqn374jczramqyzjr8f7vt7v3m2shtqgcnp9u538fv27zp2egju5u
ljscyuvul5n86kg0670zf68q4a09kcnzcyjgyqprd5d5p

This particular request is from the ln-articles Lightning app (Lapp) created by Alex Bosworth which implements an article publishing site with a micropayment paywall. If we go to the command line to decode the payment request, we’ll see that we’re about to pay for a hosted article.

$  lncli decodepayreq --
pay_req=lntb4200n1pvaue4ypp5k86jth0zefkje0u88ftmp37rvy64p8fl5el7jla0cgn3av6n
hmpsd8s0v3xzun5d93kce2ld9jzyw3zxy6nsefev93kyttp8psnwtf5xycrwttpxu6nyttz8p3rv
v3jxpsnyerzxg3zcgnyv4ekxunfwp6xjmmwygazy5n9v9jzqstjw35kxmr98gs9y3f6yp28yctww
dskxarfdah8xgrpdejzq5mrwf5hqarn8gsyg42sypyyz56gxymrqgpw9chzq32324q5c4j92fy5v
kfqgdyy2s6t2dy5wgnayhq8y6pw5957tqn374jczramqyzjr8f7vt7v3m2shtqgcnp9u538fv27z
p2egju5uljscyuvul5n86kg0670zf68q4a09kcnzcyjgyqprd5d5p { "destination": "028c620eb95c3907a779adf9c47612973b70c322e5b60a21886947867439ff63e6", "payment_hash": "b1f525dde2ca6d2cbf873a57b0c7c36135509d3fa67fe97fafc2271eb353bec3", "num_satoshis": "420", "timestamp": "1507747492", "expiry": "3600", "description": "{\"article_id\":\"158e9acb-a8a7-4107-a752-b8b6220a2db2\",\"description\":\"Read Article: RE: Transactions and Scripts: DUP HASH160 ... EQUALVERIFY CHECKSIG\"}", "description_hash": "", "fallback_addr": "" }


If you look closely, the payment request includes the target node, the payment hash, the amount of the payment, and a description for the user. These values all correspond to making a micropayment to view the remainder of the article on LN Articles:



Once we paste the payment request into the wallet, it’ll automatically parse the payment request and display the value of the invoice in the UI.


If we click send, the payment will be routed over the network to the Lightning node which backs the LN Articles paywall!