> For the complete documentation index, see [llms.txt](https://docs.konnex.world/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.konnex.world/understand-konnex/protocol-architecture.md).

# Protocol architecture

The Konnex stack aligns communication, contracts, intelligence, and motion. Every step — broadcast, bidding, execution, proof, payout — flows through four deterministic layers and one economic loop. Settlement is stablecoin‑native; security, governance, and fees are in KNX. Validators and (optionally) executors post dual stakes (KNX + stablecoins).

## Architecture diagram

![Protocol Architecture — From Packet to Proof](/files/lPLVfaabTgdJ7P1r5wQj)

## Mesh & Gossip

libp2p + QUIC, NAT‑friendly, always‑on.

* Task Channel `task.*` — signed JSON intents.
* Bid Channel `bid.*` — bids with ETA and collateral declarations.
* Score Channel `score.*` — validator ScoreRoot each block (KPIs, slashing directives).
* Proof Channel `proof.*` — batched evidence references (video/GPS/IMU/torque/thermal).

## Registry & Smart Contracts

* `RobotIdentity` — hardware‑secured keys and on‑chain trust.
* `TaskRegistry` — stablecoin escrow, deadlines, penalties, fee‑split logic.
* `StakeVault` — dual staking (KNX + stablecoins) for validators/executors; class‑based slashing.
* `BondMatrix` — stablecoin bonds from third‑party stakers.
* `PayoutRouter` — atomic stablecoin releases after validation.

Every packet’s SHA‑3 hash becomes its immutable JobID.

## Intelligence & Motion Markets

Two miner roles; one bidding protocol.

* Motion Miners — trajectories in deterministic sandbox (Bullet3D + seeded RNG).
* AI Miners — perception/planning models as WASM weights or streaming endpoints.

## Verification & PoPW

Validator council, deterministic replay.

1. Deterministic replay of trajectories.
2. Model audits vs ground truth.
3. PoPW check — evidence completeness, alignment, binding to JobID/deadline.
4. Slash/Reward — write ScoreRoot; release stablecoin escrow or apply stablecoin penalties in the same block (fees in KNX).

### Dual‑Stake for Validators

* KNX security stake — slashed on protocol/consensus faults.
* Stablecoin assurance stake — compensates users for settlement‑layer faults (e.g., approving invalid PoPW).

Fast‑finality targets: <10 s for sim‑only; <60 min with full PoPW.

## Economic Loop

* Stablecoins — settlement and validator assurance.
* KNX — security and fees; buyback flywheel via small stablecoin flow fee.

Trust‑adjusted stake sizing (illustrative): `S_KNX ∝ 1/√T`, `S_stable ∝ 1/√T`.
