@qorechain/pq-light-client
v0.1.0
Published
Reference verifier for QoreChain post-quantum light client checkpoints (ML-DSA-87, FIPS 204). Specification draft; requires chain support (not scheduled).
Downloads
95
Maintainers
Readme
@qorechain/pq-light-client
Reference verifier for QoreChain post-quantum light client checkpoints (ML-DSA-87, FIPS 204), over @qorechain/pqc 0.2.3. Works in Node.js 20.19+ and browsers. Specification: spec/pq-light-client-v1.md (draft).
Requires chain support (not scheduled). QoreChain does not produce these checkpoints; this package verifies the format and the rules against simulated chains.
fetchCheckpointalways rejects withREQUIRES_CHAIN_SUPPORTand makes no request.
import { PqLightClientError, decodeSignedCheckpoint, verifyCheckpoint } from "@qorechain/pq-light-client";
try {
trusted = verifyCheckpoint(trusted, decodeSignedCheckpoint(bytes), BigInt(Math.floor(Date.now() / 1000)));
} catch (e) {
if (e instanceof PqLightClientError && e.code === "CONFLICTING_CHECKPOINT") {
report(e.misbehaviour);
}
}API: Checkpoint, ValidatorSet, SignedCheckpoint, TrustedState, Misbehaviour; encodeCheckpointSignBytes, verifyCheckpoint, detectMisbehaviour, newTrustedState, signCheckpoint (simulators and tests), the encoders and decoders, hashValidatorSet; CheckpointSource, fetchCheckpoint, chainCheckpointSource. 64-bit fields are bigint. Errors are PqLightClientError with a stable code shared with Go and Rust.
pnpm install && pnpm build && pnpm testApache-2.0.
