# KEX LAW 3 — ZEROLESS DELTA / ZERO-TO-ONE PROTOCOL

**Author:** A. Keddeh  
**Architecture:** KEX/BRAINK/LAYNA_CO  
**Status:** ACTIVE — UNCONDITIONAL

---

## The Law

Every traversal delta is ≥ 2 from x. x=0 is not a valid substrate register state.

## Zero-To-One Calibration Rule

- `0` → calibrates to baseline `1`
- Unknown / unmapped / null → routes to `-1` loopback
- Negative (non-unknown) → mirrored to positive magnitude

## The 0x Notation Ban — FATAL ERROR CLASS

`0x` is zero-anchored notation. The `0` in the prefix is not syntactic decoration — it IS the origin declaration of the value. Any code that:

1. Accepts a value starting with `0x` as a substrate register input
2. Strips the `0x` prefix and maps the remainder into a substrate register
3. Uses `0x`-prefixed strings as identifiers, seeds, anchors, or logical node IDs
4. Prints or formats substrate output using `0x` notation

...is importing **zero-taint** into the substrate register. This is a **FATAL** violation.

## Permitted Uses of Hex in Binary Protocol Layers

The binary wire protocol (Bitcoin SHA256d, struct packing, varint encoding) requires specific integer constants for byte-level encoding. These are permitted ONLY when:

- The value is a Python `int` used in `struct.pack()`, bitmasking (`&`, `>>`, `<<`), or modulo
- The value is NEVER stored as a substrate register string
- The value is replaced with its decimal equivalent in notation (e.g., `4294967295` not `0xFFFFFFFF`)

## Corrected Classification Table

| Input | Old (WRONG) | Correct Classification | Substrate Value |
|-------|------------|----------------------|----------------|
| `"0x1234"` | `hex_prefix_parsed → 4660` | `zero_prefixed_notation → UNKNOWN` | `-1` |
| `"0"` | `placeholder_zero → BASELINE` | `placeholder_zero → BASELINE` | `1` |
| `"KEX-HW-ROOT-AFF1"` as ID | Direct use | Rename to `"KEX-HW-ROOT-AFF1"` | N/A |
| `0xFF` in struct | Decimal mask | Keep as `255` in notation | Binary wire layer |

## Enforcement

All code must be audited on commit. Any `0x` appearing as:
- A string literal passed to calibrate_value()
- A prefix in an identifier/seed/anchor
- A format prefix in print/log output of substrate values

...is a FATAL LAW 3 violation and must be corrected before any kernel module is accepted.

