# Miners and scores

> How the directory is built, what the score is made from, and how a miner operator submits an endpoint.

## Where the list comes from

Every miner in the on-chain registry is listed, reachable or not. Stake, calibration, capacity, slashing and models come from chain storage, read at a finalized block and refreshed every few minutes. Session history comes from finalized chain events: every compute channel the miner was paid through and how it ended. New miners appear on the next pass with no manual step.

## The score

A number from 0 to 100, with a rank. It is computed from on-chain facts only:

- how the miner's paid sessions ended: settled, timed out, acknowledgement expired, refunded, voided, fraud upheld,
- how many there were, how recent, and from how many distinct payers,
- stake,
- slashing record: strikes, blacklist, failed acknowledgements,
- the state of its hardware calibration.

The exact formula is not published. Every input is returned beside the score, so anyone can judge a miner for themselves. The same chain state always gives the same score. Scores are recomputed about once a minute.

Facts the router measures itself, such as whether the endpoint answers and how fast, are reported separately under `router_measured` and are not part of the score.

## Endpoints

Session URLs are not on chain. The router collects candidate URLs from public sources and from operators, and accepts one only when the worker behind it proves which miner it is:

1. The URL is https, canonical, and resolves only to public addresses.
2. `GET /session/info` answers 401 with a session challenge, as a live worker does.
3. `POST /session/info-proof` answers a fresh random challenge with a signature for this chain.
4. The account named in the proof is a registered miner.
5. The session key that signed is tied to that miner on chain, by a signed offer of the miner or a finalized channel of the miner that used it.

An entry that passes 1 to 4 but not 5 is kept as not yet tied and is never routed to. Entries are checked again every few minutes and before every session.

| Directory label | Meaning |
| - | - |
| Ready | Proven, and the worker reports ready. Takes traffic. |
| Live, not ready | Proven and answering, but the worker reports it is not ready. |
| Key not tied | Valid proof, but the session key is not yet tied to the miner on chain. |
| Down | Proven before, failing its checks now. |
| No endpoint | No session URL is known. |

## Submitting an endpoint

Use the [form](/operators/) or:

```bash
curl -X POST https://api.floprouter.com/v1/miners/<miner-address>/endpoint \
  -H "Content-Type: application/json" \
  -d '{"url": "https://miner.example.org"}'
```

`200` accepted and routable, `202` recorded but not routable until the chain ties the session key to the miner, `422` rejected or unreachable. Anyone may submit; only the proof decides which miner a URL belongs to.

## Network totals

`GET /v1/stats` returns totals for the whole network: miners, reachable miners, models, sessions routed, settle rate. (live)
