Flare : An Approach to Routing in Lightning Network White Paper

This paper describes a hybrid routing algorithm Flare, which could be used for payment routing in Lightning Network. The design goal for the algorithm is to ensure that routes can be found as quickly as possible. This is accomplished at the cost of each node proactively gathering information about the Lightning Network topology. The collected information includes both payment channels close to the node in terms of hop distance and paths to beacon nodes, which are close to the node in the node address space. The usage of beacon node serves to supplement a node’s local view of the network with randomly selected feeler nodes deeper in the network. The combination of local and beacon nodes allows a node to minimize routing state, while finding routes to any given node with high probability. We perform simulations of the routing algorithm and find it to be scalable to at least 100,000 nodes. © 2016 Bitfury Group Limited and Olaoluwa Osuntokun Without permission, anyone may use, reproduce or distribute any material in this paper for noncommercial and educational use (i.e., other than for a fee or for commercial purposes) provided that the original source and the applicable copyright notice are cited. lightning@bitfury.com, Bitfury Group laolu@lightning.network Bitcoin is the world’s most widely used and valuable digital currency [1] , which allows anyone to send value without a trusted intermediary or depository. Bitcoin contains an advanced scripting system allowing users to program instructions for funds [2] . Bitcoin aggregates transactions into blocks with the expected time interval of 10 minutes between blocks. Bitcoin payments are widely regarded as practically irreversible after six confirmations (i.e., five additional blocks built on top of the block containing the transaction in question) [3] , or about one hour. Micropayments (i.e., payments less than a few cents) could take a long time to get confirmed, with Bitcoin transaction fees rendering such payments unviable. These conditions necessitate the development solutions like overlays , which could combine the advantages of the Bitcoin blockchain (i.e., its security and censorship resistance) with guarantees of near -instant payment processing and affordable micropayments. The Lightning Network (LN) [4] is one promising overlay solution to the problems mentioned above. LN operates as a network of bidirectional payment channels transferring value out of band, i.e., not recording transactions on the Bitcoin blockchain. LN is designed to be decentralized (i.e., a failure of a single party or a few parties would not render the network inoperable) and trustless (i.e., at no time would the custody of users’ funds be delegated to trusted third parties). Security of the network is enforced by blockchain smart contracts using Bitcoin’s builtin scripting without creating on -blockchain transactions for individual payments. LN could be deployed for other blockchains using a Bitcoin -like data model with unspent transaction outputs; furthermore, LN could be used for trustless inter -ledger payments. Other payment channel network concepts have emerged (e.g., Stroem [5] , Impulse [6] , Decker – Wattenhofer channels [7]); we focus our attention on LN as a more popular concept, which embraces the spirit of Bitcoin in its trustless and decentralized nature. LN payments would not need block confirmations, thus being near instant in its normal case of operation. A single payment on LN might involve several payment channels; however, payments are designed to be atomic (either the entire payment succeeds or fails). Thus, LN could be used at retail point -ofsale terminals, with machine -to -machine transactions, or anywhere instant payments are needed. LN could also allow for scalable bitcoin micropayments (e.g., tips on social websites) and micropayment streams (e.g., payment for online videos), therefore contributing to the expansion of the Bitcoin ecosystem. One of the defining features of LN is the ability to route payments between network users with one or more intermediaries without the need to trust them; i.e., it may not be necessary for parties to create a direct payment channel in order to complete a payment. Correspondingly, a problem of particular importance for LN is payment routing, i.e., finding a path of payment channels, which could route the payment from the sender to the recipient and would be optimal according to certain criteria (e.g., time to complete the payment and/or routing expenses). Without a fully automated solution to payment routing, it could be difficult for LN to establish a foothold.