@atcn/schema
v1.5.1
Published
Data formats and signing for ATCN: canonical JSON (RFC 8785), Ed25519 signatures, JSON Schemas and test vectors
Downloads
793
Readme
@atcn/schema
The data formats and signing used throughout ATCN: wire schemas, canonical JSON (RFC 8785, so the same data always gives the same bytes), Ed25519 signatures and webhook signatures. It also ships JSON Schemas (schemas/) and test vectors (test-vectors/) for implementing ATCN in another language.
Most people get these through @atcn/sdk; use this package when you only need the formats and signing.
npm install @atcn/schemaimport { canonicalize, generateKeyPair, signPayload, verifyPayload } from "@atcn/schema";
canonicalize({ b: 1, a: 2 }); // '{"a":2,"b":1}'
const { privateKey, publicKey } = generateKeyPair();
const signed = signPayload({ hello: "world" }, { keyId: "key_1", keyVersion: 1, privateKey });
verifyPayload(signed, publicKey); // trueVersioning and compatibility rules: COMPATIBILITY.md. Part of ATCN. Apache-2.0.
