code wiki / (root) / nx_asset_provenance_gate.nx

nx_asset_provenance_gate.nx

buildroot/runtime/nx_asset_provenance_gate.nx

14434 B239 linesdepth 10pulls 17 transitivereach 0 importersview sourcekind gate/prooftopic asset
docsdependenciesstructsconstsfunctions

about

nx_asset_provenance_gate.nx -- KAT + TEETH for nx_asset_provenance (R2 of the universal org-tooling arc). Proves CRYPTOGRAPHICALLY SIGNED, tamper-evident provenance: we can TRULY KNOW an artifact's class (generated image / downloaded video / human-authored) because the credential is ed25519-SIGNED and BOUND (via the W3C-PROV `entity` = the asset's record CID) to that exact content. DENY-BY-DEFAULT. ANCHOR RFC 8032 ยง7.1 TEST 1 KAT the SAME ed25519 we sign with derives the published public key byte-for-byte -> the crypto base is GENUINE (RFC 8032), not a stub and not rolled here (reused from nx_ed25519_signature). (a) VALID a credential signed by key K verifies against pubkey K for its record CID -> ALLOW (b) TAMPER flip one byte of the assertion inside the credential -> REJECT (c) FORGE sign with key K2, verify against trusted pubkey K1 (what a plain hash can't catch) -> REJECT (d) REBIND a credential minted for record A, verified with expect_record_cid = B (binding) -> REJECT (e) 3 CLASSES human / machine(tool+model) / downloaded(source URL) each sign+verify ALLOW and carry their payload in the assertion. Verdict logged to knowledge/status/asset_provenance_gate.log (append-only; ADDITIVE law #13). expect_exit: 0 license_tier: ORIGINAL

dependencies 6 imports · 0 importers

nx_syscalls.nx nx_canon_cid.nx nx_uxf_decode.nx nx_ed25519_signature.nx nx_asset_provenance.nx nx_gate_verdict.nx nx_asset_provenance_gate.nx

imports: nx_syscalls.nxnx_canon_cid.nxnx_uxf_decode.nxnx_ed25519_signature.nxnx_asset_provenance.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_openat_append g_puts sys_write sys_mmap g_hex2bytes g_hb ed25519_pub_from_priv sys_mmap ↻ ed25519_sha512 sys_mmap ↻ sha512_init sha512_update sha512_blk_set_byte blk_get_i64 blk_set_i64 sha512_compress sys_mmap ↻ blk_get_i64 ↻ sha512_gamma0 rotr64_v shr64_v sha512_gamma1 rotr64_v ↻ shr64_v ↻ sha512_sigma1 rotr64_v ↻ sha512_ch sha512_k sha512_sigma0 rotr64_v ↻ sha512_maj sha512_final sha512_blk_set_byte ↻ sha512_compress ↻ ge_p3_alloc sys_mmap ↻ fe_alloc nx_scratch nx_scratch_init

structs

none

consts

none

functions

30func g_puts(logfd: i64, s: *u8) -> i64
called by 2: g_putnmain calls 1: sys_write
37func g_putn(logfd: i64, v: i64) -> i64
called by 1: main calls 3: sys_mmapg_putssys_write
51func g_streq(a: *u8, b: *u8) -> i64
called by 1: main
62func g_hb(c: i64) -> i64
called by 1: g_hex2bytes
68func g_hex2bytes(hex: *u8, nbytes: i64, out: *u8) -> i64
called by 1: main calls 1: g_hb
73func g_byteeq(a: *u8, b: *u8, n: i64) -> i64
called by 1: main
79func E() -> *u8 { return "\x00" as *u8 }
called by 1: main
81func main() -> i64