For those that are not necessarily close to the technical side of how you transfer digital funds (money/bitcoin), it might seem like a dark art.

What I hope to do in this article is explain what a lightning payment is in layman terms, I may be over simplistic for some, in order to make the information accessible for everyone. As the poet John Lydgate wrote: “you can please some people all of the time, you can please all the people some of the time but you can’t please all of the people all of the time”

In my example, I’ll be referring to a lightning network payment using bitcoin. It is possible with other tokens too and even exchanging different tokens but lets keep things simple! Since we’re using bitcoin in our example, lets have a quick discussion on how bitcoin transactions work…

Bitcoin: be your own bank

A bitcoin transaction is analogous to making a bank transfer, the digital funds that you control, can be sent to someone else.

With bank transfers, you’ll have a sort code and account number to identify where to send the funds to. You will fill out a form online with the details of the transaction and then submit the transaction to the bank for processing. The bank will then typically use a third party to facilitate the transfer (BACS/SWIFT) who will normally complete the transaction within 2 hours.

In bitcoin, the funds are sent to an address which is a unique identifier similar to the sort code/ account number combination the bank uses. This can be represented by a barcode that can easily scanned by a mobile phone and will prompt you to authorise the transaction by clicking send.

The transaction is sent to the bitcoin network where it waits to be recorded in a block on the blockchain. For reasons to do with network consensus, we typically wait for 5 subsequent blocks to be recorded on the blockchain (confirmations) before saying with confidence that the transaction has been permanently recorded. It takes around 1 hour to achieve the required confirmations.

Having a digital way of performing transactions with bitcoin, gives us some creative license. We can start to add some conditions into how we want a transaction to behave. There are a number of conditions that can be used in bitcoin transactions such as:

  • multi signature where a transaction requires 2 or more people to authorise it
  • timelock where a transaction can only be authorised after a certain time

These ‘smart transactions’* can be used in lots of exciting ways…

*Okay so they’re more commonly known as smart contracts but the smart transactions label fits better here

Lightning Network: be your own payment processor

Photo by rawpixel on Unsplash

In contrast to bitcoin transactions, lightning transactions are analogous to using your debit card to pay for goods with a funds digitally.

With your debit card, you agree to pay the recipient and authorise the transaction by entering your PIN into the card machine. Behind the scenes, the debit card transaction will be authorised by the payment processor (Mastercard/Visa) and then at a later point the transaction will be recorded by updating the balance in your bank account.

In the case of bitcoin lightning transactions, you may scan a barcode with your mobile wallet and authorise the transaction by clicking click the send button. The bitcoin funds are then relayed across the lightning network to the recipient but not yet recorded in the blockchain.

The lightning network uses smart transactions in bitcoin to enable two people to lock up some funds and transact between themselves instantly, whilst keep a track of transactions they make between themselves. Once they have finished transacting between themselves, they can record just the final allocation of funds on the blockchain.
The people linked by this type of smart transaction are said to have a payment channel open between them.

This is quite neat if they only want to send funds back and forth between themselves, but this is the lightning network.

When people start to have more than one payment channel, creating a smart transaction with someone else, it starts to become possible to relay funds for them to save them from opening a direct channel with the recipient.

With channels being advertised on the network, it is possible to work out a route to anyone on the network with which you can send funds to. All of a sudden you have a wide network of interconnecting people, who are able to transfer funds among themselves, via hops across channels in the network, instantly.

Of course there is a lot of crypto magic under the hood to make things work in a trust-less manner but the crux of it is that you can digitally transfer bitcoin instantly and securely, using the lightning network.