Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
LABS
Guides

Setting Up Multi-Party Computation (MPC) Wallets

A technical guide for developers implementing threshold signature scheme wallets. This covers client SDK integration, server-side key generation, and coordination protocols for transaction signing.
Chainscore © 2026
introduction
A SECURITY PRIMER

Setting Up Multi-Party Computation (MPC) Wallets

Multi-Party Computation (MPC) wallets eliminate single points of failure by distributing key generation and signing across multiple parties. This guide explains the core concepts and provides a practical setup example.

A Multi-Party Computation (MPC) wallet is a cryptographic system where a private key is never stored in one place. Instead, it is split into multiple secret shares, distributed among different parties or devices. To authorize a transaction, a predefined threshold of these shares (e.g., 2 out of 3) must collaborate to produce a valid signature. This fundamentally differs from traditional wallets, where a single private key or seed phrase is a catastrophic single point of failure. MPC protocols like GG18, GG20, and Lindell17 enable this secure, distributed signing process.

The primary security advantage of MPC is key sharding. Unlike multi-signature (multisig) wallets, which require multiple full signatures on-chain, MPC generates a single signature from combined shares off-chain. This reduces on-chain gas costs and complexity. Common threshold schemes include 2-of-3 for a balance of security and accessibility, or 3-of-5 for higher-security institutional setups. The shares are typically held by independent devices, cloud servers operated by different providers, or trusted individuals, ensuring no single entity can compromise the wallet.

To set up an MPC wallet practically, you can use libraries like ZenGo's tkey MPC or Fireblocks' MPC SDK. Below is a conceptual Node.js example using a simplified flow to generate shares and sign a message, illustrating the distributed process.

javascript
// Conceptual example using a hypothetical MPC library
const { MPCClient } = require('mpc-sdk');

// Step 1: Initialize participants (devices/parties)
const party1 = new MPCClient({ partyId: 1 });
const party2 = new MPCClient({ partyId: 2 });
const party3 = new MPCClient({ partyId: 3 });

// Step 2: Distributed Key Generation (DKG)
// Each party runs DKG protocol to create their secret share
// No single party ever knows the full private key.
const keyShare1 = await party1.generateKeyShare(['party2', 'party3']);
const keyShare2 = await party2.generateKeyShare(['party1', 'party3']);
const keyShare3 = await party3.generateKeyShare(['party1', 'party2']);

// Public key is derived collaboratively and is known to all.
const walletPublicKey = await party1.getPublicKey();

After key generation, signing a transaction requires collaboration. For a 2-of-3 threshold, any two parties must contribute their shares. The library handles the secure cryptographic protocol to combine partial signatures without exposing the individual shares. Continuing the example:

javascript
// Step 3: Distributed Signing (2-of-3 threshold)
// Party 1 and Party 2 collaborate to sign a message.
const messageHash = '0x1234...';

const partialSig1 = await party1.createPartialSignature(messageHash, [keyShare1]);
const partialSig2 = await party2.createPartialSignature(messageHash, [keyShare2]);

// The library combines partial signatures into one valid ECDSA signature.
const finalSignature = await MPCClient.combineSignatures([partialSig1, partialSig2]);

// This `finalSignature` can now be broadcast to the blockchain.

This process ensures the signing key material never reconstitutes in a single, vulnerable location, even during the signing operation.

When implementing MPC, critical operational considerations include secure share storage (HSMs, secure enclaves), network communication over authenticated channels, and a robust backup and recovery procedure for shares. Leading providers like Fireblocks, Qredo, and Cobo offer managed MPC solutions that handle this complexity. For developers, auditing the specific MPC protocol implementation and its cryptographic assumptions is essential, as flaws in the protocol or its execution can undermine the entire security model. MPC represents a significant shift towards institutional-grade, fault-tolerant crypto asset security.

prerequisites
PREREQUISITES AND SETUP

Setting Up Multi-Party Computation (MPC) Wallets

This guide covers the technical prerequisites and initial setup steps for developers implementing or integrating Multi-Party Computation (MPC) wallets. We'll focus on the core concepts, required libraries, and environment configuration.

Multi-Party Computation (MPC) is a cryptographic technique that allows a group of parties to jointly compute a function over their inputs while keeping those inputs private. In the context of wallets, MPC replaces the traditional single private key with a threshold signature scheme (TSS). This means a wallet's signing authority is distributed among multiple parties (e.g., user device, cloud server, hardware module), and a predefined threshold (e.g., 2-of-3) must collaborate to produce a valid signature. This eliminates single points of failure and enhances security for managing blockchain assets. Popular libraries implementing these protocols include GG18, GG20, and Frost.

Before writing any code, you must establish your development environment. Core prerequisites include Node.js (v18 or later) or Python 3.8+, a package manager like npm or pip, and a basic understanding of elliptic curve cryptography. For MPC-specific operations, you will need to choose and install a robust SDK. Options include ZenGo's KMS (Key Management System), Fireblocks' MPC SDK, or open-source libraries like tss-lib (Golang) or multi-party-ecdsa (JavaScript). These SDKs handle the complex cryptographic rounds required for key generation and signing. Always verify the library's audit status and community adoption before integration.

The first actionable step is distributed key generation (DKG). This is a multi-round protocol where the participating parties collaboratively create a shared public key and individual secret shares without any single entity ever knowing the full private key. A typical setup using tss-lib involves initializing parties, establishing secure communication channels (often via a relay server), and running the DKG protocol. After DKG, you will have a public Ethereum address (or similar) and encrypted secret shares stored locally by each party. The public address is used to receive funds, while signing requires the coordination of the threshold number of parties.

For practical development, set up a test environment using a local blockchain like Hardhat or Anvil. Fund your newly generated MPC wallet address with testnet ETH or tokens. Then, implement a signing flow for a simple transaction. This involves each party using their secret share to generate a partial signature, which are then combined to form a single, valid ECDSA signature that can be broadcast to the network. Debugging requires monitoring the MPC protocol messages and ensuring network connectivity between parties is stable. Tools like Wireshark for traffic analysis and library-specific debug logs are essential.

Security considerations are paramount. The security of the MPC scheme relies on the honest majority assumption within your threshold. For a 2-of-3 setup, you assume no more than one party is compromised. You must also secure the communication channels between parties against man-in-the-middle attacks, typically using TLS. Furthermore, protect the persistent storage of each party's secret share, often using hardware security modules (HSMs) or trusted execution environments (TEEs) in production. Regularly plan for key refresh protocols to proactively update secret shares without changing the public address, mitigating potential long-term key leakage.

Finally, integrate your MPC wallet logic into your application stack. This could be a backend custody service, a mobile app, or a browser extension. Design your architecture to separate the MPC ceremony coordination layer from your business logic. Use queue systems (e.g., Redis) to manage signing requests and ensure idempotency. For comprehensive testing, simulate party dropouts and network failures during signing ceremonies to ensure robustness. Always start on testnets (Goerli, Sepolia) and progress through staged rollouts. Documentation for advanced protocols like adaptive security and accountability can be found in the IETF CFRG Drafts.

key-concepts-text
MPC WALLET SETUP

Key Concepts: Threshold Signature Schemes

Threshold Signature Schemes (TSS) enable secure, decentralized key management by distributing signing power across multiple parties. This guide explains the core concepts for setting up a Multi-Party Computation (MPC) wallet.

A Threshold Signature Scheme (TSS) is a cryptographic protocol that allows a group of parties to jointly generate a digital signature without any single party ever holding the complete private key. In a (t, n)-threshold scheme, n participants each hold a secret share, and any subset of t or more of them can collaborate to produce a valid signature. This is fundamentally different from multi-signature (multisig) wallets, which require multiple complete signatures on-chain. TSS signatures appear on-chain as a single, standard signature, reducing gas costs and improving privacy.

Setting up an MPC wallet begins with a Distributed Key Generation (DKG) ceremony. During DKG, the n participants run a secure multi-party computation protocol to collectively generate a public key and their individual secret shares. No trusted dealer is required, and the full private key is never assembled in one place. Popular libraries for implementing DKG and TSS include GG18 and GG20, based on the work of Gennaro and Goldfeder. This process establishes the wallet's address, derived from the shared public key, which is compatible with standard blockchain networks like Ethereum or Bitcoin.

To execute a transaction, at least t participants must engage in a signing protocol. Each participant uses their secret share to compute a partial signature over the transaction data. These partial signatures are then combined, again via MPC, into one final, valid ECDSA or EdDSA signature. This entire process occurs off-chain, with only the final signature being broadcast to the network. Common security models assume honest majority (e.g., t > n/2) or protection against a static number of malicious participants.

MPC wallets offer significant security advantages. They eliminate single points of failure, as compromising fewer than t secret shares does not compromise the wallet. They also reduce operational risks associated with seed phrase backup and storage. However, challenges include the complexity of the protocol, the need for reliable communication between parties, and the liveness requirement—if insufficient participants are available, funds cannot be moved. Frameworks like ZenGo's KMS and Coinbase's Kryptography provide production-ready implementations.

For developers, integrating TSS involves choosing a library, managing secure networked communication between signers (often using secure enclaves or HSMs), and designing a robust ceremony flow. A basic conceptual flow is: 1) Run DKG to get public key and shares, 2) Store shares securely (e.g., in encrypted form), 3) For signing, have participants connect, generate partial signatures, and combine them. This architecture is foundational for institutional custody, decentralized autonomous organizations (DAOs), and advanced wallet recovery solutions.

ARCHITECTURE DECISION

MPC Implementation Approaches: Library vs. Service

Comparison of self-hosted library and managed service models for integrating MPC wallet functionality.

Feature / ConsiderationLibrary (Self-Hosted)Service (Managed)

Implementation Complexity

High (requires cryptographic expertise)

Low (API/SDK integration)

Infrastructure Responsibility

Your team (key servers, HSMs, networking)

Provider (SOC 2, geo-distribution)

Time to Production

3-6+ months

2-4 weeks

Upfront Development Cost

$200k - $500k+

$0 - $50k (integration)

Ongoing Operational Cost

High (devops, security audits, updates)

Usage-based (e.g., $0.01-0.10 per sig)

Custody & Key Control

Full self-custody

Shared (provider manages nodes)

Protocol & Algorithm Updates

Manual integration required

Automated by provider

Compliance & Audit Trail

Must build internally

Often provided out-of-the-box

client-integration
SETTING UP MPC WALLETS

Step 1: Client-Side SDK Integration

Integrate the Chainscore MPC SDK into your frontend application to initialize secure, non-custodial wallets for your users.

The first step in implementing MPC wallets is integrating the client-side SDK into your web or mobile application. This SDK, typically available as an npm package like @chainscore/mpc-sdk, handles the critical task of generating and managing the user's private key shards locally in their browser or device. Installation is straightforward: npm install @chainscore/mpc-sdk. After installation, you initialize the SDK with your project's API keys, which are obtained from the Chainscore developer dashboard. This setup establishes a secure communication channel between your client and the Chainscore coordinator servers, which manage the multi-party computation ceremonies without ever seeing the complete private key.

The core function of the SDK is to facilitate the key generation ceremony. When a new user signs up, your app calls mpcSdk.initializeUser(). This triggers a secure, interactive protocol between the user's device (holding one shard) and the Chainscore network (holding the other shards). The ceremony uses cryptographic algorithms like GG18 or GG20 to collaboratively generate a public/private key pair. The user's shard is encrypted and stored locally (e.g., in IndexedDB or secure storage), while the public address is derived and ready for use. This process ensures key material is never assembled in one place, significantly reducing the attack surface compared to traditional hot wallets or seed phrases.

For developers, the SDK provides a clean API for subsequent wallet operations. After initialization, you can use mpcSdk.signTransaction(txPayload) to create signatures. The SDK automatically coordinates a signing ceremony: it prepares the transaction hash, sends it to the network, and participates in the MPC round to produce a valid ECDSA signature without reconstructing the private key. The returned signature can then be broadcast to the blockchain. The SDK also handles session management, automatically re-authenticating users and refreshing tokens to maintain security. Error handling for network issues or failed ceremonies is built-in, providing clear statuses like CEREMONY_IN_PROGRESS or INSUFFICIENT_SHARDS.

A crucial implementation detail is shard backup and recovery. Since the user's key shard is stored locally, you must implement a secure backup flow. The SDK provides methods to export an encrypted backup package, which can be secured with a user password and stored offline. The recovery process involves importing this package and executing a resharing ceremony with the network to regain access. It's vital to educate users about this responsibility. Furthermore, for enterprise applications, the SDK supports policy engines and transaction simulation, allowing you to set rules for transaction types or value limits before a signing request is even sent to the user.

server-setup
MPC WALLET ARCHITECTURE

Step 2: Server-Side Key Generation Service

This guide details the implementation of the server-side component responsible for generating and managing the second key share in a 2-of-2 Multi-Party Computation (MPC) wallet.

The server-side key generation service is a critical, isolated component that holds one of the two private key shares. It does not store the complete private key at any point. Instead, it participates in a cryptographic protocol, such as GG20 or FROST, to collaboratively generate the public key and its corresponding secret share with the client. This service must run in a secure, hardened environment—often a Hardware Security Module (HSM) or a Trusted Execution Environment (TEE)—to protect its share from extraction. Communication with the client-side application occurs over a secure, authenticated channel (e.g., TLS).

The core function of this service is to execute the MPC protocol for both key generation and signing. During setup, it exchanges messages with the client to compute the joint public key without either party learning the other's secret share. For signing, the service receives a hash of the transaction to sign, performs its portion of the signature computation using its secret share, and sends a partial signature back to the client. The client then combines this with its own partial signature to produce the final, valid ECDSA or EdDSA signature that can be broadcast to the network.

Implementing this service requires careful security design. Key practices include: - Using a secure enclave (like AWS Nitro Enclaves or Intel SGX) for computation. - Implementing robust authentication (e.g., API keys, OAuth) to ensure only authorized clients can request operations. - Enforcing rate limiting and request signing to prevent abuse. - Never logging or outputting the secret share in plaintext. The service's API typically exposes secure endpoints such as /v1/mpc/keygen/initiate and /v1/mpc/sign.

Here is a simplified example of a Node.js service using the @noble/curves and @bitcoinjs/message libraries to handle a signing request. This pseudo-code demonstrates the server's role in creating a partial signature.

javascript
// Server-side signing handler (conceptual)
async function handleSignRequest(transactionHash, clientPublicNonce) {
    // 1. Retrieve the server's secret key share from secure storage
    const serverSecretShare = await secureStorage.getKeyShare(keyId);
    
    // 2. Generate the server's nonce share (k_i) securely
    const serverNonceShare = generateSecureNonce();
    
    // 3. Compute the server's partial signature (s_i) using its share
    // This uses the transaction hash, the server's secret share, and nonce
    const partialSig = mpcSignPartial(
        serverSecretShare,
        serverNonceShare,
        clientPublicNonce,
        transactionHash
    );
    
    // 4. Return the partial signature and public nonce to the client
    return {
        partialSignature: partialSig,
        serverPublicNonce: getPublicNonce(serverNonceShare)
    };
}

Operational security is paramount. The service should be deployed behind a firewall with minimal open ports, and all internal communications should be encrypted. Regular security audits and penetration testing are essential. Furthermore, the service must implement a key rotation and backup strategy for its secret shares, potentially using distributed key generation (DKG) protocols to refresh shares without reconstructing the full key. Monitoring should alert on anomalous activity, such as a high volume of signing requests from a single client.

Integrating this service completes the 2-of-2 MPC architecture. The client application, holding the first share, calls this service to perform any wallet operation. This setup provides a superior security model compared to single-key custody, as compromising one party does not compromise the wallet. The next step involves building the client-side application that interacts with this service and the blockchain.

signing-protocol
MPC WALLET SETUP

Step 3: Implementing the Signing Protocol

This step details the core cryptographic operations for generating and using a multi-party computation wallet, moving from theory to practical implementation.

The signing protocol is the cryptographic engine of an MPC wallet. Unlike a traditional private key stored in one place, the signing power is distributed across multiple signing parties (often user devices or institutional servers). The core protocol ensures that no single party ever has access to the complete private key. Instead, each party holds a secret share, and signatures are produced through a secure multi-party computation that combines these shares without reconstructing the full key. This process typically uses threshold signature schemes (TSS) like ECDSA or EdDSA, where a predefined threshold (e.g., 2-of-3) of parties must collaborate to sign a transaction.

Implementation begins with the Key Generation (KeyGen) ceremony. This is a distributed protocol where all participating parties run a secure algorithm to collectively generate a public/private key pair. Each party ends up with a unique secret share of the private key and a common public address. Libraries like ZenGo's tss-lib or Binance's tss-lib provide battle-tested implementations for this. The ceremony must be conducted over authenticated, secure channels and includes multiple rounds of communication to ensure robustness against malicious participants and prevent any single point of failure during key creation.

When a transaction needs to be signed, the parties initiate the Signing (Sign) protocol. The initiator broadcasts the transaction hash to be signed. The participating parties then engage in another multi-round computation. Each party uses its secret share to produce a partial signature. These partial signatures are then combined using the MPC algorithm to produce a single, valid ECDSA signature that can be verified on-chain by the standard public key. Crucially, the full private key is never assembled at any point. The security relies on the mathematical properties of the threshold scheme, ensuring the signature is identical to one produced by a single key.

For developers, integrating this involves managing secure peer-to-peer communication (often using libp2p), handling the state machine for multi-round protocols, and securely storing the secret shares. A common architecture uses a client-server model where a user's mobile device (client) and a cloud-backed service (server) each hold a share. The client initiates signing, the server participates in the MPC protocol, and the final signature is assembled on the client. Error handling is critical—protocols must account for offline parties, network timeouts, and malicious inputs without compromising security or leaking share information.

Testing and auditing are paramount. Implementations should undergo rigorous review for cryptographic correctness and side-channel resistance. Use existing, audited libraries rather than building cryptographic primitives from scratch. Furthermore, consider the operational lifecycle: how to add new parties (resharing), rotate keys, and securely back up secret shares (often using encrypted shards). A well-implemented MPC signing protocol provides a robust foundation for secure, non-custodial wallet infrastructure that eliminates single points of private key compromise.

MPC WALLET ARCHITECTURES

Security and Threat Model Analysis

Comparison of security properties and threat resilience for different MPC wallet setups.

Threat VectorSingle-Party (Hot Wallet)Multi-Sig (e.g., 2-of-3)Threshold MPC (e.g., 2-of-3)

Private Key Exposure

Critical: Single point of failure

High: Multiple key shares exist

Low: No single key exists

Collusion Resistance

N/A

Medium: Requires 2+ parties

High: Requires 2+ distinct share holders

Signing Latency

< 1 sec

~30-60 sec

~2-5 sec

Trust Assumptions

Trust device security

Trust other signers

Trust MPC protocol security

Quantum Resistance

Hardware Security Module (HSM) Support

On-Chain Privacy

Operational Complexity

Low

High

Medium

MPC WALLET DEVELOPMENT

Frequently Asked Questions (FAQ)

Common questions and technical clarifications for developers implementing or troubleshooting Multi-Party Computation (MPC) wallet systems.

While both require multiple approvals, they are architecturally distinct. A multi-sig wallet (like Gnosis Safe) is a smart contract that validates multiple on-chain signatures (SIG_1, SIG_2) from separate private keys. A Threshold Signature Scheme (TSS) wallet generates a single on-chain signature from distributed key shares held by parties; the private key never exists in one place.

Key Differences:

  • On-chain footprint: Multi-sig transactions are larger and more expensive due to multiple signatures. TSS produces one signature, reducing gas costs.
  • Privacy: TSS transactions appear identical to single-signer transactions, offering better privacy.
  • Setup Complexity: TSS requires a complex distributed key generation (DKG) ceremony but has simpler on-chain logic. Multi-sig setup is simpler off-chain but has more complex on-chain verification.
conclusion
IMPLEMENTATION SUMMARY

Conclusion and Next Steps

You have now configured a foundational MPC wallet system. This guide covered generating key shares, establishing a secure communication channel, and executing threshold signatures for transactions.

The core security model of Multi-Party Computation (MPC) relies on the principle that no single party ever holds a complete private key. Your setup, whether using libraries like ZenGo's tss-lib for ECDSA or Binance's tss-lib for EdDSA, ensures that signing authority is distributed. The private key exists only as a mathematical secret shared across the participating devices or servers. This eliminates single points of failure, protecting assets from device loss, theft, or server compromise, a significant improvement over traditional seed phrases and hardware wallets.

For production deployment, several critical next steps are required. First, rigorously test the signing ceremony in a staging environment, simulating various failure modes like participant dropout or network latency. Second, implement robust key refresh protocols to periodically update the secret shares without changing the public address, mitigating potential key share leakage over time. Third, establish a secure, auditable backup and recovery process for key shares, potentially using hardware security modules (HSMs) or trusted execution environments (TEEs) for institutional setups.

To deepen your understanding, explore advanced MPC protocols. GG20 enables identifiable abort, where misbehaving parties can be detected during signing. FROST (Flexible Round-Optimized Schnorr Threshold) protocols offer non-interactive signing after a one-time setup, ideal for scalability. Research how major custodians like Fireblocks and Coinbase architect their MPC networks for low-latency, high-availability signing across global data centers.

The future of MPC wallets is integration with broader account abstraction and intent-based systems. Imagine an MPC-secured smart contract wallet (like Safe{Wallet}) where transaction policies are enforced by a threshold of stakeholders. Developers can build applications where actions require multi-party approval, blending MPC's cryptographic security with on-chain programmability. This paves the way for sophisticated decentralized autonomous organizations (DAOs) and institutional DeFi operations.

Continue your implementation by stress-testing with high-frequency transactions, integrating monitoring and alerting via services like Chainscore, and contributing to open-source MPC libraries. The field evolves rapidly; follow research from the MPC Alliance and academic conferences like CRYPTO. By mastering MPC, you are building infrastructure for the next generation of secure, user-owned digital asset management.