0

When I first download Bitcoin Core, and Synchronize with the network, where am I actually downloading the block chain from? The point of bitcoin is that there is no canonical source, yet I must get the data from somewhere?

Does it use a bittorrent-like protocol?
Am I getting different blocks from different peers?
How does my computer discover peers initially?

2

The blockchain begins with the genesis block. The genesis block was mined by Satoshi and it a hard coded value in all Bitcoin full nodes. All blocks in the blockchain must be a descendant of this block.

When you synchronize with the network, your node will perform peer discovery and connect to several other nodes. It then proceeds to request from those nodes the block headers for each node's best blockchain. Block headers are received in 2000 header chunks (i.e. Core requests for 2000 headers and receives 2000 headers at a time from a node). Core will build a block headers chain and verify that the proof of work is correct. At the same time, Core will download the blocks for those block headers (blocks are received and synced much more slowly than their headers) from all of its peers. The sync is finished when it receives less than the 2000 headers it last requested for.

As you can see, there is no canonical source. Core simply connects to several nodes and downloads blocks from them. Then it verifies that those blocks fit the consensus rules that it is following.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.