2

I understand that a full node needs to do an IBD before being able to verify transactions. So, it downloads the ledger up to now, which is known as Initial Block Download.

But what I don't understand/know is, from where is the blockchain information being downloaded? Are other full nodes contributing in this activity, or is this information stored somewhere, and is retrieved from there?

2 Answers 2

3

Yes, they download blocks from other nodes they connect to.

In Bitcoin Core you have the choice between being a pruned node or not. In both cases all blocks are downloaded and fully verified, but in pruned mode old blocks are deleted after a while after being verified. This has a number of implications, but one of them is that a pruned node does not help new nodes perform IBD.

2
  • A pruned node can't help other nodes perform IBD even for blocks that it has? Jul 26, 2022 at 15:55
  • 2
    It can, but nodes generally won't find peers that can. Since BIP159 it is possible for nodes to advertize to the network they are a "full node, but only promise availability of the last 288 blocks", which does get used for syncing, but it's only useful for the last 1-2 days. Jul 26, 2022 at 16:03
3

Each bitcoin node connects to a number of other nodes on the bitcoin network (peers). Think of it like friends you share information with. You can ask them for information, and they can ask you too.

So new bitcoin nodes, when they first start, find other peers on the network, and then the new node will start asking for bitcoin blocks from the blockchain that it doesn't yet have (all of them!). All the peers will respond, sharing the requested blocks from their own copies of the blockchain.

As the blocks arrive, your new node will validate that the block is valid and that all the transactions are valid, and that it is linked the the prior block, and having done that - add it to its own copy of the blockchain.

This process iterates for all the blocks from 2009, up to today and can take anywhere from a day to a few weeks depending on a whole bunch of factors. Good news is that it only has to be done once! After that Initial Block Download (IBD) is complete, keeping up to date is very little work - one block every 10 minutes or so.

Your node will be helped a lot by your peers during IBD, and then once you're fully synced, your node will be able to help others.

Equally, if your node, or one of your peers is switched off for a while, when they come back the same process repeats so that you get up to date again.

Pretty clever really :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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