🚀. Socket Launch Week Day 2:Introducing Manifest Alerts.Learn more
Sign In

@orangecheck/lock-core

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@orangecheck/lock-core

OC Lock envelope format, canonicalization, seal, and unseal. See https://github.com/orangecheck/oc-lock-protocol.

latest
Source
npmnpm
Version
1.0.1
Version published
Weekly downloads
248
67.57%
Maintainers
1
Weekly downloads
 
Created
Source

@orangecheck/lock-core

Envelope format, canonicalization, seal, and unseal for OC Lock.

Install

npm i @orangecheck/lock-core

Usage

import { seal, unseal } from '@orangecheck/lock-core';

const env = await seal({
    payload: new TextEncoder().encode('hello'),
    sender: { address: 'bc1qalice…', signMessage: async (m) => walletSignBIP322(m) },
    recipients: [
        { address: 'bc1qbob…', device_id: '…', device_pk: '…' /* from device registry */ },
    ],
});

// Share env as JSON. Recipient later:

const result = await unseal({
    envelope: env,
    device: { device_id: '…', secretKey: localDeviceSecret },
    verifyBip322: async (msg, sig, addr) => { /* your verifier */ },
});
const plaintext = new TextDecoder().decode(result.payload);

Exports

  • seal(input)LockEnvelope
  • unseal(input){ payload, envelopeId, sender, matchedDeviceId }
  • canonicalize(value) / canonicalBytes(value) — RFC 8785 JSON canonicalization with OC Lock's recipients[] sort rule
  • LockError — typed error class with protocol-defined code
  • Full type definitions: LockEnvelope, EnvelopeRecipient, DeviceRecord, etc.

See SPEC.md for the normative spec.

Keywords

bitcoin

FAQs

Package last updated on 07 May 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts