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 a Multi-Party Computation (MPC) Network for Market Creation

A technical guide for deploying a decentralized MPC network to create and resolve prediction markets where no single node learns the full market data or user inputs.
Chainscore © 2026
introduction
TECHNICAL GUIDE

Setting Up a Multi-Party Computation (MPC) Network for Market Creation

This guide explains how to implement a secure MPC network for creating private prediction markets, where market outcomes are computed without revealing individual user data.

A Multi-Party Computation (MPC) network enables a group of parties to jointly compute a function over their private inputs while keeping those inputs confidential. For a private prediction market, this allows participants to place bets on an event's outcome—like an election result or asset price—without revealing their position or stake to other participants or the network operators. The core cryptographic primitive is secret sharing, where a user's data is split into encrypted shares distributed among multiple MPC nodes. No single node can reconstruct the original data, ensuring privacy by design.

Setting up the network begins with defining the MPC protocol. For prediction markets, the Garbled Circuit or Secret Sharing-based protocols like SPDZ are common choices, balancing efficiency for the required operations: secure comparison, addition, and multiplication of encrypted bids and stakes. You'll need to deploy several independent MPC nodes, often run by different entities or in isolated cloud environments to prevent collusion. Each node runs an MPC runtime such as MP-SPDZ or Obliv-C, configured with the same circuit or program representing the market's settlement logic.

The market creation logic must be compiled into an arithmetic circuit or bytecode that the MPC protocol can execute. For a simple yes/no market, this circuit takes secret-shared inputs (e.g., 1 for 'yes', 0 for 'no' and an encrypted stake), validates them against rules, and outputs the final, cleartext market result and profit distribution only after the event resolves. Developers can write this logic in a high-level framework like SCALE-MAMBA or using EzPC's simplified syntax, which abstracts much of the cryptographic complexity.

A critical step is integrating a trusted execution environment (TEE) or secure hardware module for the initial secret sharing phase. When a user submits a prediction, client-side software uses a library like libOTe or SEAL to split the data into shares. These shares are then transmitted over TLS to the respective MPC nodes. The nodes never see the raw data. For production systems, using a random beacon or threshold signature scheme (e.g., FROST) to synchronize computation phases is essential for security and liveness.

Finally, the system requires an oracle to feed the real-world outcome into the MPC network securely. This is typically done by having the oracle providers also secret-share the outcome data among the nodes. The MPC circuit then compares the private user predictions to the private oracle input, computes payouts, and reconstructs the final results. The entire process, from share distribution to result reconstruction, ensures that individual bets and the market's aggregated direction remain hidden until settlement, enabling truly private speculation.

prerequisites
MPC NETWORK SETUP

Prerequisites and System Requirements

Before deploying a Multi-Party Computation (MPC) network for decentralized market creation, you must establish a secure and performant foundation. This guide details the essential hardware, software, and cryptographic prerequisites.

A functional MPC network requires a distributed set of computation nodes, each operated by a distinct party. Each node must run on a machine with sufficient computational power to handle cryptographic operations like threshold signatures and secret sharing. Recommended specifications include a modern multi-core CPU (e.g., 4+ cores), 8+ GB of RAM, and a stable, high-bandwidth internet connection with a static public IP address or a reliable method for dynamic DNS. For production environments, consider using cloud instances (AWS EC2, Google Cloud Compute) or dedicated servers to ensure uptime guarantees and DDoS protection.

The core software stack is built around an MPC protocol library. Popular choices for threshold ECDSA, which is essential for signing blockchain transactions, include GG18, GG20, and Lindell17. Libraries like ZenGo-X's multi-party-ecdsa or Coinbase's kryptology provide implementations. Your application layer, responsible for market logic and order matching, must integrate with this MPC library via its API. All nodes must synchronize using a consensus mechanism for the pre-processing phase and to agree on transaction data, which can be implemented using a simple message bus like Redis Pub/Sub or a more robust BFT consensus library such as libp2p for peer-to-peer communication.

Cryptographic key generation is the first critical step. Using the MPC library, the n parties execute a Distributed Key Generation (DKG) ceremony to create a shared public key and individual private key shares without any single party ever knowing the full private key. You must securely decide on and hardcode the threshold t (e.g., 3-of-5) during network initialization. This parameter dictates how many signatures are required to authorize a transaction and directly impacts security (t must be high enough to prevent collusion) and liveness (n-t must be high enough to tolerate offline nodes). All configuration files, including party identifiers, network addresses, and the threshold scheme, must be identical across all nodes.

For blockchain interaction, your MPC network's public address must be funded. You'll need a separate, secure wallet to send initial gas funds (ETH for Ethereum, MATIC for Polygon) to this address. The market creation smart contracts must be deployed to your target chain (e.g., Ethereum Mainnet, Arbitrum, Base). Your node software needs access to a blockchain RPC endpoint, from a provider like Alchemy or Infura, to query state and broadcast signed transactions. Ensure your node can handle the specific EIP-712 structured data signing required by many DeFi protocols for off-chain order messages.

Finally, establish operational security practices. Each party must store its key share in a hardware security module (HSM) or a secure, offline environment. Implement comprehensive logging, monitoring, and alerting for node activity. Plan for key refresh protocols to periodically rotate key shares without changing the public address, and define procedures for adding/removing parties. Testing on a testnet (like Sepolia or Goerli) with a simulated multi-party setup is non-negotiable before any mainnet deployment to validate the entire signing flow and network resilience.

key-concepts
MPC NETWORK FUNDAMENTALS

Core Cryptographic Concepts

Essential cryptographic building blocks for establishing a secure, decentralized Multi-Party Computation (MPC) network to enable trustless market creation.

06

Network Communication & Adversarial Models

Designing the communication layer and defining the threat model is crucial for MPC network security. Assumptions about participant behavior dictate protocol choice.

  • Synchronous vs. Asynchronous: Does the protocol assume bounded message delay? Synchronous models (easier) vs. Asynchronous (more robust).
  • Adversarial Models: Semi-honest (passive) adversaries follow protocol but try to learn secrets. Malicious (active) adversaries can deviate arbitrarily.
  • Byzantine Agreement: For malicious models, consensus protocols are needed to agree on inputs/outputs, adding complexity.
n/3
Fault Tolerance (Malicious)
n/2
Fault Tolerance (Semi-Honest)
architecture-overview
SYSTEM ARCHITECTURE AND DATA FLOW

Setting Up a Multi-Party Computation (MPC) Network for Market Creation

This guide details the architecture and data flow for a decentralized market creation system secured by Multi-Party Computation, enabling trustless order matching and settlement.

A Multi-Party Computation (MPC) network for market creation replaces a single, centralized order book with a distributed key management system. The core innovation is that the private key required to authorize trades is secret-shared among multiple independent nodes, known as parties or signers. No single party ever has access to the full key, eliminating a central point of failure and custody risk. This architecture is foundational for creating non-custodial, decentralized exchanges (DEXs) that can match orders off-chain with on-chain settlement finality, combining the performance of centralized systems with the security of decentralization.

The system architecture typically consists of three core layers: the Client Layer (user wallets and trading interfaces), the MPC Node Network (distributed signers running threshold signature schemes like GG20 or FROST), and the Blockchain Settlement Layer (smart contracts on chains like Ethereum or Solana). Orders are broadcast to the network, matched by a designated coordinator, and then the resulting trade transaction is collaboratively signed by a threshold of MPC nodes (e.g., 3-of-5). The signed transaction is then submitted on-chain for settlement. This flow ensures the trade logic and matching occur off-chain for speed, while asset movement remains securely governed by on-chain smart contracts.

Implementing the MPC node network requires careful configuration. Each node operator runs specialized software, such as Fireblocks' MPC-CMP or open-source libraries like ZenGo-X's multi-party-ecdsa. The setup process involves a Key Generation Ceremony where nodes collaboratively generate the shared public key and their individual secret shares. This is a critical one-time setup that must be performed in a secure, authenticated environment. Network communication between nodes uses encrypted channels, often over a Transport Layer Security (TLS) mesh, to prevent eavesdropping on the secret shares during the signing process.

Data flow for a single trade begins when a user's client submits a signed order message to the network. A Match Engine (which can be run by one of the nodes or a separate service) identifies a compatible counter-order. Upon a match, the engine constructs an unsigned blockchain transaction. This transaction is sent to the MPC nodes, which engage in a distributed signing protocol. Each node computes a partial signature using its secret share without revealing it. These partial signatures are combined to produce a single, valid ECDSA or EdDSA signature that can be verified by the on-chain settlement contract, which then atomically swaps the assets between the matched parties.

Security considerations are paramount. The threshold scheme (e.g., t-of-n) determines the resilience of the system. A 2-of-3 setup tolerates one malicious or offline node, while a 5-of-9 setup offers higher robustness. The network must also guard against consensus manipulation in the matching layer and ensure liveness—if insufficient nodes are online, signing cannot proceed. Regular key refresh protocols are also necessary to proactively update secret shares without changing the public address, mitigating the risk of share compromise over time. Audits of both the MPC cryptography and the smart contract settlement logic are essential before mainnet deployment.

In practice, projects like Injective Protocol and dYdX v4 utilize variations of this architecture. Developers can experiment using SDKs from MPC service providers or by deploying test networks with tools like Multi-Party Sigmanet. The end result is a market creation system where users retain custody of their assets, trading is fast and cheap, and the security of the entire system does not rely on trusting a single entity, fulfilling a core promise of decentralized finance.

node-setup-steps
FOUNDATION

Step 1: Setting Up MPC Network Nodes

This guide details the initial infrastructure setup for a Multi-Party Computation (MPC) network, focusing on node deployment and configuration for secure, decentralized market creation.

A Multi-Party Computation (MPC) network is a decentralized system where multiple independent parties, or nodes, jointly compute a function over their private inputs without revealing those inputs to each other. For market creation, this enables functions like threshold signature generation for a shared wallet or secure order matching. The core security property is that no single node can unilaterally control assets or manipulate the market state. Each node runs identical protocol logic but holds a unique, secret key share.

The first step is provisioning the hardware or cloud instances for each node operator. For a production-grade network, we recommend deploying on isolated virtual machines or bare-metal servers. Each node requires a stable public IP address, at least 2 vCPUs, 4GB RAM, and 50GB of storage. Use infrastructure-as-code tools like Terraform or Ansible to ensure identical, reproducible environments. All nodes must synchronize time using NTP and have firewall rules configured to allow peer-to-peer communication on the designated port (e.g., TCP 9000).

Next, configure the MPC node software. We'll use the open-source MPC-ECDSA library from ZenGo as a reference. After cloning the repository, install dependencies including golang 1.21+, libssl-dev, and gmp. The critical configuration file config.yaml defines the network parameters: the node_id (a unique integer), the peer_addresses of all other participants, the threshold value (e.g., 2-of-3), and the elliptic curve (typically secp256k1 for Ethereum compatibility).

Node identity and key generation are bootstrapped using a Distributed Key Generation (DKG) ceremony. This is a one-time interactive protocol where nodes communicate to collectively create a master public key and individual secret shares. Run the DKG command: ./mpc-node dkg --config ./config.yaml. The output will be each node's key_share.json file, which must be stored securely offline. The public address, derived from the master key, becomes the network's controlled wallet address.

Finally, establish the peer-to-peer network. Start each node with ./mpc-node start --config ./config.yaml. Nodes will connect to their peers and begin listening for computation requests. Verify the network is healthy by checking logs for "Connected to peer" messages and using a health check RPC endpoint. The network is now ready to process MPC protocols, such as creating a threshold signature for a transaction, which will be covered in the next step for market operations.

threshold-signature-integration
MPC NETWORK SETUP

Implementing the Threshold Signature Scheme

This step details the core cryptographic implementation for your MPC network, enabling secure, distributed signing for market creation without a single point of failure.

A Threshold Signature Scheme (TSS) is the cryptographic engine of your MPC network. Unlike a traditional multi-signature wallet that creates multiple signatures on-chain, TSS generates a single, standard ECDSA signature from contributions of multiple parties. This signature is indistinguishable from one created by a single private key, offering significant benefits: - Reduced on-chain gas costs - Enhanced privacy - Simplified smart contract interaction. For market creation, this means the authority to list new trading pairs or adjust parameters is securely distributed among network participants.

The implementation begins with a Distributed Key Generation (DKG) ceremony. Each participant, or party, locally generates a secret share. Using a protocol like GG20 or Frost, parties communicate over secure channels to collaboratively compute a public key without any single entity ever learning the complete private key. This public key becomes the network's signing address. Libraries such as ZenGo's tss-lib or Binance's tss-lib provide robust, audited implementations for this phase, which is critical for establishing trust in the network's foundation.

When a signature is required—for instance, to authorize a new market contract deployment—the network initiates a signing protocol. Each party uses their secret share to compute a partial signature. These partials are combined, typically by a designated coordinator or via peer-to-peer communication, to produce the final valid signature. It's crucial that the signing process reveals no information about the individual secret shares. The security model is defined by the threshold parameters (t-of-n), where t is the minimum number of honest parties required to sign, and n is the total number of parties.

For developers, integrating TSS involves setting up a secure communication layer between nodes (often using libp2p or a custom WebSocket server) and managing state for the multi-round protocols. Error handling is paramount; if a party disconnects during DKG or signing, the protocol must safely abort or continue based on robustness features. Below is a conceptual code snippet for initiating a signing round using a hypothetical TSS library:

javascript
// Parties agree on a message hash to sign (e.g., a market creation transaction)
const messageHash = getTransactionHash(marketCreationTx);

// Initiate the signing protocol among parties
const signing = new Signing(partyId, partyIds, threshold);
const signatureShare = await signing.createSignatureShare(messageHash);

// Shares are exchanged and combined to produce the final signature
const finalSignature = await signing.combineSignatureShares(receivedShares);
// finalSignature is a standard 65-byte ECDSA sig (r, s, v)

Key considerations for production include key refresh protocols to proactively update secret shares without changing the public key, mitigating long-term leakage risks, and hardware security module (HSM) integration for storing secret shares. The choice between synchronous (faster, requires all parties online) and asynchronous (more resilient, tolerates offline parties) protocol designs will impact your network's latency and robustness. Thoroughly audit the TSS library and consider formal verification for the cryptographic primitives, as flaws here compromise the entire market creation system.

smart-contract-resolver
MPC NETWORK SETUP

Step 3: Deploying the On-Chain Resolver Contract

This step involves deploying the smart contract that will serve as the authoritative, on-chain source of truth for your MPC network's configuration and signer set.

The on-chain resolver contract is a critical component of your MPC network's infrastructure. It acts as a public registry that stores the network's configuration, including the current list of authorized signer nodes (identified by their public keys), the required threshold for signing transactions (e.g., 3-of-5), and the network's unique identifier. By anchoring this information on-chain—typically on a base layer like Ethereum—you create a tamper-proof and verifiable state that all participants can query. This eliminates the need for off-chain coordination files and ensures all nodes operate from a single source of truth.

Before deployment, you must finalize your network's parameters. This includes determining the signer threshold (e.g., m-of-n), collecting the secp256k1 public keys from all participant nodes, and assigning a unique networkId. A common practice is to use a Gnosis Safe or a similar multi-sig wallet as the owner of the resolver contract, allowing for decentralized governance over future upgrades to the signer set. You will encode these parameters into the contract's constructor arguments.

Deployment is typically done using a tool like Hardhat or Foundry. Below is a simplified example of a deployment script for a hypothetical MPCResolver contract using Hardhat and Ethers.js. The script compiles the contract, connects a deployer wallet, and passes the constructor arguments.

javascript
const hre = require("hardhat");
async function main() {
  const signerPubKeys = [
    "0x04abc123...",
    "0x04def456...",
    // ... more public keys
  ];
  const threshold = 3; // 3-of-n
  const networkId = "my-mpc-network-1";

  const MPCResolver = await hre.ethers.getContractFactory("MPCResolver");
  const resolver = await MPCResolver.deploy(signerPubKeys, threshold, networkId);

  await resolver.waitForDeployment();
  console.log("MPCResolver deployed to:", await resolver.getAddress());
}

After successful deployment, you must verify the contract's source code on a block explorer like Etherscan. Verification is essential for transparency and security, allowing anyone to audit the contract logic. Next, each node in your MPC network needs to be configured to poll this resolver contract's address. The node software will periodically call a view function, such as getCurrentSignerSet(), to synchronize its local state with the on-chain configuration. This setup ensures that if the signer set is updated via a governance proposal, all nodes will automatically adopt the new configuration after the transaction is confirmed.

The resolver contract also enables key recovery and rotation. If a signer node is compromised or needs to be retired, the contract owner (e.g., the Gnosis Safe) can submit a transaction to replace the old public key with a new one. The threshold signature scheme remains intact as long as the total number of valid signers meets the threshold. This on-chain mechanism provides a clear audit trail for all administrative actions taken on the network.

PROTOCOL SELECTION

Comparison of MPC Protocols for Market Resolution

Key technical and operational differences between leading MPC protocols for decentralized market creation and settlement.

FeatureGG20 (Multi-Party ECDSA)FROST (Flexible Round-Optimized Schnorr)SPDZ (MPC with Preprocessing)

Signature Scheme

Threshold ECDSA

Threshold Schnorr

Arithmetic / Garbled Circuits

Signature Size

~64 bytes

~64 bytes

Protocol Dependent

Preprocessing Required

Communication Rounds (Signing)

7-9 rounds

2 rounds

2-3 rounds (online phase)

Adversary Model

Active, t < n/2

Active, t < n/2

Active, t < n

Key Refresh Capability

Typical Latency (Signing)

< 2 sec

< 1 sec

5 sec (incl. setup)

Primary Use Case

Blockchain txs, wallets

Lightning Network, coins

Complex auctions, sealed-bid

MPC NETWORK SETUP

Common Deployment Issues and Troubleshooting

Addressing frequent technical hurdles and configuration problems when establishing a secure Multi-Party Computation network for decentralized market creation.

Connection failures are often due to network configuration or key mismatches. Common causes include:

  • Firewall/Port Issues: The MPC protocol requires specific ports (e.g., 9001 for libp2p) to be open. Verify your node's inbound/outbound rules.
  • Bootnode Configuration: Incorrect or unreachable bootnode addresses in your node's config file (config.toml) will prevent peer discovery.
  • Peer ID Mismatch: The node's generated public key must match the one registered in the network's allowlist or genesis file.
  • Network ID Mismatch: Ensure all nodes are configured with the same chain-id or network identifier.

First, check node logs for explicit connection refusal or timeout errors. Use tools like netstat to confirm your node is listening on the expected port.

MPC NETWORK SETUP

Frequently Asked Questions

Common technical questions and troubleshooting for developers implementing MPC-based market creation systems.

Threshold Signature Scheme (TSS) and threshold ECDSA are both MPC protocols, but they differ in architecture and cryptographic approach.

  • TSS (Generic): A broader class of protocols where signing is distributed. Parties collaboratively generate a single public key without any single party ever knowing the full private key. The private key is secret-shared using schemes like Shamir's Secret Sharing from the start.
  • Threshold ECDSA: A specific implementation of TSS designed for the ECDSA algorithm used by Bitcoin and Ethereum. It enables distributed key generation and signing where a threshold (e.g., 2-of-3) of participants must collaborate to produce a valid signature that is indistinguishable from a standard single-party ECDSA signature.

For market creation, threshold ECDSA is often preferred because it produces standard-compliant signatures compatible with all existing Ethereum smart contracts and wallets, avoiding the need for custom verification logic.

conclusion
MPC NETWORK DEPLOYMENT

Conclusion and Next Steps

Your MPC network is now operational. This section outlines key considerations for maintaining security, scaling the system, and exploring advanced applications.

Deploying the network is the first major milestone. The next critical phase is establishing a robust operational security posture. This involves continuous monitoring of node health and network latency, implementing automated key refresh ceremonies to rotate threshold shares, and setting up comprehensive logging and alerting for any anomalous signing attempts. Regular security audits, both internal and by third-party firms, are essential to identify and remediate vulnerabilities in your custom TSS logic or infrastructure.

To scale your market creation platform, consider architectural patterns like sharding the MPC cluster by asset type or geographic region to reduce latency and increase throughput. You can also explore integrating with Layer-2 solutions or app-specific chains (e.g., using the Cosmos SDK or a Polygon Supernet) to offload settlement and reduce mainnet gas costs for your users. Performance testing under simulated load is crucial to identify bottlenecks in your REST API or message-relay layer before going live.

With a stable foundation, you can extend the MPC network's capabilities. Advanced use cases include implementing conditional or time-locked transactions for complex DeFi strategies, creating institutional-grade custody solutions with customizable policies, or facilitating cross-chain atomic swaps where the MPC acts as the trusted verifier. The Fireblocks developer docs and ZenGo's research blog offer deep dives into these advanced cryptographic applications.

Finally, engage with the broader community. Share your learnings (while protecting sensitive details), contribute to open-source TSS libraries like Multi-Party EC-DSA implementations, and stay updated on cryptographic breakthroughs from institutions like ING Bank's blockchain team or academic conferences. The field of secure multi-party computation evolves rapidly, and proactive engagement is key to maintaining a long-term, secure market creation platform.

How to Set Up an MPC Network for Private Prediction Markets | ChainScore Guides