Getting Started (Timeverse v4.6)
Build a time‑bound application with tick‑canonical windows, signed requests, anti‑replay, TSAE receipts, and optional HS‑Carbon, T‑WATCH witness, and Clockchain anchoring (v4.6-compatible).
Reference Flow
timeverse.ma
binutecoin.com
harmonysegment.com
What you get
Prerequisites
- Next.js app (or any web backend)
- Timeverse SDK (reference implementation)
- Node 18+ recommended
Resilience First
timeverse.ma is unreachable.Key Concepts (MUST READ)
Tick‑canonical windows
Timeverse uses integer ticks instead of floats to avoid boundary ambiguity.
in_window ⇔ d_ticks(phi_now, phi_center) ≤ deltaPhi_ticks
No‑Float rule
Enforcement logic MUST NOT use floats. Floats are strictly for display (UI).
Canonicalization (TV-CANON-JSONSORT-2026-01)
Signatures MUST be computed over UTF-8 JSON with sorted keys and no extra whitespace.
Handling Big Integers (u64)
JavaScript cannot safely represent integers > 2^53-1. Any u64 field MUST be encoded as a decimal string.
{
"estimated_emissions_mgco2_u64_str": "123456789012345"
}Configure your app
Add environment variables to your .env file:
TIMEVERSE_API_KEY="dev-key"
TIMEVERSE_CONVENTION_ID="TV-CONV-EARTH-2026-01:DAILY;timescale=TV_MONO_NOLEAP;t0=1663912800;T_cycle=86400;encoding=ticks;R=86400;boundary=inclusive_le"
TIMEVERSE_SWT_ZONE="12"
TIMEVERSE_TILE_ID="600"Instantiate the client:
import { TimeverseClient } from '@/lib/timeverse/client';
export const timeverse = new TimeverseClient({
apiKey: process.env.TIMEVERSE_API_KEY,
conventionId: process.env.TIMEVERSE_CONVENTION_ID,
});Get the current Timeverse state
Use the public API to render UI and align agents:
const state = await fetch('/api/timeverse/state').then(r => r.json());
// Current state includes day_index, phi_ticks, hs_local, binute3B) Fetch pinned keys (recommended)
Offline verification requires pinning SecProf and Clockchain agent keys. Pinned keys are usually served from /api/v1/keys.
{
"schema":"TV-KEYS-2026-01",
"security_profile_id":"TV-SP-2026-BASELINE-v1",
"secprof_allowlist":[
{"node_id":"ORCH","public_key_raw_hex":"..."},
{"node_id":"T-WATCH-7421","public_key_raw_hex":"..."}
]
}Issue a server challenge
Freshness Rule
{
"schema":"TV-TEMPORAL-CHALLENGE-2026-01",
"day_index":1240,
"phi_ticks":59318,
"ttl_s_u32":120,
"nonce_rand_128_hex":"..."
}Create a SignedTemporalRequest
The frontend creates an intent locked in a specific tick window:
async function sendSecureAction(payload: any) {
const challenge = await fetch('/api/v1/challenge').then(r => r.json());
const req = await timeverse.createSignedRequest({
scope: 'demo.action.example',
payload,
// tick window, integer-only
deltaPhiTicks: 120, // ±120 ticks
// bind to challenge for freshness
challenge,
swtZone: 12,
tileId: 600,
});
return fetch('/api/secure-action', {
method: 'POST',
body: JSON.stringify(req),
});
}Verify on the server (Gateway)
Wrap your API routes with the Timeverse gateway middleware:
import { timeverseGateway } from '@/lib/timeverse/gateway';
import { NextResponse } from 'next/server';
const handler = async (req, enriched) => {
// 1. Signature valid?
// 2. Identity pinned?
// 3. Tick window satisfied?
// 4. Nonce not replayed?
return NextResponse.json({ ok: true });
};
export const POST = timeverseGateway(handler);Generate a TSAE receipt
A TSAE is your compliance artifact. It proves exactly when, where and under which policy an action happened.
{
"tsae_schema":"TV-TSAE-2025-12",
"scope":"tsae.now.trust",
"day_index":1240,
"phi_action_ticks":59340,
"fidelity_u16":61000,
"action_hash_hex":"<sha256_hex>"
}Advanced Options
HS‑Carbon Gating
Enforce energy-aware execution thresholds using fixed-point integers (mWh, mgCO2/kWh).
T‑WATCH Witness
Include a physical device witness signature bound to your anchor hash for maximum non-repudiation.
Anchor into Clockchain
Create permanent audit trails by anchoring receipt hashes.
anchor_hash = sha256(canonical_json(tsae_or_anchor_envelope))Submit via POST /v1/clockchain/anchor and verify with Merkle inclusion proofs.