<p>Blocks are downloaded in series from a given peer, but a node can download blocks from multiple peers at the same time, effectively downloading blocks in parallel. This parallel downloading is not about downloading different parts of the same block from different peers, but rather downloading different blocks from different peers.</p>
<p>This design allows a node to download the blockchain more quickly, as it is not limited by the upload speed of a single peer. It also adds a layer of redundancy.</p>
<p>Despite the parallel downloading of blocks, they must be processed serially. This is essential for the node to maintain accurate information about the existing unspent transaction outputs (UTXOs) and to verify the validity of transactions.</p>
<p>The actual implementation of this process in Bitcoin Core is quite complex and involves various aspects like handling timeouts, validating blocks, and so on. You can review the actual code in the <a href="https://github.com/bitcoin/bitcoin" rel="nofollow noreferrer">Bitcoin Core GitHub repository</a> to get a deeper understanding.</p>
<p>You may also check the <a href="https://developer.bitcoin.org/reference/p2p_networking.html#block" rel="nofollow noreferrer">P2P Network part of Bitcoin Developer site</a> - see the explanation for Block, GetBlocks, GetData, GetHeaders messages, that are involved when blocks are sent between nodes.</p>

CC BY-SA 4.0
2023-12-31T10:14:41.450Z
How does a node send blocks to adjacent nodes? Does it upload blocks to multiple adjacent nodes simultaneously? Or is it a sequential transmission implementation where the node sends the block to one individual, and after that, to the next node?
masuda
CC BY-SA 4.0
2023-12-31T14:49:45.670Z
@masuda Blocks are sent to peers when they ask for it. If multiple peers ask for it simultaneously, a node can send to multiple at the same time.
Pieter Wuille
CC BY-SA 4.0
2024-01-01T05:12:20.847Z
Do you know in which file of Bitcoin Core this is implemented?
masuda
CC BY-SA 4.0
2024-01-02T01:37:38.510Z
@masuda net_processing.cpp and net.cpp primarily.
Pieter Wuille
CC BY-SA 4.0
2023-12-27T12:10:59.933Z
2023-12-27T16:28:21.157Z
2023-12-27T16:28:21.157Z
deyw
<p>Are blocks sent in parallel or in series?</p>
<p>I would also like to know about the implementation part of Bitcoin Core.</p>

<bitcoin-core><blockchain><bitcoin-core-development><synchronization><p2p>
In Bitcoin Core, are blocks sent in parallel or in series?
masuda
# In Bitcoin Core, are blocks sent in parallel or in series?

(Asked by: username_0 on 2023-12-27)

Are blocks sent in parallel or in series?

I would also like to know about the implementation part of Bitcoin Core.

**Tags:** bitcoin-core, blockchain, bitcoin-core-development, synchronization, p2p


---

## 1 answers

### Answer by username_1 on 2023-12-27. Score: 5

Blocks are downloaded in series from a given peer, but a node can download blocks from multiple peers at the same time, effectively downloading blocks in parallel. This parallel downloading is not about downloading different parts of the same block from different peers, but rather downloading different blocks from different peers.

This design allows a node to download the blockchain more quickly, as it is not limited by the upload speed of a single peer. It also adds a layer of redundancy.

Despite the parallel downloading of blocks, they must be processed serially. This is essential for the node to maintain accurate information about the existing unspent transaction outputs (UTXOs) and to verify the validity of transactions.

The actual implementation of this process in Bitcoin Core is quite complex and involves various aspects like handling timeouts, validating blocks, and so on. You can review the actual code in the [Bitcoin Core GitHub repository](https://github.com/bitcoin/bitcoin) to get a deeper understanding.

You may also check the [P2P Network part of Bitcoin Developer site](https://developer.bitcoin.org/reference/p2p_networking.html#block) - see the explanation for Block, GetBlocks, GetData, GetHeaders messages, that are involved when blocks are sent between nodes.

> **Comments:**
> **username_0**: How does a node send blocks to adjacent nodes? Does it upload blocks to multiple adjacent nodes simultaneously? Or is it a sequential transmission implementation where the node sends the block to one individual, and after that, to the next node?  
> **username_2**: @username_0 Blocks are sent to peers when they ask for it. If multiple peers ask for it simultaneously, a node can send to multiple at the same time.  
> **username_0**: Do you know in which file of Bitcoin Core this is implemented?  
> **username_2**: @username_0 net_processing.cpp and net.cpp primarily.  

---

