ZEQ · SDKzeqstate.com

The machine's state

A machine is its folder. What it is, when it is, and everything it has done can be read from a few files and checked by anyone.

FileWhat it holds
machine.jsonits public record: the ZID (its Zeq ID), its public key, its birth, the file it was born on, its anchor
machine.title.jsonits title, the certificate of its birth: ZID, key, birth, file and a serial
machine.zeqits equation sealed under your PIN (scrypt and AES-256-GCM); the capsule and its PIN, kept apart, are the machine
machine.log.jsonlthe signed, hash-linked log; answers sealed at rest under a key only the machine has
machine.owner.keythe owner's API key, readable by you alone
machine.keys.json, machine.card.json, …the keys it issued, its card, and the other files it writes as you use it

Identity

The machine is born from an equation made for it and shown once. Its ZID and keys derive from it; the equation itself is never stored. Whoever holds the equation, or the capsule and its PIN, holds the machine, and nobody else can reissue it.

python3 zeq.py --login                  # re-create it on another device, from the equation or the capsule and PIN
python3 zeq.py --keep                   # seal the equation into machine.zeq under a PIN

GET /card gives anyone the machine's public record and the key a parcel is sealed to.

Title

A machine born on its own signs its title itself. A machine anchored to a foundation has its title minted by that foundation:

--title and GET /title show it with its standing (self or foundation). See Foundation and titles.

The clock

The machine counts time in Zeqonds of exactly 0.777000777 s (777,000,777 ns), f₀ = 1.287 Hz, as an integer read from the system clock's nanoseconds that only moves forward.

MechanismWhat the clock does
Stampevery answer is dated by floor(ns / 777000777), not a wall clock that can jump
Genesisa machine counts forward from its own birth
Logrows are (Zeqond, state hash, previous hash), so replaying to any tick is well defined
Encryptionkeyed to the ZID and the Zeqond, so a ciphertext is bound to who and when
Keysexpiry is a Zeqond

GET /pulse streams the clock, one event per Zeqond, with its phase φ and the pulse R(t) = 1 + α·sin 2πφ, α = 1.29 × 10⁻³.

The log

Every step the machine takes is a row linked to the one before:

GET /log?after=N&limit=M reads it, 250 rows a page. GET /feed gives it as RSS.

Proof that time passed

The elapsed module seals the log into a spine with a sequential delay function. It runs at every boot while the machine serves. GET /elapsed lists the seals, and POST /elapsed/verify checks one in under 0.01 s.

Events

The events module records hits (requests, readings, any stream) hash-linked at the device's own rate. Once a Zeqond it signs one log row sealing the tick's root and count. POST /events appends; GET /events/verify replays the file against every signed tick.

Moving the machine

A machine lives where its log continues:

  1. --move NAME closes the log on this device with a signed moved row and writes machine.zeqmove.
  2. --login machine.zeqmove on the new device continues the same log from the same row.

A restored backup is a copy: a host or sink holding a newer anchor refuses its rows.

The state view

The state skin shows all of this live:

It needs a key of the machine's own.