# Key Encoding - Verification Matrix

| Req ID | Requirement | Verification Method | Test File(s) | Status |
|--------|-------------|-------------------|--------------|--------|
| KEY-001 | Hash keys MUST be raw 32-byte Bytes32 values with no prefix | Unit test: `hash_key` length, byte identity, round-trip `Bytes32`, distinct inputs | `tests/key_001_tests.rs` | Done |
| KEY-002 | Height keys MUST be u64 big-endian 8-byte encoding with correct sort order | Unit test: `height_key`/`decode_height_key`, table vectors, sort invariant, LE counterexample | `tests/key_002_tests.rs` | Done |
| KEY-003 | Epoch keys MUST be u64 big-endian 8-byte encoding | Unit test: `epoch_key`/`decode_epoch_key`, zero/one/max, sort table, round-trip, parity with `height_key` | `tests/key_003_tests.rs` | Done |
| KEY-004 | Metadata keys MUST be UTF-8 encoded strings | Unit test: `metadata_key` byte tables, variable length, no trailing NUL, distinct well-known keys, `META_*` literals, UTF-8 round-trip | `tests/key_004_tests.rs` | Done |
