G TRIP·GyID
← All documentation

Protocol implementation notes

Field-by-field mapping between draft-04 and this implementation, including the gaps this project fills.

draft-ayerbe-trip-protocol-04

1. Breadcrumb fields

A breadcrumb is a CBOR map keyed by the integers 0–8. The signature covers the deterministic CBOR of fields 0–7; the block hash is SHA-256 over the full encoding (0–8).

keynametypemeaningnotes
0indexu64Position in the chain, contiguous from 0Enforced identically on the verifier
1identitybstr(32)Ed25519 public key of the attesterConstant for the whole chain
2timestampu64Unix secondsDrives the §4.1 / §4.2 interval rules
3h3 cellu64H3 cell (transported as hex to avoid JS precision loss)res 10 is about 15,000 m²
4resolutionu87 to 10This implementation defaults to 10
5context digestbstr(32)SHA-256 over h3 / time bucket / Wi-Fi / cell / IMUMissing parts are omitted entirely
6prev hashbstr(32) | nullPrevious block hash; null at genesisForms the hash chain
7meta flagsmapIncludes the exploration session flag§4.2
8signaturebstr(64)Covers the deterministic CBOR of fields 0–7Ed25519

2. Where the draft is silent, and what this implementation chose

The draft deliberately leaves transport binding, naming and blockchain anchoring to companion specifications. That is an invitation rather than a gap.

GapDraft This implementationWhere
Transport bindingNot specifiedlibp2p relay, multiple verifiers, real-time challenge channel (companion draft direction)trip-server WS + GPv1 design
Naming systemNot specifieddid:geoyuan + W3C DID Document; display names go in alsoKnownAstrip-core::did
Blockchain anchoringNot specifiedEVM anchoring of epoch roots and a revocation model (no tokens, no trajectory anchoring)GeoTITRegistry.sol
TIT field numberingNot specifiedA GYIP-0003 internal convention; to be re-pinned once -05 landstrip-core::tit + golden vectors

3. Numeric determinism

Interoperability requires the same logic to produce the same bytes. The following conventions are pinned by golden vectors; any language following the same steps should land within the stated tolerance.

TopicConventionVerified by
Deterministic CBORRFC 8949 §4.2 canonical form; same logic yields identical bytes on any platformGolden vectors in tests/vectors/golden-vectors.json
PSD numeric conventionsNaive O(N²) DFT, f_k = k/N, ordinary least squares, IEEE-754 f64Cross-implementation α drift below 1e-9
Lévy normalisation512-node composite Simpson after the substitution t = u·e^sDrift below 1e-9
QuantilesLinear interpolation with rank = p·(n−1)Calibration reports are reproducible
ROCDescending threshold sweep, ties merged, trapezoidal AUC over FPRNo dependence on tie ordering

4. Chain rules, implemented twice

Each rule exists twice: on device (WASM, refusing to append to the local chain) and on the verifier (Rust, refusing to store the evidence). They are independent, so defeating one still leaves the other — which is exactly why the end-to-end test observes 400 responses.

Observed: collecting two breadcrumbs at a fixed coordinate makes both the client self-check and the server reject, with the server returning “duplicate h3 cell at consecutive index 1”.