nx_substrate_manifest.nx
buildroot/runtime/nx_substrate_manifest.nx
about
nx_substrate_manifest.nx -- declared expected-blob set + completion
tracking for the spore-up NETWORK phase.
EM-3 partial milestone of NISHI_ECOSYSTEM_EVOLUTION_ROADMAP.md.
The spore germinates with a "Merkle root" -- a set of expected
blob hashes that together comprise the substrate it will assemble.
This primitive captures that expected set + tracks which blobs
have been received + verified, so the germination loop can
terminate when all expected blobs are present.
Transport-agnostic: this primitive doesn't care HOW bytes arrive
(HTTPS / sneakernet / file / serial / Bluetooth). The caller
hands received bytes + the hash they CLAIM the bytes match;
this primitive verifies + stores + tracks.
Composes:
nx_blob_store -- where verified blobs land
nx_sha256 -- hash verification (inside nx_blob_store_put)
V1 scope:
- Fixed-array expected-hash set (up to NX_SM_MAX_EXPECTED)
- Per-hash received_flag: 0 (not yet) / 1 (received + verified)
- Ingest verifies: hash matches expected AND expected is in
manifest set (refuses unknown hashes -- closes the "peer can
push arbitrary content" attack vector)
- Idempotent re-ingest: ALREADY_RECEIVED is OK, not error
- Canary-bracketed
Deferred per roadmap:
- Merkle-tree (not just flat set) for O(log n) inclusion proofs
- Per-blob freshness timestamps (when did we receive it?)
- Per-blob source attribution (which peer served it?)
- Larger expected set (V1 caps at 64 expected blobs)
genealogy_id: git_pack_index_2005 + ipfs_pinning_2015 +
bittorrent_torrent_file_2001 +
cardinal_2026-05-20_ecosystem_evolution
lineage_id: substrate_manifest_v1
nx_capability_manifest:
dependencies 2 imports · 5 importers
imports: nx_syscalls.nxnx_blob_store.nx
imported by: nx_emitted_substrate.nxnx_emitted_substrate_test.nxnx_spore_up_lifecycle_test.nxnx_spore_up_network_test.nxnx_substrate_manifest_test.nx
structs
| 91 | struct NxSubstrateManifest |
consts
| 67 | const NX_SM_MAX_EXPECTED: i64 = 64 |
| 70 | const NX_SM_CANARY_PRE: i64 = 0x4E58534D414E5000 // "NXSMANP\0" |
| 71 | const NX_SM_CANARY_POST: i64 = 0x4E58534D414E454E // "NXSMANEN" |
| 74 | const NX_SM_INGESTED: i64 = 0 // first successful receive |
| 75 | const NX_SM_ALREADY_RECEIVED: i64 = 1 // idempotent re-ingest |
| 76 | const NX_SM_NOT_IN_MANIFEST: i64 = 2 // hash not in expected set |
| 77 | const NX_SM_HASH_MISMATCH: i64 = 3 // bytes don't hash to claimed |
| 78 | const NX_SM_BAD_INPUT: i64 = 4 |
| 79 | const NX_SM_BLOB_STORE_FULL: i64 = 5 |
| 80 | const NX_SM_TAMPER: i64 = 6 |
| 81 | const NX_SM_FULL: i64 = 7 // expected set too large |
| 82 | const NX_SM_N_VERDICTS: i64 = 8 |
functions
| 84 | func nx_sm_verdict_is_valid(v: i64) -> i64 called by 1: main |
| 105 | func nx_substrate_manifest_new(blob_store: *NxBlobStore) -> *NxSubstrateManifest |
| 128 | func nx_substrate_manifest_is_valid(m: *NxSubstrateManifest) -> i64 |
| 143 | func nx_substrate_manifest_add_expected( |
| 178 | func _sm_find_expected_idx(m: *NxSubstrateManifest, hash: *NxBlobHash) -> i64 |
| 204 | func nx_substrate_manifest_ingest( |
| 252 | func nx_substrate_manifest_is_complete(m: *NxSubstrateManifest) -> i64 |
| 260 | func nx_substrate_manifest_n_missing(m: *NxSubstrateManifest) -> i64 |
| 266 | func nx_substrate_manifest_n_rejected_unknown(m: *NxSubstrateManifest) -> i64 |
| 271 | func nx_substrate_manifest_n_rejected_tamper(m: *NxSubstrateManifest) -> i64 |