Why not archive the backend of Bitcoin blockchain? [combined summary]



Individual post summaries: Click here to read the original discussion on the bitcoin-dev mailing list

Published on: 2018-06-14T23:24:33+00:00


Summary:

A Lightning node can access an existing node instead of running its own dedicated instance of bitcoind. This can be achieved by configuring 'bitcoin-cli' to connect to a remote node with the 'rpcconnect', 'rpcuser', and 'rpcpassword' options in the 'bitcoin.conf' file or using command-line options when starting 'lightningd'. All three implementations of Lightning, c-lightning, lnd, and Eclair, support this method. Christian Decker, a developer at Blockstream, confirmed that Lightning nodes need to monitor the network for transactions and suspicious activity, but the bitcoind sitting next to the Lightning node does not need to keep an index of the transactions. Running with '-txindex' is not necessary for a Lightning node. Pruned nodes can work as long as the current blockchain head seen by the Lightning node does not fall into the pruned range. However, an indexed pruned node does not make sense for Lightning. The reliance on bitcoind for Lightning nodes is expected to be minimized in the future.In March 2018, a user on the Lightning-dev list asked about using Lightning without running a full bitcoin blockchain due to limited laptop space. Patrick Shirkey suggested periodically archiving old chapters of the blockchain on at least 150 computers across seven continents, storing just the index. This idea was later posted on the Bitcoin-dev list, noting that the "prune" flag could be used to get a snapshot of the blockchain but may cause issues for Lightning nodes if incompatible with "txindex" and "rescan".C-lightning is not officially rated for pruned bitcoind use, but it can be used if bitcoind is installed and started before lightningd, catching up to the chain. Pruned bitcoind is not officially supported, so any loss of funds due to this setup would be the user's responsibility. The implementation of the "chapter-based" archiving idea needs to be reviewed and implemented, addressing questions such as selecting archive servers and ensuring equal access to historical blockchain data.Bitcoin Core can operate in a pruned mode where most of the historical block data is discarded, keeping only the current UTXO set and recent blocks. However, some nodes on the network need to run in archive mode to help new nodes get in sync. BIP 159 identifies these archive nodes at the gossip layer. While some Lightning implementations use the additional txindex, which is not compatible with pruned mode, Segue suggested archiving chunks of the blockchain on distributed computers to avoid an infinitely long chain. This suggestion was posted on the bitcoin-dev list for further discussion.A user named Yubin Ruan asked about running the Lightning network without a full Bitcoin blockchain due to limited laptop space. Segue proposed the idea of periodically archiving chunks of the blockchain on 150 computers across seven continents to prevent an endlessly growing chain. This suggestion was then shared on the Bitcoin-dev list for more input. Pruning can also be used to store only the last X MB of the blockchain while keeping the UTXO set, which takes up a few GBs of space.In summary, Lightning nodes can access existing nodes instead of running their own dedicated bitcoind instance. Different implementations offer various methods to achieve this. The reliance on bitcoind for Lightning nodes is expected to decrease in the future. There have been discussions about archiving old chapters of the blockchain on multiple computers across continents to avoid an endlessly long chain. Pruned nodes are possible but may cause compatibility issues with txindex and rescan. The implementation of these ideas and their practicality are still being explored.


Updated on: 2023-08-01T23:06:41.003598+00:00