@wisp_/core
v0.2.1
Published
Core Wisp protocol validation and type helpers
Readme
@wisp_/core
Portable Wisp protocol core — package validation, public-input rebinding, root comparison, typed errors, and shared types. Zero chain dependencies (only @wisp_/js + @wisp_/bindings), so it drops straight into any issuer or compliance integration.
Beta / demo release only. Intended for evaluation and testnet integrations; interfaces may change.
Use this when you need to validate proof packages or compare on-chain roots without pulling in Stellar transports, the prover, or the demo issuer.
Install
npm install @wisp_/[email protected]Quick start
import {
validateProofPackage,
assertProofPackagePublicInputsMatch,
validationPolicies,
rootsMatch,
issuerRootsMatch,
} from "@wisp_/core";
// Structural + public-input validation of an issuer proof package
const result = validateProofPackage(pkg, {
policy: validationPolicies.strict,
});
// Compare expected vs on-chain roots before settling
if (!issuerRootsMatch(expectedRoots, chainRoots)) {
throw new Error("issuer roots drifted");
}API surface
| Export | Purpose |
| ------ | ------- |
| validateProofPackage | Structural + public-input validation against a policy |
| validatePackageStructure | Shape-only checks on a proof package |
| rebuildProofPackagePublicInputs | Recompute the 17 public inputs from a package |
| assertProofPackagePublicInputsMatch | Assert package fields rebind to expected inputs |
| validationPolicies | Preset strict / lenient policies |
| rootsMatch · issuerRootsMatch · corridorRootsMatch | Root drift comparison helpers |
| publicInputsRecordMatch | Compare public-input records |
| IssuerNotRegisteredError, CorridorDisabledForIssuerError, … | Typed protocol errors |
Re-exports the canonical types ProofPackage, Credential, TransferParams, MerklePaths, Roots, WitnessPrivate from @wisp_/bindings.
Build from source
pnpm build:js # from repo root (builds deps first)
pnpm --filter @wisp_/core testRelated
- Crypto primitives:
@wisp_/js - Transports + chain reads:
@wisp_/client - Transfer orchestration:
@wisp_/flows - Public input ABI:
@wisp_/bindings - Umbrella SDK:
@wisp_/sdk(also@wisp_/sdk/core)
