npm.io
0.8.0 • Published yesterday

@cardanowall/crypto-core

Licence
Apache-2.0
Version
0.8.0
Deps
7
Size
2.5 MB
Vulns
0
Weekly
0

Label 309 TypeScript SDKs

TypeScript reference implementation of Label 309 — an open standard for Proof of Existence (PoE) anchored on the Cardano blockchain. Hash content, publish the digest on-chain under metadata label 309, and let anyone prove "this content existed on or before block time T" without trusting any server, domain, or issuer identity.

This repository is a small pnpm workspace of three packages that build on one another:

Package What it is
@cardanowall/crypto-core Closed-catalogue cryptographic primitives: hash, KDF, signature, KEM, AEAD, CBOR, COSE, sealed-PoE, Merkle, diceware.
@cardanowall/poe-standard The Label 309 record schema, canonical-CBOR encoder, structural validator, and error-code catalogue — the wire-format library.
@cardanowall/sdk-ts The high-level SDK: a standalone verifier (three roles), a gateway-agnostic HTTP client, off-host signing, and seed-derived identity helpers. Runs in the browser, Node.js, Deno, and Bun.

sdk-ts depends on poe-standard, which depends on crypto-core; the three ship together so the closure resolves as one published unit.

Install

npm install @cardanowall/sdk-ts

@cardanowall/poe-standard and @cardanowall/crypto-core are pulled in automatically as dependencies; install them directly only if you want the lower-level surface on its own.

Quickstart

Verify any Label 309 transaction from chain metadata alone — no issuer server in the trust path:

import { verifyTx } from '@cardanowall/sdk-ts/verifier';

const report = await verifyTx({
  txHash: '<64-hex Cardano transaction hash>',
  // Supply a gateway/provider for chain metadata; the verifier itself trusts
  // no vendor — it routes through a public explorer you choose.
});

console.log(report.verdict); // 'valid' | 'invalid' | ...

See packages/sdk-ts/README.md for the full surface: publishing against any gateway, off-host signing, recipient decryption, and seed-derived identities.

Develop

pnpm install
pnpm -r build        # build all three packages (tsup)
pnpm exec vitest run # full test suite (unit + KAT + integration + nxdomain)
pnpm -r typecheck

The test suite includes the cross-implementation conformance vectors and a synthetic mainnet corpus; these same vectors are replayed by the Python and Rust SDKs, which is what keeps all three byte-identical.

The standard and sibling implementations

  • label-309 — the standard: prose spec, CDDL grammar, JSON schemas, registries, and the canonical conformance vectors.
  • label-309-py — the Python SDK (byte-parity twin).
  • label-309-rs — the Rust SDK (byte-parity twin).
  • label-309-cli — the cardanowall command-line tool.

License

Apache-2.0.