@pwngh/economy-lab
    Preparing search index...

    Function proveEconomy

    • The thorough prover, reads only: it recomputes the entire hash chain to catch any altered entry, unlike the lighter economy.read.health. An independent audit, not the enforcer — the DB enforces these invariants (see db/*-schema.sql); this re-derives them from the legs to catch a bug in the enforcement itself.

      Parameters

      Returns Promise<ProveReport>

      The proof for how the prover re-derives every invariant.

      const report = await proveEconomy({
      store: ports.store, rates: ports.rates, digest: ports.digest, signer: ports.signer,
      });
      if (!allInvariantsHold(report)) {
      throw new Error('ledger integrity check failed'); // report says which property broke
      }