<p>Bitcoin uses its own wire protocol, which is based on TCP. It's quite simple, with each packet type having strict rules for conformity and a checksum. New objects (transactions and blocks) are flooded through the network to all peers with a flag indicating they want that information, along with auxiliary messages like peer addresses and pings. No encryption is used for any connection. </p>

<p><a href="https://bitcoin.org/en/developer-reference#p2p-network" rel="nofollow">https://bitcoin.org/en/developer-reference#p2p-network</a></p>

CC BY-SA 3.0
2015-07-31T22:36:47.490Z
2015-07-31T22:36:47.490Z
Claris
<p>It's a fairly simple custom protocol.  You can find details at <a href="https://en.bitcoin.it/wiki/Protocol_documentation" rel="nofollow">https://en.bitcoin.it/wiki/Protocol_documentation</a>, but the messages use this general form:</p>

<ul>
<li>magic, 4 bytes, uint32_t: Magic value indicating message origin network, and used to seek to next message when stream state is unknown</li>
<li>command, 12 bytes, char[12]: ASCII string identifying the packet content, NULL padded (non-NULL padding results in packet rejected)</li>
<li>length, 4 bytes, uint32_t: Length of payload in number of bytes</li>
<li>checksum, 4 bytes, uint32_t: First 4 bytes of sha256(sha256(payload))</li>
<li>payload, variable length, uchar[]: The actual data</li>
</ul>

<p>The "inv" command is used to send notifications of new transactions and blocks around the network, and the "getdata" command is used to retrieve information about those transactions and blocks.</p>

CC BY-SA 3.0
2015-07-31T22:37:29.937Z
2015-07-31T22:37:29.937Z
Eric W
<p>Obviously for the Bitcoin system to work, we need an information network on a global scale such as the Internet.</p>

<p>I am sorry if this is a stupid question.</p>

<p>What exact information protocol is being used? Obviously something that sits on top of TCP/IP, but what exactly?</p>

<p>It is these first levels of software that on top of TCP/IP that I am interested...</p>

<protocol>
Bitcoin information data protocol
AndroC
# Bitcoin information data protocol

(Asked by: username_0 on 2015-07-31)

Obviously for the Bitcoin system to work, we need an information network on a global scale such as the Internet.

I am sorry if this is a stupid question.

What exact information protocol is being used? Obviously something that sits on top of TCP/IP, but what exactly?

It is these first levels of software that on top of TCP/IP that I am interested...

**Tags:** protocol


---

## 2 answers

### Answer by username_1 on 2015-07-31. Score: 2 | Accepted answer

Bitcoin uses its own wire protocol, which is based on TCP. It's quite simple, with each packet type having strict rules for conformity and a checksum. New objects (transactions and blocks) are flooded through the network to all peers with a flag indicating they want that information, along with auxiliary messages like peer addresses and pings. No encryption is used for any connection.

<https://bitcoin.org/en/developer-reference#p2p-network>


---

### Answer by username_2 on 2015-07-31. Score: 2

It's a fairly simple custom protocol. You can find details at <https://en.bitcoin.it/wiki/Protocol_documentation>, but the messages use this general form:

* magic, 4 bytes, uint32\_t: Magic value indicating message origin network, and used to seek to next message when stream state is unknown
* command, 12 bytes, char[12]: ASCII string identifying the packet content, NULL padded (non-NULL padding results in packet rejected)
* length, 4 bytes, uint32\_t: Length of payload in number of bytes
* checksum, 4 bytes, uint32\_t: First 4 bytes of sha256(sha256(payload))
* payload, variable length, uchar[]: The actual data

The "inv" command is used to send notifications of new transactions and blocks around the network, and the "getdata" command is used to retrieve information about those transactions and blocks.


---

