2.10 Offline Architecture and Protocol Design: Exit Evidence
Evidence · Step: 2.10 Offline Architecture and Protocol Design (Design Only)
| Step | 2.10 Offline Architecture and Protocol Design (design only) |
| Date | 2026-11-16 |
| Decision | ADR-0019 |
| Result | Passed; external security review requested, card chip confirmation pending |
Deliverables
Section titled “Deliverables”| Deliverable | Where |
|---|---|
| Offline spec v1 | docs/offline/protocol.md, summarised in spec §5 |
| Threat addendum | docs/offline/threat-addendum.md: OT-01 to OT-20 |
| Scenario walkthroughs | docs/offline/scenarios.md: the ten scenarios |
| Worked journal entries | E16–E18, E25–E31 |
| Security review request | docs/offline/review-request.md |
The work arrived in six pull requests: ADR-0019 (#107), the protocol (#108), the threat addendum (#109), the entries (#110), the scenarios (#111) and this evidence (#112). Two decisions were made with the maintainer:
- Hardware: cards and phones, with P-256 signatures.
- Late receipts: paid by the payer’s wallet first, then by the platform’s loss account.
Implementation tasks
Section titled “Implementation tasks”| Task | Done, in protocol.md |
|---|---|
| Message formats (voucher, receipt) with canonical encoding | §3, §7, §8: tagged, length-prefixed, big-endian; the voucher, the receipt, the acknowledgement, the close, and the certificates |
| Signature scheme | §2: ECDSA P-256, SHA-256, low-S, 64-byte r ‖ s; digests exclude signatures |
| Key hierarchy | §4: root (offline) → issuer (rotated every 90 days) → device (in hardware) |
| Device registration and attestation | §5: card chip certificates, Android Key Attestation, tier assignment, device certificates and states |
| Trust tiers with limits and expiry | §6: A, B and C, with per-voucher limits, lifetimes, grace and a per-customer cap |
| Full state machines for voucher and receipt | §7 (voucher states), §9 (the 13 ordered receipt checks and outcomes), §5 (device states) |
| The gap timeout | §11: 72 hours, or at the return; later arrivals must match their successor’s link |
| Conflict handling | §10: freeze the device and voucher, keep what settled, alert |
| The dispute path | §14: findings, resolutions and their entries |
| The loss policy | §12: payer’s wallet, then 5030, the shortfall blocking new vouchers, a 90-day deadline |
| An offline threat model addendum | threat-addendum.md |
| Worked journal entries for every offline state | E16–E18 and E25–E31, with a table of states that post nothing |
| Align with the card hardware: keys, a counter and signing | §15, requirements H1–H8. No chip has been chosen yet: they are to be confirmed with the vendor before cards are ordered |
Testing requirements
Section titled “Testing requirements”| Requirement | Done | Result |
|---|---|---|
| Desk-check every threat against the protocol | threat-addendum.md: 20 threats, each with its controls and the protocol section | 10 prevented; 9 bounded (by the voucher, the tier and per-customer caps, or the late deadline), most of them also detected; 1 detected (OT-18, through the hash chain). The open points are listed |
| Walk 10 adversarial scenarios on paper | scenarios.md: clone, replay, forged amount, clock rollback, payee double-upload, payer never syncs, lost device, partial sync, voucher expiry race, colluding merchant | Each walked step by step, with every receipt’s outcome |
Walking the scenarios refined the design in three places:
- The payee’s challenge binds a receipt to the moment of payment.
- Digests exclude the signature, because ECDSA can sign one body two ways, and two signatures of one body must not be a conflict.
- A lost device’s voucher is never closed early, because receipts may still be on their way.
Acceptance criteria
Section titled “Acceptance criteria”Every scenario has a defined outcome and a defined accounting result. The summary table gives, for each of the ten:
- its outcomes;
- its worked entries;
- the platform’s loss.
Every protocol state has an entry (E16–E18, E25–E31), or is named as posting nothing. Every entry balances, checked by script.
Exit gate
Section titled “Exit gate”An external security review of the protocol is requested. review-request.md states the scope, eight questions for a reviewer with a cryptography background, and what is asked back.
No reviewer is engaged yet. As with the accounting and dispute reviews, it needs a person. It must be done before step 2.11 builds device registration, and before any card is personalised.
Not done in this step
Section titled “Not done in this step”- The external review itself: requested, not done.
- Confirming H1–H8 with a card chip vendor: no chip is chosen.
- The code: steps 2.11 (registry and vouchers), 2.12 (receipts and settlement), 2.13 (conflicts, expiry and loss) and 2.14 (simulation). The contract’s offline request bodies are specified then.