@electron-ota/core
v0.1.0
Published
Pure protocol logic for electron-ota: manifests, signing, compatibility, update state machine, rollout bucketing
Maintainers
Readme
@electron-ota/core
Pure protocol logic for electron-ota: manifests, signing, compatibility, the update state machine, and rollout bucketing. No Electron, no I/O, no clock — just deterministic functions and Zod schemas that every other package builds on.
Install
npm install @electron-ota/coreWhat's inside
- Canonicalization — JCS (RFC 8785) canonical JSON so a manifest hashes and
signs identically everywhere (
canonicalize,canonicalBytes). - Crypto — Ed25519 keypair generation, key-id derivation, sign/verify, and
streaming SHA-256 (
generateSigningKeyPair,signBytes,verifyBytes,sha256Hex,Sha256Stream). - Schemas — the wire protocol: update manifests, signature envelopes, check
responses, runtime compatibility, and the
PROTOCOL_VERSIONconstant. - State machine & bucketing — the client-side update lifecycle and deterministic rollout bucketing.
import {
generateSigningKeyPair,
signBytes,
canonicalBytes,
updateManifestSchema,
} from '@electron-ota/core';
const { privateKey } = generateSigningKeyPair();
const manifest = updateManifestSchema.parse(rawManifest);
const signature = signBytes(canonicalBytes(manifest), privateKey);License
MIT
