# 7.12 How a Bitcoin Transaction Works

Understanding the step-by-step process of a Bitcoin transaction is crucial for grasping the underlying mechanics of Bitcoin. Here’s a breakdown of how it works:

1. Someone requests a transaction:
2. * A user initiates a transaction by specifying the recipient's Bitcoin address and the amount of Bitcoin to be sent.
3. Transaction is broadcasted to P2P computers (nodes):
4. * The transaction is broadcasted to the Bitcoin network, where it is received by multiple peer-to-peer nodes. Each node maintains a copy of the blockchain.
5. Miners verify the transaction:
6. * Nodes verify the transaction's validity by checking if the sender has enough funds and ensuring the transaction adheres to Bitcoin's rules.
   * Once verified by the nodes, the transaction is forwarded to miners.
7. Transactions are combined to form a data block:
8. * Miners group multiple verified transactions into a block. This block will eventually be added to the blockchain.
9. New block added to the existing blockchain:
10. * Miners compete to solve a complex mathematical problem, a process known as proof-of-work. The first miner to solve the problem gets to add their block to the blockchain.
    * The newly added block is then broadcasted to the network, and all nodes update their copies of the blockchain to include the new block.
11. The transaction is complete:
12. * Once the new block is added to the blockchain, the transaction is considered complete and confirmed. The recipient can now access the transferred Bitcoins.


---

# 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://bitcoin-school-kenya.gitbook.io/bitcoin-school-kenya-diploma-english-version-2024/7.12-how-a-bitcoin-transaction-works.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.
