Files
specification/protocol/network/messages/inv.md
T
Andrew Groot fed06d280a Making format documentation more consistent.
Expanded upon some existing pages and populated some pages that were linked to despite not existing.
2020-09-24 16:49:32 -04:00

2.2 KiB

{ "title":"INV", "related":["/protocol","/protocol/network/messages/getdata.md","/protocol/network/messages/filterload.md","/protocol/network/messages/filterclear.md"] }

Announcement: Inventory ("inv")

Notifies peers about the existence of some information (block or transaction).

Based on selected services in the version message, inventory messages may not be sent.

If a bloom filter has been sent to this node via filterload, a transaction inventory will only be sent for transactions that match the bloom filter.

Message Format

Field Length Format Description
inventory count variable variable length integer The number of inventory items in this message.
inventory items inventory_count * 36 bytes inventory_count inventory items The set of inventory items being transmitted.

NOTE: Since a block header is a relatively small data structure, and block propagation speed is an important network metric, a peer may send headers messages in place of inventory messages when a block arrives. This behavior can be requested using the sendheaders message.

Inventory Item Format

Field Length Format Description
type 4 bytes inventory type(LE) Indicates what the following hash represents.
item hash 32 bytes bytes(LE) The hash that identifies the item.

Inventory Types

The type of the object that is available.

Type Value
1 Transaction
2 Block
3 Filtered Block (partial block with merkle proof)
4 Compact block
5 Xthin block (Bitcoin Unlimited)
6 Graphene Block (Bitcoin Unlimited)

Implementations: C++