Lighthouse 01LMPRK
Lens workshop, brass gears and a half-ground Fresnel lens
Hooking 02 . Lens workshop@lmprk/sdk . one import. one verify.
Hooking 02a . TypeScript SDK

@lmprk/sdk

A dependency-light verifier for the LMPRK light client. Bring a StateProof and verifyProof re-derives the merkle root and checks it against the signed slot snapshot -- locally, with no RPC trusted. The same code runs in Node, Deno, Bun, and the browser.

Install
npm install @lmprk/sdk
Version
pending publish
Service status
polling…
Verify locally . trust nothing
import { verifyProof, type StateProof } from "@lmprk/sdk";

// A StateProof carries a signed slot snapshot + the merkle
// path for one account. You bring it from any transport.
const proof: StateProof = {
  protocol: "lmprk/v1",
  version: 1,
  snapshot: {
    head: { slot, blockhash, parentSlot, signerCount },
    stateRoot,
    validatorSetSize,
    threshold,
  },
  address,
  accountData,        // hex-encoded account bytes
  path: { steps: [] }, // merkle siblings, leaf -> root
};

const { valid, reason, computedRoot } = verifyProof(proof);
if (!valid) {
  throw new Error("LMPRK: proof rejected -- " + reason);
}
Or one call over REST
const res = await fetch(
  "https://api.lmprk.fun/verify/balance",
  {
    method: "POST",
    headers: { "Content-Type": "application/json" },
    body: JSON.stringify({ address }),
  }
);

const { verified, balance_lamports, slot, proof } =
  await res.json();

if (!verified) throw new Error("LMPRK: proof rejected");

The service emits the packed proof and self-verifies its aggregator signature server-side. The SDK is the portable verifier you embed when you want to re-check a StateProof yourself.

Exports
Verification
  • verifyProof(proof: StateProof): VerifyResult
  • hashLeaf(bytes) . hashNode(left, right)
Merkle
  • computeRoot(path, leaf) . foldStep(acc, step)
  • pathDepth(path) . emptyPath() . proofByteSize(proof)
Encoding
  • hexToBytes(hex) . bytesToHex(bytes)
Types & constants
  • StateProof . SlotSnapshot . SlotInfo . VerifyResult
  • MerklePath . MerkleStep . HexString . Base58
  • PROTOCOL_NAME = "lmprk/v1" . PROTOCOL_VERSION = 1

Full request/response reference at /docs.

Feature
No RPC trust

verifyProof rejects unless the snapshot has enough signers and the recomputed root matches. Helius and QuickNode are accelerators behind the service, never authorities.

Feature
Tiny on the wire

A proof is a slot snapshot plus a short merkle path. Cheap to push to mobile, browser extensions, or embedded clients.

Feature
Drop-in everywhere

Pure TypeScript with a portable hash fallback -- the same verifier runs in Node, Deno, Bun, and the browser. No extra service call to verify.