> For the complete documentation index, see [llms.txt](https://hub.bsvblockchain.org/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hub.bsvblockchain.org/higher-learning/bsv-academy/bitcoin-whitepaper-series/bitcoin-whitepaper-abstract/messaging-between-nodes.md).

# Messaging Between Nodes

<figure><img src="https://3421145409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRTEKu4E7Fvtss3GI9CYU%2Fuploads%2FcMeEWfw6jeDaLRfZT4q9%2FMessaging.gif?alt=media&amp;token=8e29d61f-c3e2-4879-b38e-aaa4f2ac74c0" 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
