<p>The Bitcoin protocol specification can be found on the <a href="https://en.bitcoin.it/wiki/Protocol_specification" rel="noreferrer">Bitcoin Wiki</a>. The <a href="https://en.bitcoin.it/wiki/Network#Standard_relaying" rel="noreferrer">Network wiki page</a> has information on how information is relayed using the protocol.</p>

<p>Clients exchange messages over TCP/IP. With this messages, they can express their state of the blockchain and request others to send them parts they do not yet own. When you want to broadcast a new block or transaction, the <code>inv</code> message type is used to let people know you have the new data. Since no other client has that data already, it will request the data element using <code>getdata</code>. You will reply with a <code>block</code> or <code>transaction</code> message.</p>

<p>So basically, to reduce bandwidth usage, only an <code>inv</code> is truly relayed. Each node will then request the new data from one of the other nodes that broadcasted the <code>inv</code>.</p>

CC BY-SA 3.0
2013-12-11T22:32:05.787Z
Thanks. I had not stumbled across the "Network" page on the wiki. It's very clear.
Will Nelson
CC BY-SA 3.0
2013-12-11T16:54:01.420Z
2013-12-11T16:54:01.420Z
Steven Roose
<p>What is the protocol for relaying transactions and/or blocks in bitcoin? I realize that nodes never relay a transactions and blocks with a variety of properties (e.g., invalid transactions). This question is concerned more with the specific broadcast/relay protocol. In particular, are there any issues with broadcast loops and if so, how are they solved? Is it as simple as each node remembering which txs and blocks it has already transferred and never relaying twice? Thanks.</p>

<protocol><relay><broadcast>
How are transactions and blocks relayed?
Will Nelson
# How are transactions and blocks relayed?

(Asked by: username_0 on 2013-12-11)

What is the protocol for relaying transactions and/or blocks in bitcoin? I realize that nodes never relay a transactions and blocks with a variety of properties (e.g., invalid transactions). This question is concerned more with the specific broadcast/relay protocol. In particular, are there any issues with broadcast loops and if so, how are they solved? Is it as simple as each node remembering which txs and blocks it has already transferred and never relaying twice? Thanks.

**Tags:** protocol, relay, broadcast


---

## 1 answers

### Answer by username_1 on 2013-12-11. Score: 5 | Accepted answer

The Bitcoin protocol specification can be found on the [Bitcoin Wiki](https://en.bitcoin.it/wiki/Protocol_specification). The [Network wiki page](https://en.bitcoin.it/wiki/Network#Standard_relaying) has information on how information is relayed using the protocol.

Clients exchange messages over TCP/IP. With this messages, they can express their state of the blockchain and request others to send them parts they do not yet own. When you want to broadcast a new block or transaction, the `inv` message type is used to let people know you have the new data. Since no other client has that data already, it username_0 request the data element using `getdata`. You username_0 reply with a `block` or `transaction` message.

So basically, to reduce bandwidth usage, only an `inv` is truly relayed. Each node username_0 then request the new data from one of the other nodes that broadcasted the `inv`.

> **Comments:**
> **username_0**: Thanks. I had not stumbled across the "Network" page on the wiki. It's very clear.  

---

