# 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`.


---

# Agent Instructions: 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:

```
GET https://docs.konnex.world/understand-konnex/protocol-architecture.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
