# Messaging Between Nodes

<figure><img src="/files/w7G06B1mdTdpYU5o0qCU" alt=""><figcaption></figcaption></figure>

*Messages are broadcast on a best effort basis, and nodes can leave and rejoin the network at will, accepting the longest proof-of-work chain as proof of what happened while they were gone.*

\- Satoshi Nakamoto, Bitcoin Whitepaper

In the Bitcoin network, messages are broadcast on a **best-effort basis**, allowing nodes to **leave and rejoin the network at will**. When a node receives a new transaction, it **automatically broadcasts it to all nodes with which it has a peer connection**. This practice reduces the time required for other nodes to validate a block that includes the transaction, thereby enhancing the likelihood of quick validation.

Nodes accept the **first-seen version of a transaction as the valid version** and consider any subsequent transaction attempting to spend the same inputs as an attempt at double-spending, therefore, invalid. Similarly, when it comes to block announcements, **nodes accept the first valid block they receive that builds upon the longest proof-of-work chain** as the next block in the chain. Occasionally, simultaneous block discoveries occur, resulting in one of those blocks being excluded from the longest chain, leading to the creation of **orphan blocks**.

When a node re-joins the network, it connects to other nodes and requests records of all transactions and blocks that have occurred since its disconnection. The nodes then validate this information and re-enter the competition from the most recently discovered block, ensuring that the **network remains fluid and adaptable to changes in participation.**


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hub.bsvblockchain.org/higher-learning/bsv-academy/bitcoin-whitepaper-series/bitcoin-whitepaper-abstract/messaging-between-nodes.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
