> 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 dynamically by asking a question.

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

```
GET https://hub.bsvblockchain.org/wiki/transactions-and-utxos/bitcoin-transactions/first-seen-rule.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
