# coinbase/cb-mpc

> cb-mpc is a native cryptographic library for MPC protocols, intended for application developers who want to secure cryptoasset keys in a decentralized way. It provides building blocks to generate and refresh keyshares, derive supported keys, produce MPC signatures, and support key backup through publicly verifiable encryption (PVE). The protocols are exposed through public APIs and the library is written in C++.

Source: https://github.com/coinbase/cb-mpc
Indexed: commit 3a2f7c2 on 2026-07-17 by Repowise. Facts come from the source and git history, not from the maintainer.

## Facts

- Type: App
- Language: C++
- Stars: 511 at index time
- License: MIT
- Code health: 7.9/10, Good
- Last commit: 2026-07-12

## Install

From the README: https://github.com/coinbase/cb-mpc#install-public-api-vs-full-api

Clone the cb-mpc repository.
    git clone https://github.com/coinbase/cb-mpc.git

Move into the cb-mpc folder.
    cd cb-mpc

Clone the repository and initialize its submodules.
    git submodule update --init --recursive

Install the full API, which includes internal and low-level functionality. By default only the public API is installed.
    scripts/install.sh --mode full

Install the public API into a custom prefix.
    scripts/install.sh --mode public --prefix /path/to/prefix

## How it works

Application code calls the public API, whose headers live under include, while the C++ implementation lives under src/cbmpc. The core of the cryptographic primitives, including big-number and modular arithmetic and elliptic curve adapters, is in src/cbmpc, with files such as src/cbmpc/crypto/base.cpp. src/cbmpc/protocol/mpc_job.cpp orchestrates protocol jobs, and src/cbmpc/protocol/ec_dkg.cpp implements the threshold EC-DKG used for ECDSA-MPC. The full API adds lower-level functionality whose internal headers are under include-internal/cbmpc/internal, and in that case the integrating application takes on more validation responsibility. Runnable examples are in demo-api, such as demo-api/pve/main.cpp, and demo-cpp/basic_primitive/main.cpp, while tests under tests exercise the protocols.

- demo-api/ecdsa_mp_pve_backup/main.cpp: entry point
- demo-api/hd_keyset_ecdsa_2p/main.cpp: entry point
- demo-api/pve/main.cpp: entry point
- demo-api/schnorr_2p_pve_batch_backup/main.cpp: entry point
- demo-cpp/basic_primitive/main.cpp: entry point
Modules: tests, src, include-internal, include, tools, root, demo-cpp, scripts. 351 files, 62,451 lines, 5,535 symbols.

## Code health

- Score: 7.9/10 (Good)
- Rank: #84 of 265 ranked repos
- Hotspots: tests/unit/crypto/test_base_ecc.cpp, tests/unit/core/test_convert.cpp, src/cbmpc/protocol/ec_dkg.cpp, src/cbmpc/crypto/base_ecc.cpp
- Lowest file: src/cbmpc/protocol/ec_dkg.cpp
- Dead code: 496 findings

## Maintenance

- Last commit 2026-07-12
- bus factor 1

## Security

- Security findings are shown to signed-in users at https://repowise.dev/repo/coinbase/cb-mpc/security

## More

- Page: https://repowise.dev/repo/coinbase/cb-mpc
- Ask this codebase: https://repowise.dev/repo/coinbase/cb-mpc/chat
- Docs: https://repowise.dev/repo/coinbase/cb-mpc/docs
- MCP (signs in with Repowise on first use):
    claude mcp add --transport http repowise https://api.repowise.dev/mcp/coinbase/cb-mpc
