Skip to content

Decentralized P2P Network

LFS Rank operates as a decentralized ledger of blocks. No single game server holds absolute control. For a race to be considered "official", it must be processed by the consensus network.

Lifecycle of a Race

1. Extraction and Signing (The Host)

When an LFS server detects the end of a race, the local bot generates the results and calculates a chained SHA-256 Hash (which includes the local previous_hash). It then signs this data block with Ed25519 using its private_key, ensuring data cannot be tampered with in transit.

2. Synchronization and Consensus (The Nodes)

The network exposes the current pending state via:

  • GET /api/consensus.php?action=sync

Validator Nodes (which can be hosted by any community member) periodically poll this URL and download raw pending races.

3. Validation and Local Storage (SQLite)

Each node's script (validator.py) exhaustively checks:

  • That the Ed25519 cryptographic signature matches the registered Public Key of the server.
  • That the Hash chain is mathematically correct.

If the block is legitimate, it is injected into the validator's local SQLite decentralized database (validator_node.db).

IMPORTANT

The public endpoint /api/races.php does not fetch raw data from the original host; instead, it reads directly from the locally validated database (validator_node.db), guaranteeing that web users only see cryptographically verified races.

Released under the MIT License.