<p>Pre 0.10 versions synced inventories as it was the way they composed a list of blocks that they then recursively request from the peer. It provides multiple benefits over just asking for all blocks since timestamp x (where is the timestamp of the last block we had).</p>

<p>The biggest one being that it allows you to check the peer is on the same chain as the checkpoint you are using, this means you can check the peer is on the correct chain (eg the one your checkpoints state is correct) before downloading blocks, which are considerably larger than just hashes.</p>

CC BY-SA 4.0
2020-04-08T09:28:49.673Z
2020-04-08T09:45:21.690Z
2020-04-08T09:45:21.690Z
Leo Cornelius
<p>I read the bitcoin docs describing how btc syncs. During IBD it gets the inventories up to the tip with getblock. Why does it not skip this step and get the blocks, generating the inventories as it gets each block? Surely getting inventories is slow, unneeded and inefficient?
I believe bitcoin daemon over version 0.10.0 now sync headers rather than inventories, i am talking about pre 0.10.0. </p>

CC BY-SA 4.0
2020-03-08T23:56:25.710Z
Your question contains too many misconceptions for me to answer... what do you mean by "skipping this step"? Syncing inventories exactly how the nodes learns about and downloads the blocks. I don't know what is slow, unneeded, or inefficient about it.
Pieter Wuille
CC BY-SA 4.0
2020-03-09T05:49:27.237Z
@Wuille why would I need to download inventory’s to learn about the blocks? What does a number and a hash tell me that I can’t get from syncing the block data it’s self. Perhaps I have misunderstood the docs?
Leah Cornelius
CC BY-SA 4.0
2020-03-09T05:59:00.200Z
The inventory is how you learn the block exists at all. It's how you figure out "oh this peer knows a block I don't have yet, let me ask for it".
Pieter Wuille
CC BY-SA 4.0
2020-03-09T06:58:15.847Z
@pieter wuille ah I see. I was under the perception your node already knew this. Thanks :) this has answered the question. Feel free to put it into a response and I will mark it as correct! – Leo Cornelius
Leah Cornelius
CC BY-SA 4.0
2020-03-09T09:04:44.223Z
Bitcoin 0.1 didn’t even have inventory messages. You mean 0.10.
Claris
CC BY-SA 4.0
2023-09-12T10:32:06.640Z
@Claris Sure about that? https://github.com/bitcoin/bitcoin/blob/v0.1.5/main.cpp#L1800
Pieter Wuille
<bitcoin-core><synchronization><daemon><p2p><inventory>
Why does bitcoin sync inventories?
Leah Cornelius
# Why does bitcoin sync inventories?

(Asked by: username_0 on 2020-03-08)

I read the bitcoin docs describing how btc syncs. During IBD it gets the inventories up to the tip with getblock. Why does it not skip this step and get the blocks, generating the inventories as it gets each block? Surely getting inventories is slow, unneeded and inefficient?
I believe bitcoin daemon over version 0.10.0 now sync headers rather than inventories, i am talking about pre 0.10.0.

**Tags:** bitcoin-core, synchronization, daemon, p2p, inventory

> **Comments:**
> **username_1**: Your question contains too many misconceptions for me to answer... what do you mean by "skipping this step"? Syncing inventories exactly how the nodes learns about and downloads the blocks. I don't know what is slow, unneeded, or inefficient about it.  
> **username_0**: @username_1 why would I need to download inventory’s to learn about the blocks? What does a number and a hash tell me that I can’t get from syncing the block data it’s self. Perhaps I have misunderstood the docs?  
> **username_1**: The inventory is how you learn the block exists at all. It's how you figure out "oh this peer knows a block I don't have yet, let me ask for it".  
> **username_0**: @username_1 username_1 ah I see. I was under the perception your node already knew this. Thanks :) this has answered the question. Feel free to put it into a response and I will mark it as correct! – Leo username_0  
> **username_2**: Bitcoin 0.1 didn’t even have inventory messages. You mean 0.10.  
> **username_1**: @username_2 Sure about that? https://github.com/bitcoin/bitcoin/blob/v0.1.5/main.cpp#L1800  

---

## 1 answers

### Answer by username_3 on 2020-04-08. Score: 1 | Accepted answer

Pre 0.10 versions synced inventories as it was the way they composed a list of blocks that they then recursively request from the peer. It provides multiple benefits over just asking for all blocks since timestamp x (where is the timestamp of the last block we had).

The biggest one being that it allows you to check the peer is on the same chain as the checkpoint you are using, this means you can check the peer is on the correct chain (eg the one your checkpoints state is correct) before downloading blocks, which are considerably larger than just hashes.


---

