@kerits/core
v0.3.4
Published
Pure functional core for KERI: CESR encoding, SAID computation, KEL/TEL/ACDC operations, validation, signing primitives, canonical data, and threshold logic. No I/O, no storage, no side effects — runs in any JavaScript runtime (browser, Node.js, Bun, Clou
Downloads
206
Maintainers
Readme
@kerits/core
Pure functional core for KERI: CESR encoding, SAID computation, KEL/TEL/ACDC operations, validation, signing primitives, canonical data, and threshold logic. No I/O, no storage, no side effects — runs in any JavaScript runtime (browser, Node.js, Bun, Cloudflare Workers).
Install
bun add @kerits/coreQuick Start
import {
KELEvents,
generateKeyPair,
encodeKey,
nextKeyDigestQb64FromPublicKeyQb64,
} from '@kerits/core';
// Generate current and next Ed25519 key pairs
const current = generateKeyPair();
const next = generateKeyPair();
// Encode public keys to CESR qb64
const currentKeyQb64 = encodeKey(current.publicKey).qb64;
const nextKeyQb64 = encodeKey(next.publicKey).qb64;
// Compute the next-key digest commitment
const nextKeyDigest = nextKeyDigestQb64FromPublicKeyQb64(nextKeyQb64);
// Build and finalize an inception event
const { unsignedEvent } = KELEvents.buildIcp({
keys: [currentKeyQb64],
nextKeyDigests: [nextKeyDigest],
});
const { event, said } = KELEvents.computeSaid(unsignedEvent, true);
console.log('AID:', said);Features
- CESR encoding/decoding — keys, signatures, digests, and CESR attachment groups
- SAID computation — keripy-compliant insertion-order derivation with
deriveSaid/recomputeSaidand typedDerivationSurfacedescriptors - KEL event building — inception, rotation, interaction, delegation events with version-string convergence
- TEL event types — registry inception/rotation, credential issuance/revocation
- KEL validation — chain validation, SAID verification, threshold checking, key commitment verification
- Ed25519 signing — key generation, signing, verification with CESR encoding
- Branded types —
AID,SAID,PublicKey,Signaturefor compile-time safety
Documentation
Full API documentation and guides: kerits.dev
Try kerits interactively: kerits.id
KERIpy Compliance
SAID computation and CESR encoding are cross-validated against the KERIpy reference implementation using shared neutral fixtures and Python-generated expected values. See the compliance testing guide for details.
Building
# Run tests and build docs (from repo root):
make test-core
# Or from the package directory:
make -C packages/core testLicense
Apache License 2.0 — see LICENSE.
