@pomade/core
v0.0.12
Published
Recovery protocol and implementation for nostr multisig signers.
Readme
@pomade/core
Core library for the Pomade protocol - recovery protocol and implementation for nostr multisig signers.
For protocol specification, see PROTOCOL.md
Installation
npm install @pomade/coreWhat's Included
- Client - Application-side interface for registering sessions, signing, and recovery
- Signer - Service for managing multisig sessions and creating partial signatures
- Storage interfaces -
IStorageandIStorageFactorywith in-memory implementation - Type definitions - Complete TypeScript types and Zod schemas for all protocol messages
Usage
import {Client, Signer, inMemoryStorageFactory} from "@pomade/core"
// Register a new client session
const client = await Client.register(
2, // threshold
3, // n (number of signers)
userSecret, // user's secret key
true, // recovery enabled
)
// For running a signer service
const signer = new Signer({
secret: signerSecretKey,
relays: ["wss://relay.example.com"],
storage: storageFactory,
})For a batteries-included signer, see @pomade/signer.
Performance
Password hashing uses argon2id, which runs on the main thread by default and may cause brief UI jank (~100-200ms). To avoid this, enable Web Workers:
import {context} from "@pomade/core"
context.setArgonWorker(import("@pomade/core/argon-worker.js?worker"))This uses your bundler's worker import syntax. No CSP changes required.
License
MIT
