It ensures each
serve_token transitions in one direction only, making billing and verification deterministic.
1. TL;DR
The AIP state machine controls how an ad progresses from exposure to conversion, ensuring no event is double-counted or reversed.
2. Why it matters
In legacy ad systems, duplicate impressions, repeated clicks, or delayed conversions often lead to inaccurate billing.AIP eliminates this by applying finite state logic — each serve token can only exist in one state at a time, with defined transitions. This makes every transaction:
- Verifiable
- Reproducible
- Auditable
3. State diagram
Each state represents a billing condition. Once a token moves forward, it cannot regress (e.g., a converted ad cannot revert to “clicked”).4. State transitions
| From | To | Trigger | Verified By |
|---|---|---|---|
| PENDING | EXPOSED | cpx_exposure event | Platform |
| EXPOSED | CLICKED | cpc_click event | Platform + Ad Network |
| CLICKED | CONVERTED | cpa_conversion event | Brand Agent + Ad Network |
| EXPOSED | FINALIZED | Timeout (no click) | Ad Network |
| CLICKED | FINALIZED | Timeout (no conversion) | Ad Network |
| CONVERTED | FINALIZED | Ledger processed | Ad Network |
| Any State | REFUNDED | Refund request | Ad Network |
- Exposure → Click: 30 minutes
- Click → Conversion: 24 hours
- Settlement: Once per billing cycle
5. Example lifecycle
- Auction completes,
serve_tokengenerated → state = PENDING - Platform logs an exposure → state = EXPOSED
- User clicks the ad → state = CLICKED
- User completes signup → state = CONVERTED
- At the end of the billing cycle → state = FINALIZED
6. How it prevents double billing
Because every event must follow a defined transition:- Two exposures for the same token are ignored.
- A click without prior exposure is invalid.
- A conversion without a verified click is rejected.
7. Ledger integration
Every final state is logged to the Ad Network ledger, ensuring:- Immutable event chains
- Deterministic reconciliation
- Verified payout records
8. Guarantees
- State transitions are one-directional and irreversible.
- Each transition is signed by at least one verifier.
- Expired states auto-close for settlement.
- Finalized ledgers are immutable and audit-safe.
Summary
The AIP state machine enforces a single source of truth for every ad — preventing duplicates, enforcing fairness, and keeping the ecosystem financially clean.