Tidemark

npm package

tidemark-wasm is the review engine compiled to WebAssembly, for wallets, explorers and dashboards. Nothing is uploaded anywhere.

Install

shell
npm install tidemark-wasm

Published on npm as tidemark-wasm. In Node, load the engine with initSync and the bundled dist/tidemark_bg.wasm; in the browser, await init() fetches it next to the module.

Review an upgrade

js
import init, { review } from "tidemark-wasm";

await init();
const { report, verdict_hash } = JSON.parse(review(oldBytes, newBytes));
console.log(report.risk, report.findings.map((f) => f.id));

The report and verdict hash are byte-for-byte what tidemark diff --json produces, so a browser review can be checked against an on-chain attestation.

Verify the ledger

js
import { fetchLedger } from "tidemark-wasm/ledger.js";

const v = await fetchLedger(rpcUrl, ledgerProgramId, registryAddress);
if (!v.ok) throw new Error(v.error);
for (const e of v.entries) console.log(e.index, e.risk, e.final, e.deployed_slot);

fetchLedger reads the raw accounts at finalized commitment and checks the hash chain, every PDA, the reviewer allowlist, approvals and quorum itself. It reads both ledger layouts.

API

FunctionReturns (JSON string)
review(old, new){ report, report_hash, verdict_hash, verdict_risk }
inspect(bytes)sha256, size, SBPF version, syscalls, instruction handlers
verifyLedger(input)chain status for raw ledger accounts
rulesVersion()the rules version, e.g. tm-rules-0.7

In Node, load the module with initSync({ module: readFileSync(".../tidemark_bg.wasm") }).