code wiki / _hdl_build / nx_pub_reader_receipt.nx
nx_pub_reader_receipt.nx
buildroot/runtime/_hdl_build/nx_pub_reader_receipt.nx
about
nx_pub_reader_receipt.nx -- get a SIGNED, VERIFIABLE DEPLOYMENT RECEIPT from the Nishi Publisher for the
reader/shelf artifacts (operator 2026-06-21: "pass to the nishi publisher and get a receipt it deployed").
USES the publisher's existing S-class receipt system (nx_pub_receipt: Ed25519-signed, non-repudiable, DSN
status, return-and-report) -- does NOT rebuild it. For each artifact the publisher already promoted to the
reader liveroot, this: (1) re-hashes the LIVE bytes (sha256), (2) cross-checks that sha against the publisher's
verify-then-promote LEDGER record, (3) rcpt_emit's a SIGNED "PUBLISHED" receipt keyed by content-sha+dest,
(4) rcpt_query's it back (the return loop), (5) rcpt_verify_line checks the Ed25519 signature (non-repudiation).
Durable signed receipts -> knowledge/publish/reader-receipts.tsv. expect_exit: 0 license_tier: ORIGINAL
LEAN imports (operator: "keep going" -- the 926KB organ hit an nx_cc big-organ compile-fail; this needs only
sha256 + a ledger read, NOT the whole publisher pipeline, so drop nx_publisher = much smaller asm, compiles):
dependencies 4 imports · 0 importers
imports: nx_sha256.nxnx_pub_receipt.nxnx_ed25519_signature.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 16 | func r_w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 17 | func r_n(v: i64) -> i64 { var m: i64=v; if m<0{r_w("-" as *u8);m=0-m} let t:*u8=sys_mmap(24); var k:i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i:i64=0; let o:*u8=sys_mmap(24); while i<k{o[i]=t[k-1-i];i=i+1} sys_write(1,o,k); return 0 } |
| 18 | func r_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 19 | func r_hexeq(a: *u8, b: *u8) -> i64 { var i: i64=0; while 1==1 { if a[i]!=b[i] {return 0} if a[i]==(0 as u8) {return 1} i=i+1 } return 1 } called by 1: receipt_for |
| 22 | func sha_hex(path: *u8, outhex: *u8) -> i64 |
| 32 | func ledger_sha(ledpath: *u8, dest: *u8, outsha: *u8) -> i64 |
| 57 | func receipt_for(rcptfile: *u8, priv: *u8, pub: *u8, ledger: *u8, dest: *u8, livepath: *u8, now: i64) -> i64 |
| 75 | func main() -> i64 |