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

@nerochain/mpc-sdk

v2.1.7

Published

NERO MPC SDK - Browser-based threshold signature client for self-custodial wallets

Readme

@nerochain/mpc-sdk

Browser-based threshold signature client for self-custodial wallets. Uses 2-party DKLS threshold ECDSA with secp256k1 to generate and manage Ethereum wallets from social logins — the full private key is never reconstructed during normal operations.

Installation

npm install @nerochain/mpc-sdk

Quick Start

import { NeroMpcSDK } from "@nerochain/mpc-sdk";

const sdk = new NeroMpcSDK({
  backendUrl: "https://your-api.example.com",
  chainId: 689, // NERO Testnet
  // protocol defaults to "dkls"; use "pedersen" for legacy Pedersen DKG
});

await sdk.initialize();

// 1. Authenticate via OAuth
const { url } = await sdk.getOAuthUrl("google", window.location.href);
window.location.href = url;

// 2. Handle the callback (after redirect)
const { user, requiresDKG } = await sdk.handleOAuthCallback(provider, code, state);

// 3. Generate wallet if first login
if (requiresDKG) {
  const wallet = await sdk.generateWallet();
}

// 4. Sign messages
const signature = await sdk.signMessage("Hello NERO");

Self-Custody Recovery

Users can set up offline recovery to reconstruct their full private key without NERO infrastructure. Both MPC shares (sk_A client + sk_B backend) are stored in a single composite blob, encrypted under a user-chosen password via scrypt KDF + AES-256-GCM + ECDH. The full key is never assembled during setup.

Setup

const sdk = new NeroMpcSDK(config);
await sdk.initialize();
// ... login and generate wallet ...

const { factorId } = await sdk.setupSelfCustodyRecovery("user-password-here");

Offline Recovery (No Network Required)

import { NeroMpcSDK } from "@nerochain/mpc-sdk";

const { privateKey, walletAddress } = await NeroMpcSDK.offlineRecoverKey(
  compositeJson,        // the stored composite blob
  "user-password-here", // same password used during setup
  "0x1234...",          // optional: verify address matches
);

// Import privateKey into MetaMask, Rabby, or any Ethereum wallet

See docs/self-custody-recovery.md for the full protocol specification and security analysis.

React Integration

import { NeroMpcAuthProvider, useNeroConnect, useNeroUser } from "@nerochain/mpc-sdk/react";

function App() {
  return (
    <NeroMpcAuthProvider config={{ backendUrl: "https://your-api.example.com" }}>
      <Wallet />
    </NeroMpcAuthProvider>
  );
}

function Wallet() {
  const { connect, isLoading } = useNeroConnect();
  const { user } = useNeroUser();

  return user ? (
    <p>Connected: {user.walletAddress}</p>
  ) : (
    <button onClick={() => connect("google")} disabled={isLoading}>
      Login with Google
    </button>
  );
}

Recovery Hook

import { useNeroRecovery } from "@nerochain/mpc-sdk/react";

function RecoveryPanel() {
  const { setupSelfCustody, offlineRecover, isLoading, error } = useNeroRecovery();

  const handleSetup = async () => {
    const { factorId } = await setupSelfCustody("my-password");
  };

  const handleRecover = async () => {
    const { privateKey, walletAddress } = await offlineRecover(
      compositeJson,
      "my-password",
    );
  };
}

Package Exports

| Export | Import Path | Description | |--------|------------|-------------| | Core SDK | @nerochain/mpc-sdk | Main SDK class, wallet operations, transport | | React | @nerochain/mpc-sdk/react | Provider, hooks, theme context | | Modal | @nerochain/mpc-sdk/modal | Pre-built login modal UI | | No Modal | @nerochain/mpc-sdk/no-modal | Headless SDK for custom UI | | Chains | @nerochain/mpc-sdk/chains | Chain configurations and manager | | Account Abstraction | @nerochain/mpc-sdk/aa | ERC-4337 smart account support |

Features

  • Social Login — Google, GitHub, Apple, and more via OAuth
  • DKLS Protocol (Default) — 2-party threshold ECDSA with multiplicative sharing; the private key is never reconstructed on the server during signing
  • Self-Custody Recovery — Offline key reconstruction from a password-protected composite blob containing both MPC shares
  • Pedersen DKG — Legacy protocol, available via protocol: "pedersen"
  • ERC-4337 — Smart account support with bundler and paymaster
  • Multi-Chain — NERO Chain, Ethereum, Polygon, Arbitrum, Base
  • React HooksuseNeroConnect, useNeroUser, useNeroWallet, useNeroRecovery, and more
  • External Wallets — WalletConnect, MetaMask SDK, Coinbase Wallet
  • Theming — Full whitelabel support with light/dark modes

Peer Dependencies

Required:

  • @noble/curves ^1.4.0
  • @noble/hashes ^1.4.0

Optional (install based on features you use):

  • react ^18.0.0 || ^19.0.0 (for React hooks)
  • @walletconnect/ethereum-provider ^2.0.0 (for WalletConnect)
  • @metamask/sdk ^0.20.0 (for MetaMask)
  • @coinbase/wallet-sdk ^4.0.0 (for Coinbase Wallet)

License

MIT