Finding the Optimal Payment Route in the Lightning Network
DOI:
https://doi.org/10.31649/1997-9266-2020-153-6-93-99Keywords:
cryptocurrency, bitcoin, blockchain, lightning, graph theory, graph algorithms, shortest path searchAbstract
The article is devoted to the problem of scaling the bitcoin blockchain and the main methods of its solution. The main methods of solving this problem are described, such as SPV (simplified payment verification) — nodes, SegWit, auxiliary blockchains (sidechains) and Lightning Network (Lightning Network). The advantages and disadvantages of the above approaches are presented.
The article provides details of the technical structure of the Lighting Network, the mechanism of which allows you to avoid writing each transaction on the blockchain. Key concepts such as unconfirmed transactions, double spend protection, multi-signature, temporary locks, hashes and secrets are described. The process of channel opening and lightning transaction are considered. The source code of Bitcoin Scrypt stack programming programs used during lightning transactions is provided and analyzed.
The article proposes models that are convenient for describing lightning network, namely graph and network model. The graph model involves making a payment along one path, in turn, the network model involves splitting the payment into several smaller payments (possibly using the algorithm AMP — atomic multipath payment).
The article describes the tasks faced by developers of wallets for Lightning Network, namely finding the size of the maximum payment that can be made under given conditions (with an arbitrary or fixed number of intermediaries) and making a fixed size payment with the minimum possible fee. Algorithms were formalized in terms of graph theory by the help of developed models. A detailed algorithm for solving formalized problems is proposed, using binary search, width search and min-cost-max-flow algorithms.
References
«Пошук у ширину,» Електронний журнал MAXimal, 2008. [Електронний ресурс]. Режим доступу: https://e-maxx.ru/algo/bfs.
«Потік мінімальної вартості,» Електронний журнал MAXimal, 2008. [Електронний ресурс]. Режим доступу: https://e-maxx.ru/algo/min_cost_flow .
Btc Drak, Mark Friedenbach, and Eric Lombrozo, “CHECKSEQUENCEVERIFY,” 2015. [Electronic resource]. Available: https://github.com/bitcoin/bips/blob/master/bip-0112.mediawiki .
Eric Lombrozo, Johnson Lau, and Pieter Wuille, “Segregated Witness (Consensus layer) ,” 2015. [Electronic resource]. Available: https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki .
Johnson Lau, and Pieter Wuille, “Transaction Signature Verification for Version 0 Witness Program,” 2016. [Electronic resource]. Available: https://github.com/bitcoin/bips/blob/master/bip-0143.mediawiki .
Eric Lombrozo, and Pieter Wuille, “Segregated Witness (Peer Services),” 2016. [Electronic resource]. Available: https://github.com/bitcoin/bips/blob/master/bip-0144.mediawiki .
Peter Todd, “OP_CHECKLOCKTIMEVERIFY,” 2014. [Electronic resource]. Available: https://github.com/bitcoin/bips/blob/master/bip-0065.mediawiki .
Sean Bowe, and Daira Hopwood, “Hashed Time-Locked Contract transaction,” 2017. [Electronic resource]. Available: https://github.com/bitcoin/bips/blob/master/bip-0199.mediawiki .
Downloads
-
PDF (Українська)
Downloads: 113
Published
How to Cite
Issue
Section
License
This work is licensed under a Creative Commons Attribution 4.0 International License.
Authors who publish with this journal agree to the following terms:
- Authors retain copyright and grant the journal right of first publication.
- Authors are able to enter into separate, additional contractual arrangements for the non-exclusive distribution of the journal's published version of the work (e.g., post it to an institutional repository or publish it in a book), with an acknowledgment of its initial publication in this journal.
- Authors are permitted and encouraged to post their work online (e.g., in institutional repositories or on their website) prior to and during the submission process, as it can lead to productive exchanges, as well as earlier and greater citation of published work (See The Effect of Open Access).