> 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/solving-the-double-spending-problem.md).

# Solving the Double-Spending Problem

<figure><img src="https://3421145409-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRTEKu4E7Fvtss3GI9CYU%2Fuploads%2Few0oIiDyCgYu9yVhZagK%2Fsolving.gif?alt=media&amp;token=f9242321-9d9e-46c7-b0dd-53c228e94b12" alt=""><figcaption></figcaption></figure>

*We propose a solution to the double-spending problem using a peer-to-peer network.*

\- Satoshi Nakamoto, Bitcoin Whitepaper

The **double-spending problem** refers to the risk that a digital coin can be spent more than once. This issue arises when a coin is signed to create a transaction and submitted to the network before being used again to create a different transaction that pays a different recipient. Bitcoin addresses this problem through the establishment of a **peer-to-peer network** of nodes responsible for gathering, validating, and timestamping all transactions.

In this network, **only the first-seen version of a transaction is accepted**, effectively preventing double spending. The Bitcoin network operates as a global infrastructure built by enterprises competing for the right to extend the ledger by adding new transactions. Each transaction can only be processed once, and the inputs used in a transaction are consumed, ensuring that **once a transaction is submitted to the network, it is broadcast to all nodes within seconds**, making it nearly impossible to perform double spends without the assistance of a fraudulent node.


---

# 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/solving-the-double-spending-problem.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.
