> ## Documentation Index
> Fetch the complete documentation index at: https://www.offlineprotocol.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Architecture

> This system enables trustless, onchain location verification through a decentralized operator network.  It combines client-side latency measurement, operator validation, and EigenLayer security guarantees.

## Technical Components

{" "}

<Card title="Client" icon="mobile">
  <ul>
    <li>Connects to operators over WebSocket.</li>

    <li>
      Sends <strong>ping</strong> and <strong>ack</strong> messages.
    </li>

    <li>Provides claimed coordinates for verification.</li>
  </ul>
</Card>

{" "}

<Card title="Operator" icon="server">
  <ul>
    <li>Registers as a decentralized witness.</li>
    <li>Timestamps packets with nanosecond precision.</li>
    <li>Computes geodistance (Haversine formula).</li>
    <li>Validates RTT against theoretical latency bounds.</li>

    <li>
      Signs & submits results to <code>HelloWorldServiceManager</code>.
    </li>
  </ul>
</Card>

{" "}

<Card title="Smart Contracts" icon="file-code">
  <ul>
    <li>
      <strong>Service Manager</strong>: Manages verification tasks & operator
      responses.
    </li>

    <li>
      <strong>Delegation Manager & AVS Registry</strong>: Handle operator
      staking & registration.
    </li>

    <li>
      <strong>ECDSA Registry</strong>: Validates operator signatures.
    </li>
  </ul>
</Card>

<img src="https://mintcdn.com/offlineprotocol/zsjwdO0fFaYaDkuO/images/POL.png?fit=max&auto=format&n=zsjwdO0fFaYaDkuO&q=85&s=4c1182fdb617d7b714ab5de0a73d343e" alt="pol architecture" width="2722" height="1474" data-path="images/POL.png" />

*Figure: POL Architecture*

## System Flow

### 1. Commitment Creation

* Client → Backend: Requests geohash commitment of claimed location.
* Backend → Contract: Submits the commitment.

### 2. Operator Discovery

* Backend → Client: Returns list of registered operators.
* Operators: Act as decentralized witnesses.

### 3. Connection Establishment

* Client Frontend: Opens WebSocket connections with operators.
* Each connection enables latency-based verification.

### 4. Ping / Pong Exchange

* Client → Operator: Sends a ping with claimed coordinates.
* Operator: Records timestamp, saves claim, responds with pong.

### 5. Ack for RTT Measurement

* Client → Operator: Sends ack message.
* Operator: Calculates RTT and compares to expected latency.

### 6. Location Verification

* Operator computes:
  * Geodistance (Haversine formula)
  * Min RTT (speed-of-light bound)
  * Actual RTT (measured)

If within tolerance → Claim is valid\
If out of bounds → Claim is rejected

### 7. Onchain Response

* Operator → Contract: Signs result and calls `respondToTask`.
* Submission includes metadata, claim, and verification status.

### 8. Aggregation (Indexer Layer)

* Collects responses from multiple operators.
* Aggregates into a final proof.
* Publishes proof onchain for smart contracts to consume.
