serve_token may transition through states — exposure, click, and conversion.It ensures each
serve_token transitions in one direction only, making billing and verification deterministic. Operators implement their own state handling logic as long as these protocol guarantees are met.
1. TL;DR
The AIP state machine defines allowed state transitions and invariants for ad lifecycle tracking, ensuring no event is double-counted or reversed. Operators implement their own detection, verification, and enforcement logic.
2. Why it matters
In legacy ad systems, duplicate impressions, repeated clicks, or delayed conversions often lead to inaccurate billing.AIP eliminates this by defining protocol-level state constraints — each serve token can only exist in one state at a time, with defined allowed transitions. This makes every transaction:
- Verifiable
- Reproducible
- Auditable
3. State diagram
Each state represents a billing condition. The protocol guarantees that once a token moves forward, it cannot regress (e.g., a converted ad cannot revert to “clicked”). Operators implement their own state detection and transition logic to enforce these constraints.4. State transitions
The protocol defines allowed transitions and constraints. Operators implement their own detection, verification, and enforcement logic.| From | To | Trigger | Verification Responsibility |
|---|---|---|---|
| PENDING | EXPOSED | cpx_exposure event | Operator (may use platform signals) |
| EXPOSED | CLICKED | cpc_click event | Operator (may use platform and network signals) |
| CLICKED | CONVERTED | cpa_conversion event | Operator (may use brand agent and network signals) |
| EXPOSED | FINALIZED | Operator-defined expiration or attribution window | Operator |
| CLICKED | FINALIZED | Operator-defined expiration or attribution window | Operator |
| CONVERTED | FINALIZED | Operator-defined settlement processing | Operator |
| Any State | REFUNDED | Operator-defined refund or reversal action | Operator |
- Transitions are one-directional
- No regression once a higher state is reached
- At most one billable terminal state per
serve_token
5. Example lifecycle
- Auction completes,
serve_tokengenerated → state = PENDING - Operator verifies an exposure event → state = EXPOSED
- Operator verifies a click event → state = CLICKED
- Operator verifies a conversion event → state = CONVERTED
- Operator finalizes settlement → state = FINALIZED
6. How it prevents double billing
The protocol constrains allowed transitions:- Two exposures for the same token cannot both transition the state forward.
- A click without prior exposure state is not a valid transition.
- A conversion without a verified click state is not a valid transition.
7. Ledger integration
Operators maintain ledgers that record state transitions and final states, ensuring:- Immutable event chains
- Deterministic reconciliation
- Verified payout records
8. Guarantees
The protocol guarantees:- State transitions are one-directional and irreversible.
- No regression once a higher state is reached.
- At most one billable terminal state per
serve_token. - Finalized states are immutable and audit-safe.
Summary
The AIP state machine defines protocol-level constraints that ensure a single source of truth for every ad — preventing duplicates, enforcing fairness, and keeping the ecosystem financially clean. Operators implement their own state management systems to enforce these constraints.