npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@kshan0515/cggmp-node-binding

v0.1.6

Published

Node.js native binding for CGGMP24 MPC ECDSA protocol - Distributed key generation and threshold signing

Readme

cggmp-node-binding

CI npm

Node.js native binding for CGGMP24 MPC ECDSA protocol - Distributed key generation and threshold signing without exposing private keys.

Based on cggmp21 Rust implementation.

Features

  • Distributed Key Generation (DKG): Generate ECDSA key shares across multiple parties
  • Threshold Signing: Sign messages with a subset of parties (t-of-n)
  • Auxiliary Info Generation: Generate pre-computation data for efficient signing
  • State Machine API: Round-based protocol execution with CggmpExecutor
  • Cross-platform: Pre-built binaries for macOS, Linux, and Windows

Installation

npm install @kshan0515/cggmp-node-binding
# or
pnpm add @kshan0515/cggmp-node-binding
# or
yarn add @kshan0515/cggmp-node-binding

Supported Platforms

| Platform | Architecture | |----------|-------------| | macOS | x64, arm64 (Apple Silicon) | | Linux | x64 (glibc, musl), arm64 (glibc) | | Windows | x64 |

Usage

import { CggmpExecutor, generatePrimes } from '@kshan0515/cggmp-node-binding';

// Create executor for party 0 in a 2-of-3 threshold setup
const executor = new CggmpExecutor(
  'session-id',
  'execution-id',
  0,  // party index
  2,  // threshold
  3   // total parties
);

// Start auxiliary info generation
executor.startAuxGen();

// Process protocol rounds
const outgoing = executor.step([]);
// ... exchange messages with other parties ...

// Check status
const snapshot = JSON.parse(executor.snapshot());
console.log(snapshot.status);

// After aux gen, start keygen
executor.startKeygen();
// ... continue processing rounds ...

// After keygen, export key share
const keyShare = executor.exportKeyshare();

// For signing, import key share and start signing
executor.importKeyshare(keyShare);
executor.setSigners('[0, 1]');  // Select signers
executor.startSigning('0x...');  // Message hash (32 bytes hex)

API

CggmpExecutor

Main class for MPC protocol execution.

Constructor

new CggmpExecutor(
  sessionId: string,
  executionId: string,
  partyIndex: number,
  threshold: number,
  partiesCount: number
)

Methods

| Method | Description | |--------|-------------| | startAuxGen() | Start auxiliary info generation | | startAuxGenWithPrimes(primes: Buffer) | Start aux gen with pre-generated primes | | startKeygen() | Start distributed key generation | | startSigning(txHex: string) | Start signing (32-byte hash as hex) | | step(inputs: Buffer[]): Buffer[] | Process incoming messages and return outgoing | | snapshot(): string | Get current state as JSON | | setSigners(json: string) | Set signer indices for signing | | importKeyshare(data: Buffer) | Import key share | | exportKeyshare(): Buffer | Export key share | | importAuxInfo(data: Buffer) | Import auxiliary info | | exportAuxInfo(): Buffer | Export auxiliary info |

generatePrimes(): Buffer

Pre-generate safe primes for faster auxiliary info generation.

Protocol Flow

  1. Auxiliary Info Generation: Generate Paillier keys and ring-Pedersen parameters
  2. Key Generation: Generate ECDSA key shares using VSS
  3. Signing: Create threshold signatures with selected signers

Building from Source

Requirements:

  • Node.js >= 18
  • Rust (stable)
  • pnpm
# Install dependencies
pnpm install

# Build native binary
pnpm build

# Run tests
pnpm test

Security

This library implements the CGGMP24 protocol which provides:

  • UC-secure key generation
  • Identifiable abort in case of malicious behavior
  • Threshold security (t-of-n)

Warning: This is a cryptographic library. Use with caution in production environments.

License

MIT

References