Lightning Network: Solution for the Last Kilometer

    Lightning network


    Based on the Bitcoin blockchain, the Lightning Network has been launched. It already has several hundred nodes. Anyone can become a member and take advantage of lightning fast and almost free translations.


    Imagine that you are in a cafe and want to drink coffee. Will the Lightning Network help?


    Direct payment channels


    You can build a direct payment channel between your own site and the site of the cafe. If both Bitcoin nodes are already synchronized with the main blockchain, then you just need to send a request to create a payment channel to the blockchain, while reserveing ​​a certain amount of BTC for this channel. To pay for coffee, you will need to wait for the confirmation of the transaction to create the channel in the blockchain, after which you can complete the payment.


    Direct Payment Comparison


    Let's compare direct payments through a Bitcoin transaction and payments through the Lightning Network.


    Training


    To make a direct payment on the Bitcoin network, you only need to have access to your Bitcoin wallet and know the address of the seller’s Bitcoin wallet.


    To create a Lightning Network channel, access to the active node of the Bitcoin blockchain is required. Moreover, a direct connection between the Lightning Network nodes is required. The creation of the Lightning Network payment channel must be confirmed by a transaction in the Bitcoin blockchain.


    Payment transaction


    Direct Bitcoin payment is a normal transaction, so you need to have access to a Bitcoin wallet and wait an hour to confirm the transaction.


    Payment through the Lightning Network payment channel will be fast, but it is necessary to provide a connection between the Lightning Network nodes with access to the active Bitcoin blockchain node. And you must remember that you need to reserve the required amount for this channel in advance.


    Closing a channel and withdrawing funds


    In the case of direct Bitcoin payments, no additional operations are required. After committing the transaction, the payment "appears" in the seller’s wallet.


    The payment channel Lightning Network should be closed using a transaction in the Bitcoin blockchain that requires confirmation.


    Payment Channel Chain


    One of the advantages of the Lightning Network is the ability to make payments through a chain of payment channels without creating a direct payment channel between the buyer and seller. The only limitation is the presence of a path in the Lightning Network between the nodes of the buyer and the seller, the availability of these nodes at the time of the transaction and sufficient reservation of funds in each of the payment channels of the path.


    In this case, it will be possible to spend the reserved funds not only in the cafe, but also in any other Lightning Network node. For a cafe, not everything is so great. Now, some other Lightning Network node must create a payment channel with a cafe in advance and reserve a certain amount, having no idea who and when is going to buy something. In addition, both the buyer and the seller still need to support the Lightning Network nodes with access to the active Bitcoin blockchain node.


    Last kilometer


    So, we come to the problem of the last kilometer. How can I take full advantage of the Lightning Network and make it easily accessible to end users and organizations?


    The simplest answer is not to create Lightning Network payment channels at the end sites (the last kilometer). Let's look at the following diagram:


    Last kilometer


    Further, we assume that node B can create an order, and node A can instantly pay for it in the Lightning Network. That is, the path between the nodes exists and enough funds are reserved in the payment channels.


    In this case, you must perform the following steps:


    1. The client tells the seller what goods he wants to purchase.
    2. The seller asks node B to generate a payment order for the required amount.
    3. The seller reports the order number to the customer.
    4. The client passes the received order number to node A and requests payment.
    5. Node A pays for the order on the Lightning Network.
    6. Node B informs the seller that the order has been paid.
    7. The seller passes the order to the customer.

    Consider these steps as an example of a situation in a cafe. So, you have chosen coffee and informed the seller about it. He calculated the total amount of the order and sent it to node B. For this, on the side of node B, a simple service (or web page) is enough, where a unique order number will be displayed on the Lightning Network for the entered amount.


    The next step could be a little tricky because the order number on the Lightning Network is very long. As a solution, you could use a QR code, or simply generate a link to an internal or external abbreviation service. The received order number in the Lightning Network is transmitted to node A, for example, through a mobile application or website.


    After receiving the payment, node B can send a push notification to the seller, or the seller periodically requests the status of the order. When confirmation is received, then you begin to make coffee.


    POS payment


    The scheme is similar to the usual payment by credit card. The key difference is that the seller's acquiring bank requests the possibility of conducting a transaction from the client’s bank. This is possible because all protocols are described and banks trust the equipment that is pre-installed in the cafe (POS-terminal) and issued to you (bank card).


    It is possible that in the future and in the blockchain, suitable protocols and equipment will appear and be distributed. Then node A will ask you for authorization through node B. But this will require that your equipment is compatible with the equipment in the cafe. It is much easier to require online access to node A while maintaining the previous scheme. But transferring an account number to the Lightning Network is still worth simplifying.


    What's the catch?


    What prevents you and the neighboring cafe from starting to use the proposed scheme now? Firstly, the legal status of Bitcoin, Lightning Network, etc. is still not defined. Are everyone ready to take risks in this regard?


    Secondly, node A and node B play an important role in the approach, and interaction with them takes place outside the Lightning Network. The question is how to find these nodes and agree with them.


    Here I note that the distribution will depend on the availability of software and hardware solutions for establishing interaction between the client and node A, as well as the seller and node B. But this issue can be resolved quite quickly.


    What will the interaction between the client and node A be based on? Or between node B and the seller? The answer is simple - on trust.


    The trust


    I want to immediately emphasize that we are talking about trust only at the end sites. In the case of a client, either he must trust Node A and make a deposit in advance, which he will then spend, or, conversely, Node A trusts the client and is ready to provide a loan. But this already happens, for example, when a bank issues a debit or credit card. That is, there is nothing new here.


    In contrast to the situation with the Lightning Network payment channels, in this case, the seller’s trust to node B. Thus, node B will not need to reserve funds in advance for each cafe, that is, the entry threshold for any seller will be minimal if he trusts a certain node B.


    I add that the purchase of coffee in any case will be based on trust, since there is no guarantee that after payment you will receive what you ordered, even when you are dealing with a vending machine. That is, after payment you will have to trust the seller until the coffee is received.


    There was still a question about the receipt of money by node A from the buyer and the seller from node B. But there are no restrictions if the chosen method will suit both parties.


    Epilogue


    The solutions for the last kilometer may be different. And the new technology will spread faster if mass adoption of well-known approaches is possible. A simple solution is often better than the rest.


    Also popular now: