> 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/wiki/transactions-and-utxos/bitcoin-transactions/first-seen-rule.md).

# First seen rule

The first seen rule, is a rule that is part of the evaluation criteria of both blocks and transactions on the network.

1. First seen rule for Blocks When evaluating blocks, a node considers the first seen block to be the first block that was broadcast, which it is able to completely validate and is the furthest from the genesis block in a valid chain of proof of work. When two blocks are competing in an orphan race and a node is trying to build upon one of them, if a new block is discovered upon the competitor, the node will stop working on the block it saw first and move to the longest chain.
2. First seen rule for Transactions When receiving transactions, the first seen rule is applied to determine which transaction is valid in the case of a double-spend. When a node detects a double-spend, it always considers the transaction that it received first as the valid spender of that coin. The rule has been extended further to add, any blocks which are discovered that include the double-spend transaction, those blocks should also be considered invalid and the node should continue to mine against it, unless a second block is discovered on top of that block, indicating a majority of the network has determined that the other transaction was the first seen.


---

# 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/wiki/transactions-and-utxos/bitcoin-transactions/first-seen-rule.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.
