The ZeqState Envelope
Every computation issued by the Zeq kernel returns its result inside a ZeqState envelope. The envelope is the canonical serialization the kernel signs, the verifier re-derives, and the Explorer publishes. Anything not inside the ZeqState is, by construction, unverifiable.
Definition
A ZeqState is a deterministic, length-prefixed structure containing exactly the fields required to reproduce and verify a computation:
ZeqState := {
zeqondTick: uint64, // integer Zeqonds since the Zeq epoch
phase: float64, // φ ∈ [0, 2π) sampled at Step 0
pulseHz: float64, // 1.287
zeqondSec: float64, // 0.777
ko42: {
mode: "auto" | "manual",
alpha: float64, // 0.00129 in auto mode
beta: float64?, // present only in manual mode
initialPhase: float64
},
operators: string[], // ordered operator chain (KO42 always first)
inputDigest: bytes32, // SHA-256 of canonical input payload
resultDigest: bytes32, // SHA-256 of canonical result payload
result: any, // raw R(t) result
precisionBound: float64, // ≤ 0.1 % under nominal tier
proof: {
alg: "HMAC-SHA256",
value: bytes32, // HMAC over the canonical envelope
keyId: string // public verification path identifier
}
}
The ordering of fields is fixed; canonical serialization uses big-endian length prefixes with no whitespace. A single byte change in any field invalidates the proof.
Why an Envelope at All
A bare numerical result is not verifiable. A result paired with a timestamp is not verifiable either, because nothing binds the two together. The ZeqState is the smallest object that satisfies all four kernel invariants simultaneously:
- Phase binding —
phaseis sampled at Step 0 and is the same value KO42 modulates the metric against. The ZeqProof seals it, so the verifier can re-derive φ fromzeqondTickand confirm consistency. - Operator binding — the ordered
operatorsarray is part of the HMAC input, so substituting an operator chain after the fact breaks the seal. - Input/output binding —
inputDigestandresultDigestare hashes of canonical serializations of the request payload and the result payload. Changing the request to fit the result, or vice versa, breaks the seal. - Tier-aware precision —
precisionBoundrecords the kernel-asserted error bound under which the result is valid. Verifiers refuse results whose claimed bound is tighter than the operator/tier combination supports.
Lifecycle
- Step 0 (Phase) issues a fresh
zeqondTickandphase. These two fields populate the envelope first. - Step 1 (KO42) writes the
ko42block. - Steps 2–5 populate
operatorsand computeinputDigest. - Step 6 (Execute) runs the solver and writes
resultandresultDigest. - Step 7 (Verify) assigns
precisionBoundand seals the envelope by computing the HMAC intoproof.value.
After Step 7 the ZeqState is immutable. The kernel hands it to the caller and (if Explorer is enabled for the request) publishes a redacted form to the public feed.
Verifying a ZeqState Offline
Verification requires no API key and no network access to the kernel:
- Recompute the canonical serialization from the envelope's fields.
- Re-derive φ from
zeqondTickusingphase = 2π · frac(zeqondTick · zeqondSec / zeqondSec) = 2π · frac(zeqondTick). Confirm it matchesphaseto machine precision. - Look up the public verification key for
proof.keyId. - Recompute
HMAC-SHA256(verificationKey, canonicalEnvelope)and compare againstproof.valuebyte-for-byte.
If any of those steps fails, the envelope is rejected.
Cross-References
- ZeqProof — the HMAC sealing layer.
- Seven-Step Protocol — how each field is populated, in order.
- Precision Bound — how
precisionBoundis computed and enforced. - CKO — how an operator chain becomes a Combined Kinematic Operator that the envelope records.