TypeScript SDK for the Handshake protocol. Thin NAPI-RS wrapper over the
canonical Rust core (packages/handshake-rs). The cryptographic surface
delegates byte-for-byte to Rust, so this SDK cannot drift from the reference
implementation.
pnpm install
pnpm --filter @handshake/handshake run buildbuild runs two steps:
napi buildcompiles the Rustcdylibfromsrc/lib.rsinto a platform- specific.nodeaddon plus aindex.cjsloader andindex.d.tstypes.tsccompiles the TypeScript façade ints/todist/, re-exporting the native primitives and surfacing the Zod schema-native models.
import { canonicalize, sha256Hex, models } from "@handshake/handshake";
canonicalize({ b: 2, a: 1 }); // <Buffer 7b 22 61 22 ...> ('{"a":1,"b":2}')
sha256Hex(Buffer.from("hello")); // '2cf24dba...'
const dt = models.DelegationToken.parse({...});See docs/decisions/0006-rust-core-authoritative.md for why TypeScript ships as
an FFI shim rather than a parallel pure-TypeScript implementation. Conformance
against the Rust+Go cores is enforced by tests/conformance/ — every
primitive exposed here is byte-tested for equality with the other cores.