Published on: 2015-09-24T08:52:34+00:00
On September 24, 2015, Jonathan Toomim from Toomim Bros initiated a discussion on the Bitcoin-dev mailing list regarding the current block propagation algorithm used in Bitcoin. The algorithm involves a node mining a block and notifying its peers about the new block using an "inv" message. Peers respond by requesting the block using a "getdata" [hash] message. The node then sends out the block to all eight peers simultaneously. Once a peer completes the download, it verifies the block and proceeds to the next step.Currently, mining pools connect to the "fast relay network," which is designed for efficient block distribution. Miners run both a normal full node and a relay node on the same computer. The full node informs the relay node whenever it receives a new transaction, and the relay node requests the full transaction. The relay node shares information about the transaction with its relay peers, but only provides the hash and a 4-byte key. Each relay node maintains a mapping of transaction IDs to keys for each peer, removing entries once the transaction is included in a block. When a block is discovered, the local node sends it to the relay node, which forwards it to all peers in a compact form. The block is sent as a list of keys, and full transactions are only sent for unknown transactions. Upon receiving a block, the relay node verifies the proof-of-work (POW) but does not perform transaction validation. It forwards the block to the local full node for validation. This prevents a denial-of-service attack where invalid blocks could be sent to the relay node, causing it to be kicked by the local full node. If all transactions are already known, the relay node can forward a block with just 4 bytes per transaction, further optimizing the process.A proposal was made on the Bitcoin-dev mailing list to improve the block propagation algorithm. The existing algorithm is slow and requires a peer to possess the full block before uploading it to other peers. The proposed algorithm draws inspiration from Bittorrent and suggests that a seed node will mine a block, notify peers about the new block, and send out the block header. Leech peers will then verify the block header, request specific rows of the transaction Merkle tree, and receive leaves from the seed node. After confirming POW and hash/data integrity, leeches start sharing chunks of data instead of waiting for the complete block. The proposed algorithm is more complex but offers bandwidth-saving opportunities and optimization by caching transactions and reconstructing the transaction order. However, it may not always yield better performance when the bandwidth to ping latency ratio is high compared to the block size.In another discussion on the Bitcoin-dev mailing list, user jtoomim proposed the idea of using a protocol for parallelized and decentralized resource supply. Although the specific resources referred to by jtoomim are unclear, this proposal has the potential to enhance efficiency and distribution of these resources. The discussion regarding this proposal is ongoing.
Updated on: 2023-08-01T16:15:27.056369+00:00