code wiki / _hdl_build / nx_connect_idage.nx
nx_connect_idage.nx
buildroot/runtime/_hdl_build/nx_connect_idage.nx
about
nx_connect_idage.nx -- R3 of CONNECT: the SAFETY SPINE -- privacy-preserving age assurance +
re-registration-resistant identity. This closes the gap that R1/R2's minor<->romance walls
currently TRUST self-declared age. The honest exceed axes: PRIVACY-PRESERVING (vs Tinder/Bumble
ID-hoarding) and RE-REG-RESISTANT (vs Tandem's defeated photo-verify, banned users re-register).
PROTOCOL (what this rung proves, by construction):
1. A trusted issuer attests only an AGE BAND (adult/minor) -- never sends us DOB/name/ID.
2. We VERIFY the attestation, then derive a SERVICE-SCOPED pseudonym from the issuer's subject
ref + our secret service salt, and STORE ONLY {age_band, scoped_pseudonym}. Raw PII never
reaches us; the issuer's subject ref is never stored (only the one-way scoped pseudonym).
3. UNLINKABILITY: the same person at a DIFFERENT service gets a DIFFERENT, uncorrelatable
pseudonym (service-scoping). STABILITY within our service enables re-reg resistance.
4. RE-REG RESISTANCE: bans are keyed by the scoped pseudonym (bound to verified identity), so a
banned user cannot evade by changing email/device -- only by defrauding the issuer.
HONESTY (no overclaim): the issuer attestation is checked here with a SYMMETRIC keyed-hash MAC as
a STAND-IN for the production ASYMMETRIC issuer signature (ecosystem ed25519 verify w/ issuer
public key), and pseudonyms use a modular multiplicative hash as a STAND-IN for a CRYPTOGRAPHIC
hash (ecosystem SHA-256/BLAKE) for true preimage/collision resistance. Both are NAMED FOLLOW-ONS.
This rung proves the PRIVACY ARCHITECTURE (minimization, service-scoped unlinkability, identity-
bound banning) -- NOT cryptographic strength -> census cells flip to PRESENT, never PARITY/EXCEEDS.
8 checks incl. 3 negative controls. 100% sovereign. license_tier: ORIGINAL expect_exit: 0
dependencies 1 imports · 0 importers
imports: nx_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
| 24 | const ADULT_MAGIC_1000000: i64 = 1000000 |
| 25 | const ADULT_MAGIC_1990: i64 = 1990 |
| 26 | const ADULT_MAGIC_2010: i64 = 2010 |
| 27 | const ADULT_MAGIC_31337: i64 = 31337 |
| 28 | const ADULT_MAGIC_55555: i64 = 55555 |
| 29 | const ADULT_MAGIC_99999: i64 = 99999 |
| 30 | const ADULT_MAGIC_700001: i64 = 700001 |
| 31 | const ADULT_MAGIC_700002: i64 = 700002 |
| 33 | const HP: i64 = 1000000007 // hash modulus (prime). production: 256-bit cryptographic hash. |
| 34 | const HA: i64 = 2654435761 |
| 35 | const HB: i64 = 2246822519 |
| 36 | const HC: i64 = 540041351 |
| 37 | const HD: i64 = 700000001 |
| 38 | const ADULT_AGE: i64 = 18 |
| 39 | const NOW_YEAR: i64 = 2026 |
| 40 | const BAND_ADULT: i64 = 1 |
| 41 | const BAND_MINOR: i64 = 0 |
functions
| 43 | func sw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 44 | func sn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} let t: *u8=sys_mmap(28); 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; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(1,bb,k); return 0 } |
| 46 | func modp(h: i64) -> i64 { return h - (h/HP)*HP } // h positive throughout called by 1: hmix |
| 49 | func hmix(x: i64) -> i64 |
| 58 | func pseudo(subject: i64, salt: i64) -> i64 |
| 64 | func naive_id(subject: i64, salt: i64) -> i64 { return subject } called by 1: main |
| 67 | func attest_mac(subject: i64, band: i64, secret: i64) -> i64 { return hmix(subject + band*ADULT_MAGIC_1000000 + secret) } |
| 68 | func verify_attest(subject: i64, band: i64, secret: i64, presented: i64) -> i64 |
| 74 | func band_from_year(birth_year: i64, now_year: i64, adult_age: i64) -> i64 called by 1: main |
| 79 | func is_member(p: i64, set: *i64, n: i64) -> i64 called by 1: main |
| 85 | func tcheck(pass: i64, label: *u8, fails: *i64) -> i64 |
| 91 | func main() -> i64 |