code wiki / (root) / nx_connect_e2e_client.nx

nx_connect_e2e_client.nx

buildroot/runtime/nx_connect_e2e_client.nx

11847 B86 linesdepth 2pulls 3 transitivereach 1 importersview sourcekind tooltopic connect
docsdependenciesstructsconstsfunctions

about

nx_connect_e2e_client.nx -- the FULL-E2E CONNECT client: key AGREEMENT + sealed send + decrypting inbox, all client-side, all sovereign crypto compiled to WASM. This is the page that escapes the zero-JS security ceiling AND closes the two rungs the 2026-07-23 honest grade left open: (a) the conversation key is no longer typed -- it is AGREED via X25519 (RFC 7748; the shipped wasm is KAT-proven in nx_wasm_vm: nx_x25519_wasm_vm_gate + nx_connect_keyx_vm_gate 5/5 DH agreement); (b) the recipient has a DECRYPT view -- the inbox fetches ciphertext routed by the server's shared content-blind plane and decrypts it in the browser with the same agreed key. The cipher is sovereign ChaCha20 (nx_media_crypt_wasm; RFC 8439 bit-exact in-VM, gate 3/3). The JS is the ACCEPTED minimum last-mile: instantiate wasm + marshal bytes + DOM. ALL crypto is in the wasm. HONEST SCOPE (stated on the page too): the name->pubkey directory is first-come/latest-wins with NO identity binding yet (classic TOFU gap; OPAQUE-bound identities = the next rung), and private keys live in this browser's localStorage (per-name, so one browser can demo both ends). nx_connect_e2e_client <chacha.wasm> <x25519.wasm> <out.html> ce_emit_html(b64c, b64clen, b64x, b64xlen, dst) is the pure emitter (gate-testable without real wasm). license_tier: ORIGINAL

dependencies 2 imports · 1 importers

nx_syscalls.nx nx_base64.nx nx_connect_e2e_client.nx nx_connect_e2e_client_gate.nx

imports: nx_syscalls.nxnx_base64.nx

imported by: nx_connect_e2e_client_gate.nx

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

main sys_write sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close b64_encode b64_enc_char ce_emit_html ce_puts ce_putb sys_openat_wr sys_close ↻

structs

none

consts

19const K_MAGIC_524288: i64 = 524288

functions

21func ce_puts(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var i: i64=0; while s[i]!=(0 as u8){dst[o]=s[i]; o=o+1; i=i+1} return o }
called by 1: ce_emit_html
22func ce_putb(dst: *u8, off: i64, b: *u8, n: i64) -> i64 { var i: i64=0; while i<n { dst[off+i]=b[i]; i=i+1 } return off+n }
called by 1: ce_emit_html
25func ce_emit_html(b64c: *u8, b64clen: i64, b64x: *u8, b64xlen: i64, dst: *u8) -> i64
called by 2: mainmain calls 2: ce_putsce_putb
63func main(argc: i64, argv: *i64) -> i64