Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It only takes a minute to sign up.
Sign up to join this communityAnybody can ask a question
Anybody can answer
The best answers are voted up and rise to the top
My understanding of updating a node's incomplete blockchain is that:
A node with an incomplete blockchain (let's say its been offline for some time) will send a getblocks message and then will receive an inv response with the latest 500 blocks from the most updated machine.
What I don't understand is that when you originally set up a full-node, it is downloading blocks from the network and adding them successively starting from the genesis block (which is encoded into the full-node's client software). So why can't it download the latest block from the network rather than sending many messages. <-- Or is this understanding blatantly wrong - that is, new full-nodes are not downloading blocks from the network.
A full node needs to process all blocks in order to establish which "coins" (UTXOs) exist without having to trust anyone
The getblocks and inv messages are an efficient way to do this.
It seems there are two questions here.
Why do nodes need to download all historical blocks? Fully-validating nodes must learn the full state of the ledger ("who owns what/how much currently") that resulted from all previous transactions before they can validate new ones. The only way to learn this, without trusting any other third party to just tell them, and be convinced the result is correct, is by actually going over that entire history and seeing that every transaction they're told about checks out.
Why does the block download mechanism involve so many back-and-forth messages? That's just how the download protocol works. Some of the complexity is due to permitting block download to operate in parallel from multiple peers simultaneously, and other complexity is due to trying to prevent being sent blocks by malicious peers which later turn out to not be in the best chain, and thus constitute wasted effort. To combat that, nodes will first download and validate block headers (which is fast and cheap), and then fetch blocks along those validated headers.
You can get bonuses upto $100 FREE BONUS when you:
π° Install these recommended apps:
π² SocialGood - 100% Crypto Back on Everyday Shopping
π² xPortal - The DeFi For The Next Billion
π² CryptoTab Browser - Lightweight, fast, and ready to mine!
π° Register on these recommended exchanges:
π‘ Binanceπ‘ Bitfinexπ‘ Bitmartπ‘ Bittrexπ‘ Bitget
π‘ CoinExπ‘ Crypto.comπ‘ Gate.ioπ‘ Huobiπ‘ Kucoin.
Comments