the three layers

the ontological separation — truth, possibility, speed. nox is organized into three layers that are not implementation detail but a statement about the nature of computation.

the architecture

┌────────────────────────────────────────────────────────────────────┐
│  LAYER 1: WHAT IS                                                  │
│  sixteen deterministic patterns                                    │
│  confluent, memoizable, parallel-safe                              │
│  both prover and verifier execute identically                      │
│                                                                    │
│  the ground truth of computation                                   │
├────────────────────────────────────────────────────────────────────┤
│  LAYER 2: WHAT MIGHT BE AND WHAT IS KNOWN                         │
│  two patterns: call (non-deterministic) + look (deterministic)     │
│  call: prover injects witness, Layer 1 constraints verify          │
│  look: deterministic BBG read, verifier checks authenticated state │
│                                                                    │
│  the origin of privacy, search, and state access                   │
├────────────────────────────────────────────────────────────────────┤
│  LAYER 3: HOW FAST                                                 │
│  five jets: hash, poly_eval, merkle_verify, fri_fold, ntt          │
│  observationally equivalent to Layer 1 compositions                │
│  optimization without changing meaning                             │
│                                                                    │
│  the pragmatics of recursive verification                          │
└────────────────────────────────────────────────────────────────────┘

Layer 1: what is

sixteen deterministic patterns define the irreducible semantics of computation. given the same object, formula, and focus, Layer 1 always produces the same result. the prover and verifier execute identically — there is no information asymmetry at this layer.

five structural patterns (axis, quote, compose, cons, branch) make the system Turing-complete. six field arithmetic patterns (add, sub, mul, inv, eq, lt) give it algebraic power native to the stark proof system. four bitwise patterns (xor, and, not, shl) handle binary data. one hash pattern (hash) provides cryptographic identity.

the patterns form an orthogonal rewrite system: unique tags, linear left-hand sides, no overlap. by the Huet-Levy theorem (1980), this guarantees confluence — the result is the same regardless of evaluation order. this is the mathematical foundation of content-addressed computation: if the result is independent of how you compute it, then (H(object), H(formula)) is a canonical, permanent, universal identifier for that computation's result.

Layer 1 is the ground truth. if you stripped away Layers 2 and 3, you would still have a complete, deterministic, provable virtual machine. slower and less private, but functionally identical. everything builds on this foundation.

Layer 2: what might be and what is known

two patterns. call (pattern 16): the prover injects a value from outside the VM. Layer 1 constraints verify it. the verifier never executes call — it checks the stark proof instead. look (pattern 17): a deterministic read from BBG (the authenticated state graph). the lookup result is a public, authenticated fact; the verifier checks it against the BBG state root.

call is the entire mechanism of privacy, search, and oracle access. it is the boundary between the prover's knowledge and the verifier's knowledge. what the prover knows but the verifier does not crosses this boundary. look is the mechanism of state access — a program reads from BBG without re-deriving the state; the BBG Merkle root in the proof attests to the authenticity of the lookup.

call breaks confluence intentionally. two different provers may inject different valid witnesses for the same constraint. this is the non-determinism that makes zero knowledge proofs possible — the prover demonstrates knowledge without revealing it. soundness is preserved: any witness that fails the Layer 1 constraint check is rejected. look is deterministic: same state root + same key → same value, always.

the ontological status of Layer 2 is "possibility and known fact." Layer 1 says "this IS the result." call says "there EXISTS a witness such that the constraints are satisfied." look says "this IS the authenticated state at this point." the shift from deterministic to existential in call is what enables privacy. the authenticated read in look is what enables stateful programs without embedding the full state in the trace.

without Layer 2, nox would be fully transparent and stateless. every computation would be publicly reproducible and could only use data passed in the initial object. call opens the door to zero-knowledge proofs and private computation. look opens the door to stateful programs that interact with the cyber substrate.

Layer 3: how fast

five jets: hash, poly_eval, merkle_verify, fri_fold, ntt. each is observationally equivalent to a composition of Layer 1 patterns — same input, same output, different speed.

the selection criterion is specific: recursive stark verification and general-purpose computation. with Brakedown (Merkle-free PCS), the zheng verifier costs ~8,000 constraints (generic) or ~825 (CCS jet + batch). see zheng/specs/verifier.md for canonical costs.

Layer 3 preserves confluence. a jet is a semantic no-op — replacing it with its Layer 1 expansion produces identical results on all inputs. the test is automated: a harness runs both versions on random inputs and checks equality. if any jet ever disagrees with its pure equivalent, the jet is buggy and must be fixed or removed.

the ontological status of Layer 3 is "pragmatics." Layer 1 defines what is true. Layer 2 defines what is possible. Layer 3 defines what is fast. speed matters for engineering — but speed does not affect meaning. remove all jets and every program still produces the same result.

the removal test

the three layers are distinguished by what happens when you remove them:

remove Layer 3 (jets): every program still runs, every proof still verifies. the system is slower. no functionality is lost. this is why jets are "optimization without compromise."

remove Layer 2 (call + look): the system loses privacy, search, and state access. every computation becomes fully transparent and stateless — no ZK proofs, no private transactions, no ability to prove without revealing, no interaction with the BBG state graph. but the deterministic core remains complete. Layer 1 is still Turing-complete, still provable.

remove Layer 1 (patterns): nothing remains. the patterns ARE the computation. there is no nox without them.

this asymmetry reveals the architecture: Layer 1 is necessary and sufficient for computation. Layer 2 adds the qualitative capability of privacy. Layer 3 adds the quantitative improvement of speed. each layer is optional only if the layers below it remain.

why this separation matters

in most VMs, optimization is entangled with semantics. a JIT compiler changes how code runs — and sometimes changes what it does (optimization bugs). a GPU kernel is semantically different from its CPU equivalent in edge cases. the boundary between "what the program means" and "how fast it runs" is blurry.

in nox, the boundary is clean. Layer 1 defines meaning. Layer 3 defines speed. they are connected by a testable contract: same input → same output. this contract can be verified by exhaustive testing, by proof, or both. if the contract holds, the jet is correct. if it fails, the jet is wrong. there is no middle ground.

this cleanliness propagates to the stark proof system. the proof verifier checks Layer 1 constraints — the semantics. jets change the constraint layout (more efficient polynomials for the same computation) but the constraints are equivalent. the proof says "this computation was correct" regardless of whether jets were used. the prover can use jets; the verifier checks the same constraints either way.

the stack

nox pattern    → Layer 1 semantics     (what the computation means)
software jet   → Layer 3 optimization  (how the software runs it)
GFP primitive  → hardware acceleration (how the silicon runs it)

the three layers extend beyond software. the five jets map to four Goldilocks field processor hardware primitives: fma (fused multiply-accumulate), ntt (Number Theoretic Transform butterfly), p2r (Poseidon2 round), lut (lookup table). the same computation at three speeds — pattern, jet, silicon — with identical semantics at every level.

this continuity from VM instruction to hardware gate is the deepest expression of the three-layer architecture. the ontological separation (truth, possibility, speed) maps cleanly to the implementation hierarchy (pattern, jet, primitive). the structure of the ideas and the structure of the machine converge.

Graph