nx_ledger_trust_equiv_gate.nx
buildroot/runtime/nx_ledger_trust_equiv_gate.nx
about
nx_ledger_trust_equiv_gate.nx -- F997 STEP 1: BEHAVIOUR-EQUIVALENCE PROOF, nx_ledger vs nx_trust.
F997 wants nx_trust (IOLTA, RPC 1.15, LIVE and gate-proven 7/7) re-based onto the new nx_ledger
primitive. Rewriting a working compliance organ on faith is exactly how you break a bar-audit
surface. So this gate does the SAFE half first: it drives the SAME scenario through BOTH
implementations and asserts they agree, value for value. nx_trust is NOT modified.
If every assertion holds, the re-base is proven safe and F997's real edit becomes mechanical.
If any fails, we have found a genuine semantic gap in the primitive BEFORE trusting money to it.
(This is the D001 organ-dedup behaviour-equivalence discipline applied to money.)
MAPPING (trust semantics -> double-entry):
deposit $X for client C == transfer bank -> client:C (credits C)
disburse $X for client C == transfer client:C -> operating (debits C)
client balance == led_balance(client) = credits - debits (same custodial sense)
RPC 1.15 no-overdraw == led_can_fund(client, X)
three-way reconciliation == sum(per-client balances) == trust account total
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_trust_lib.nxnx_ledger_lib.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
| 23 | func eq_puts(s: *u8) -> i64 |
| 29 | func eq_putn(v: i64) -> i64 |
| 44 | func eq_ck(cnt: *i64, name: *u8, trust_v: i64, ledger_v: i64, want: i64) -> i64 |
| 60 | func eq_id(tag: *u8, nonce: i64, out: *u8) -> i64 |
| 67 | func main(argc: i64, argv: *i64) -> i64 |