Saltar al contenido principal

ZTB1 — The Zeq Timebase Bridge

ZTB1 is the operator that converts between Unix time and Zeqond time. It's the one-line answer to "how does Zeq live inside the wider software ecosystem?".

The formula

ZTB1(t, from_base, to_base) = (t × conv_factor) + phase_offset

Where:

  • conv_factor = 0.777 when converting Unix → Zeq (seconds to Zeqonds).
  • conv_factor = 1 / 0.777 ≈ 1.287 when converting Zeq → Unix.
  • phase_offset is the framework's epoch phase (0 at the Unix epoch, 1970-01-01 00:00:00 UTC).

Synchronization equation

t_Zeq = t_Unix / T_Z + phi_epoch
phi_current = ((t_Unix mod T_Z) / T_Z) × 2 pi
T_Z = 0.777 s

Two important properties:

  1. Lossless. Unix times are 64-bit seconds; Zeqond counts are also 64-bit. The conversion is a single multiplication — round-trip Unix → Zeq → Unix recovers the input to floating-point precision.
  2. Phase-continuous. phi_current is a smooth function of t_Unix, so you can interpolate phase between Zeqond ticks without discontinuities.

Auto-injection

When you call an SDK method with mixed timebases — say, some parameters in Unix seconds and some in Zeqonds — the SDK auto-injects ZTB1 at the boundary:

// You pass Unix t, protocol expects Zeqonds
const cko = await sdk.run("zeq-channel-code", {
window_start_unix: 1745164800, // Unix epoch seconds
window_end_unix: 1745251200,
sample_rate_hz: 44100,
});

// Inside the CKO:
cko.timebase.ztb1_applied = true;
cko.timebase.window_start_zeq = 2245837837.8;
cko.timebase.window_end_zeq = 2245849005.8;
cko.zeqond_at = 72380021.4; // when the call was executed

You don't have to think about this — but if you want to verify, the CKO tells you exactly what conversion happened.

When to pass Zeqonds explicitly

The SDK accepts either timebase for most protocols. Use Zeqonds when:

  • You're chaining CKOs and want bit-exact reproducibility. Zeqond counts are integers in the bridge's fixed-point mode.
  • You're working with the awareness operators (ON0, QL1, TM1, etc.) which take phase directly.
  • You're doing multi-party attestation and want to include the signed Zeqond tuple in your message.

Use Unix seconds everywhere else. Most real-world data is timestamped in Unix, so this is the default ergonomic choice.

Self-hosted vs hosted time

The hosted API runs against the authoritative HulyaPulse at our edge. Self-hosted deployments run their own local 1.287 Hz loop. They agree exactly because the conversion is deterministic from Unix, which NTP keeps within ~1 ms on most hosts.

If you need cross-region attestation beyond ~1 ms, use the hosted clock service — it returns a signed tuple (zeqond_count, t_unix, phi, sig) that you can include in CKOs for verifiable multi-party timing.