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

How to Implement a Treasury Custody Solution with MPC Wallets

A step-by-step technical guide for developers to implement institutional-grade treasury custody using MPC wallets. Includes code examples for key generation, signing, and workflow integration.
Chainscore © 2026
introduction
GUIDE

How to Implement a Treasury Custody Solution with MPC Wallets

This guide explains the technical steps for a DAO to transition from a single-signature wallet to a secure, multi-party computation (MPC) custody solution.

A DAO treasury managed by a single private key is a critical security vulnerability. Multi-party computation (MPC) wallets eliminate this single point of failure by distributing signing authority across multiple parties or devices. Unlike traditional multisig wallets that execute transactions on-chain, MPC uses advanced cryptography to generate a single signature from multiple secret shares, keeping the private key fragmented and never fully assembled. This approach offers enhanced security, reduced on-chain gas costs for setup, and more flexible governance models, making it the standard for institutional-grade DAO treasury management.

The implementation process begins with selecting an MPC provider. Evaluate solutions like Fireblocks, Qredo, Safe (via Safe{Wallet}), or BitGo based on your DAO's needs: the number of required signers (threshold), key recovery mechanisms, integration with your existing tooling (e.g., Snapshot, Zodiac), and compliance features. You must also define your signing policy: determine the total number of key shareholders (e.g., 5 elected council members) and the approval threshold for transactions (e.g., 3-of-5). This policy is enforced cryptographically by the MPC protocol, not by smart contract logic.

Next, you will generate the MPC wallet. The provider's software will orchestrate a distributed key generation (DKG) ceremony. Each participant runs a client to create their unique secret share. Critically, the full private key is never created or known to any single party or the provider itself. The process outputs a single public address for your treasury. All participants must securely store their secret shares, typically using hardware security modules (HSMs), secure enclaves on devices, or specialized hardware wallets. Losing a sufficient number of shares can render the wallet inaccessible.

Integrating the new MPC wallet with your DAO's governance workflow is crucial. Connect the wallet address to your treasury management dashboard (like Llama or Parcel). For proposal execution, use middleware that interfaces with your MPC provider's API. For example, a Zodiac module can be configured to forward transactions from a Safe to an MPC signing queue. When a proposal passes, an authorized executor submits the transaction payload. Notifications are then sent to the required signers, who approve it using their shares via their secure clients, generating the final signature.

Establish rigorous operational procedures. Maintain an up-to-date signer roster with offboarding/onboarding protocols managed by the MPC provider's policy engine. Schedule regular test transactions to validate the signing process. Monitor for suspicious activity using the provider's alert systems. Crucially, implement and periodically test a key refresh protocol. This security feature allows you to generate new secret shares for the same public address, rendering any potentially compromised old shares useless without moving funds or changing the wallet address.

MPC custody fundamentally shifts security from blockchain-level smart contracts to cryptographic secret sharing. By following these steps—selecting a provider, defining policy, conducting DKG, integrating with governance, and enforcing procedures—DAOs can achieve enterprise-grade security for their assets. This setup protects against single points of failure and internal collusion, ensuring the treasury only acts upon the legitimate, aggregated will of its stakeholders.

prerequisites
MPC WALLET IMPLEMENTATION

Prerequisites and Setup

Before building a treasury custody solution, you must establish the foundational infrastructure and understand the core security model.

Implementing a treasury-grade custody solution requires a shift from single-key wallets to a Multi-Party Computation (MPC) architecture. This setup distributes signing authority across multiple parties or devices, eliminating single points of failure. For this guide, we assume you are building for an organization and will use a Threshold Signature Scheme (TSS), where a predefined subset of participants (e.g., 2-of-3) must collaborate to authorize a transaction. You will need a development environment with Node.js (v18+), a package manager like npm or yarn, and a basic understanding of asymmetric cryptography and blockchain transaction structures.

The first technical prerequisite is selecting an MPC library or service provider. For a self-hosted, non-custodial approach, libraries like tss-lib (for ECDSA) or binance-threshold-ecdsa provide the core cryptographic primitives. Alternatively, managed services like Fireblocks, Qredo, or Safeheron offer SDKs that abstract much of the complexity. Your choice dictates the subsequent setup steps. For a hands-on implementation, initialize a new project and install your chosen library: npm install @fireblocks/fireblocks-sdk or add the relevant tss-lib dependency from its GitHub repository.

You must establish a secure key generation ceremony. This is the process where the distributed key shares are initially created. In a 2-of-3 TSS setup, three separate, air-gapped machines or secure enclaves would run the key generation protocol, each producing a unique private key share. The corresponding public key (the treasury address) is derived mathematically from all shares. Crucially, the full private key never exists at any single location. Document and secure the metadata from this ceremony, as losing a majority of shares can permanently lock the treasury. Tools like Intel SGX or AWS Nitro Enclaves can enhance this process's security.

Next, configure your network and chain connectivity. Your custody solution will need to query blockchain state and broadcast signed transactions. Integrate with node providers like Alchemy, Infura, or QuickNode for reliable RPC endpoints. For multi-chain treasuries, you'll need to support different derivation paths and transaction formats (e.g., Ethereum's EIP-1559, Bitcoin's SegWit). Use libraries like ethers.js or viem for EVM chains and compatible Bitcoin libraries to construct unsigned transaction objects that will be passed to your MPC signing module.

Finally, set up the operational infrastructure for signing. This involves creating a secure, auditable service that orchestrates the signing process. The service should:

  1. Store key share metadata (encrypted) without the shares themselves.
  2. Provide an API for creating transaction proposals.
  3. Coordinate the signing round between the required parties, often using a secure multi-party computation network layer.
  4. Log all actions for compliance and auditing. Consider using a Hardware Security Module (HSM) or cloud HSM (e.g., AWS CloudHSM, GCP Cloud KMS) to safeguard the service's own credentials and perform cryptographic operations in isolation.
key-concepts-text
GUIDE

How to Implement a Treasury Custody Solution with MPC Wallets

A practical guide to implementing a secure, enterprise-grade treasury management system using Multi-Party Computation (MPC) technology.

Implementing a treasury custody solution begins with selecting a robust MPC wallet provider. Key evaluation criteria include the cryptographic protocol (GG18, GG20, CMP), the provider's security track record, and their support for your required blockchain networks (Ethereum, Solana, Polygon, etc.). Leading providers like Fireblocks, Qredo, and BitGo offer SDKs and APIs that abstract the underlying MPC complexity. The first step is to create an organization or workspace within the provider's dashboard, which serves as the root container for your policies, users, and wallets. This setup phase is critical for establishing the foundational security and governance model.

The core of the implementation is defining and enforcing transaction policies. These are programmable rules that dictate how funds can move. A typical policy for a corporate treasury might require 2-of-3 approvals for any transaction over $10,000, with a 24-hour time-lock for amounts exceeding $100,000. Policies are configured via the provider's admin console or API and are enforced at the protocol level. You will assign specific signing devices (hardware security modules, mobile apps, or cloud services) to authorized users. The MPC protocol ensures no single device ever holds a complete private key; instead, each holds a secret share. Transaction signing is a collaborative process where the required threshold of devices computes a signature without reconstructing the key.

For developers, integration involves using the provider's Software Development Kit (SDK). A basic workflow in code involves initializing the client, creating a transaction payload, and obtaining approvals. For example, using a Node.js SDK, you might call client.createTransaction(payload, [approver1, approver2]). The SDK handles the secure communication between the parties' secret shares. It's essential to implement proper error handling for scenarios like insufficient approvals, policy violations, or network timeouts. All transaction attempts, approvals, and policy changes should be logged to an immutable audit trail, which is often provided as a feature by the custody platform.

A crucial architectural decision is key backup and recovery. Unlike traditional multi-sig, where losing a private key can permanently lock funds, MPC systems use a Key Derivation Function (KDF) and distributed backup shares. During wallet creation, a set of backup shares is generated and securely distributed, often stored in encrypted form with trusted custodians or in geographically dispersed vaults. Recovery involves a separate administrative process where a threshold of these backup shares is used to regenerate the signing shares for new devices, without ever exposing the original key. This process eliminates single points of failure in key management.

Finally, the solution must be tested rigorously before going live. Conduct tests on a testnet with real-value transactions to validate policy logic, approval workflows, and integration points with your accounting or ERP systems. Perform failure mode testing: simulate device loss, network partitions, and policy update scenarios. Continuous monitoring is also vital; set up alerts for policy breaches, large pending transactions, and failed signing attempts. By combining a reputable MPC provider with carefully designed policies and thorough operational procedures, you can deploy a treasury custody system that is both highly secure and operationally flexible.

CUSTODY ARCHITECTURE

MPC vs. Multi-Sig: Technical Comparison

A detailed comparison of key technical and operational characteristics between Multi-Party Computation (MPC) wallets and traditional multi-signature (multi-sig) wallets for treasury management.

Feature / MetricMPC WalletsTraditional Multi-Sig

Key Management Model

Distributed Key Shares

Distributed Private Keys

On-Chain Signature Footprint

Single ECDSA/EdDSA Signature

Multiple Signatures (e.g., 2/3)

Transaction Gas Cost

Standard single-tx cost

2-3x higher (multiple signatures)

Signing Latency

< 2 seconds

30+ seconds (sequential signing)

Upgrade/Recovery Flexibility

Non-custodial, off-chain protocol

Requires new on-chain smart contract

Resistance to Single-Point Failure

Resistance to On-Chain Logic Exploits

Typical Implementation

Fireblocks, Qredo, Safeheron

Gnosis Safe, DAO modules

key-generation-ceremony
FOUNDATIONAL SETUP

Step 1: Distributed Key Generation (DKG) Ceremony

The DKG ceremony is the secure, multi-party process that generates the cryptographic key shares for your MPC wallet without ever creating a single point of failure.

A Distributed Key Generation (DKG) ceremony is the foundational cryptographic protocol that initializes a Multi-Party Computation (MPC) wallet. Unlike traditional wallets where a single private key is generated on one device, DKG involves multiple independent parties (or nodes) collaboratively creating a shared public key and corresponding secret key shares. Crucially, the full private key is never assembled in one location. Each participant holds a unique share, and the actual signing key exists only as a virtual construct computed during operations. This eliminates the single point of failure inherent in seed phrases or hardware wallets.

The ceremony typically follows a threshold scheme, like Shamir's Secret Sharing or protocols based on Paillier encryption. In a common (t-of-n) setup, n participants generate shares, and any subset of t (the threshold) can collaborate to sign a transaction, while any group smaller than t learns nothing about the key. For a corporate treasury, participants could be executives, department heads, or dedicated security officers using isolated devices. The process involves several rounds of communication where parties exchange encrypted messages to compute the joint public key and their individual secret shares, ensuring no single party can bias or know the final key.

Implementing a DKG requires careful coordination and secure infrastructure. Each participant runs a client—often a CLI tool or library like ZenGo's Multi-Party ECDSA or TSS-lib—on a hardened machine. The steps generally are: 1) Setup and Parameter Agreement, where all parties agree on the elliptic curve (e.g., secp256k1 for Ethereum) and threshold parameters. 2) Share Generation and Exchange, where each party generates polynomial commitments and secret shares, distributing them securely via encrypted peer-to-peer channels or through a coordinator. 3) Verification and Complaint Resolution, where parties verify the consistency of received shares, raising disputes if malformed shares are detected.

Security during the ceremony is paramount. All communication must be authenticated and encrypted (using TLS or similar). Participants should use air-gapped or highly secure machines to run the client software. The environment must be free from malware that could leak shares. Many implementations use a trusted dealer to bootstrap the process, but dealerless protocols are preferred for higher security, as they remove the need for any single trusted entity. Auditing the process via logs and generating a public transcript of the ceremony can provide verifiable proof of its correct execution for stakeholders and auditors.

After a successful DKG, each participant securely stores their key share. The joint public address, derived from the shared public key, becomes the treasury's wallet address for receiving funds. The secret shares are then used in subsequent threshold signing ceremonies when transactions need approval. It's critical to establish a robust key share backup and rotation policy immediately after generation. Losing more than n-t shares makes the wallet irrecoverable, while periodic proactive secret sharing can refresh shares without changing the public address, mitigating the risk of share compromise over time.

signing-workflow
IMPLEMENTATION

Step 2: Building the Transaction Signing Workflow

This section details the core logic for creating, approving, and executing transactions using a Multi-Party Computation (MPC) wallet, focusing on the developer workflow.

The transaction workflow is the operational core of your treasury custody solution. It defines the process from transaction creation to on-chain execution, governed by your predefined approval policy. A typical flow involves three key stages: drafting a transaction object, collecting signatures from authorized approvers via the MPC network, and finally broadcasting the signed transaction to the blockchain. This process ensures no single party holds a complete private key, enforcing security through distributed trust.

Start by constructing the raw transaction payload. This includes the target to address, value in wei, data for contract interactions, and the chainId. For EVM chains, you can use libraries like Ethers.js or Viem. The payload must then be submitted to your MPC provider's API to create a pending transaction. For example, using the Fireblocks SDK, you would call createTransaction() which returns a unique transaction ID for tracking through the approval flow.

The approval flow is managed by your MPC provider according to your vault's policy (e.g., 2-of-3 signatures). When a draft transaction is created, the provider notifies the required approvers, typically through its web interface or API callbacks. Each approver reviews the transaction details—recipient, amount, contract call—and provides their partial signature. The MPC algorithm combines these shares without reconstructing the full private key. You can poll the transaction status via an endpoint like getTransactionById() to see if it has moved from PENDING_APPROVAL to APPROVED or SIGNING.

Once the signature threshold is met, the MPC network generates the final ECDSA signature. Your application must then fetch this signed payload and broadcast it to the public network. Use a standard JSON-RPC call like eth_sendRawTransaction to a node provider (Alchemy, Infura) or a public RPC endpoint. Always monitor the transaction receipt for confirmation. Implement robust error handling for scenarios like insufficient gas, nonce mismatches, or policy rejections to provide clear feedback to users.

For programmatic control, implement webhook listeners. Services like Fireblocks and MPC providers can send HTTP callbacks for status updates (tx_created, tx_signed, tx_broadcast, tx_failed). This allows your backend to automate subsequent steps, update internal databases, or trigger notifications without constant polling. Securely validating these webhook signatures using your provider's public key is critical to prevent spoofing.

Finally, audit and log every step. Record the transaction ID, initiator, approvers, timestamps, and final on-chain hash. This creates an immutable audit trail for compliance and security reviews. Tools like the OpenZeppelin Defender Sentinels can be integrated to add pre-execution policy checks, such as verifying destination addresses against a safe list or setting transaction amount limits, adding an extra layer of programmable security.

approval-integration
IMPLEMENTATION

Step 3: Integrating with DAO Governance

This guide details how to connect your Multi-Party Computation (MPC) treasury wallet to a DAO's governance framework, enabling secure, on-chain proposal execution.

Integrating an MPC wallet with DAO governance transforms it from a secure vault into an active financial instrument. The core challenge is designing a system where a proposal's approval on the governance platform (like Snapshot or Tally) automatically triggers a transaction from the MPC wallet, without manual key management. This requires a dedicated relayer or executor contract that acts as the authorized interface. The MPC wallet signs transactions only when a valid, on-chain proposal execution call originates from this trusted executor, which itself is governed by the DAO's token-weighted votes.

The technical architecture typically involves three components: the DAO governance contract (e.g., OpenZeppelin Governor), the MPC wallet (like Fireblocks, Safe{Wallet} with MPC module, or a custom solution), and a custom executor. The executor holds a whitelisted role within the MPC wallet. When a treasury-related proposal passes, any member can call the execute function on the Governor contract. This function, in turn, calls the executor, which submits the pre-defined transaction payload to the MPC service for signing and broadcast. This creates a secure, non-custodial, and automated flow from vote to execution.

For developers, implementing this means writing and deploying the executor contract. Below is a simplified example of an executor interface using Solidity and a hypothetical MPC service SDK. The key function validates that the caller is the DAO's governor before requesting a signature from the MPC nodes.

solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.19;

import "@openzeppelin/contracts/access/Ownable.sol";

contract MPCExecutor {
    address public immutable daoGovernor;
    address public mpcWalletAddress;

    constructor(address _governor, address _mpcWallet) {
        daoGovernor = _governor;
        mpcWalletAddress = _mpcWallet;
    }

    function executeTransaction(
        address to,
        uint256 value,
        bytes calldata data
    ) external {
        require(msg.sender == daoGovernor, "MPCExecutor: caller is not governor");
        // In practice, this would call an MPC service API (e.g., Fireblocks, Safe{Core})
        // to create and broadcast a transaction signed by the MPC wallet.
        // mpcService.submitTransaction(mpcWalletAddress, to, value, data);
    }
}

Critical security considerations must be addressed. The executor contract becomes a high-value target, so its code must be minimal, audited, and ideally time-locked or subject to a multi-sig for upgrades. You must also configure transaction policies within the MPC service itself, such as defining whitelisted destination addresses (e.g., verified DEX routers, staking contracts) and setting value limits per proposal type. This creates a defense-in-depth strategy: the DAO votes on the action, the executor validates the caller, and the MPC enforces its own security rules before signing.

Finally, test the integration thoroughly on a testnet. Simulate the full governance lifecycle: create a proposal, have token holders vote, execute it via the governor, and verify the MPC wallet broadcasts the transaction. Monitor gas costs for the execution path and consider implementing gasless voting or relayer networks to reduce friction for proposal executors. Successful integration means your DAO can manage its treasury—executing swaps, providing liquidity, or funding grants—with the security of MPC and the legitimacy of on-chain governance.

mpc-provider-tools
DEVELOPER TOOLS

MPC Provider SDKs and Libraries

Integrate secure, non-custodial treasury management using Multi-Party Computation (MPC). These SDKs provide the core cryptographic primitives for key generation, signing, and wallet management.

06

Core Concepts: Threshold ECDSA

Understanding the underlying cryptography is critical for implementation. Threshold ECDSA allows a group of n parties to collaboratively generate an ECDSA signature where any t of them can sign, but fewer than t learn nothing about the private key.

  • Key Generation (DKG): Parties jointly create a public key and secret shares without a dealer.
  • Signing Protocol: A multi-round interactive protocol to produce a valid signature.
  • Security Assumptions: Protocols differ in their trust model (honest majority, malicious majority) and communication rounds.
security-best-practices
SECURITY CONSIDERATIONS AND BEST PRACTICES

How to Implement a Treasury Custody Solution with MPC Wallets

Multi-Party Computation (MPC) wallets offer a robust alternative to traditional multisig for securing treasury assets. This guide outlines the key security considerations and implementation steps for a production-grade MPC custody solution.

Multi-Party Computation (MPC) is a cryptographic technique that distributes the signing key for a wallet across multiple parties or devices. Unlike a traditional multisignature setup, which uses multiple full private keys on-chain, MPC generates a single public address from secret shares held by participants. No single party ever has access to the complete private key, significantly reducing the attack surface from key theft. This makes MPC particularly suitable for DAO treasuries, corporate funds, and institutional custody where distributed trust and transaction policy enforcement are critical. Leading providers include Fireblocks, Qredo, and MPC-native protocols like GG18 and GG20.

The core security of an MPC system depends on its threshold scheme, typically denoted as (t,n). For a 2-of-3 setup, the private key is split into three secret shares, and any two are required to sign a transaction. When selecting a threshold, balance security against operational resilience. A 2-of-3 setup prevents a single point of failure while remaining practical. For higher-value treasuries, consider a 3-of-5 or 4-of-7 configuration. It is crucial that secret shares are generated in a trusted execution environment (TEE) or secure hardware and are never reconstructed in a single location. The security model shifts from protecting a single key to securing the endpoints and the communication channels between them.

Implementing transaction policy is a primary advantage of MPC custody. Policies are programmable rules that must be satisfied before a signature can be generated. Common policies include: - Transaction limits (max amount per day) - Destination allow/deny lists (whitelisted addresses) - Multi-approval workflows with defined roles - Time locks for large transfers. These policies are enforced at the MPC protocol level, not just by client-side software, making them cryptographically guaranteed. For example, you can configure a rule that any transfer over 50 ETH requires approvals from at least one member of the finance team and one member of the operations team.

Endpoint security for the devices or servers holding secret shares is paramount. Each share should be stored in a hardware security module (HSM), a secure enclave (like Intel SGX or Apple Secure Element), or a dedicated hardware wallet acting as an MPC client. Avoid storing shares on general-purpose servers or mobile devices without hardware-grade protection. Regularly rotate cryptographic material and establish a key refresh protocol where secret shares are proactively updated without changing the underlying public address, mitigating potential share leakage over time. Providers like Fireblocks abstract this complexity, but self-custody implementations using libraries like tss-lib must manage it directly.

Integrate your MPC solution with your existing operational stack. Most MPC providers offer APIs for programmatic transaction initiation and policy management. For on-chain DAOs, this can connect to a governance module like OpenZeppelin Governor, where approved proposals automatically create signed transactions. Always conduct a time-locked dry run for any new policy or significant change, sending a zero-value transaction to verify the entire signing flow works before moving real assets. Audit the entire custody workflow, including backup procedures for share recovery and clear protocols for employee offboarding to revoke their access to the signing system.

TREASURY CUSTODY

MPC Implementation FAQ

Frequently asked technical questions for developers implementing Multi-Party Computation (MPC) wallets for on-chain treasury management.

Threshold ECDSA and EdDSA are two common signature schemes used in MPC wallets, each with distinct trade-offs for treasury custody.

Threshold ECDSA is used for signing transactions on EVM-compatible chains like Ethereum, BSC, and Polygon. It is computationally intensive but provides compatibility with the existing ecrecover verification standard. Libraries like tss-lib (based on GG18/GG20 protocols) are commonly used.

Threshold EdDSA (like Ed25519) is used for signing on chains like Solana, Sui, and Aptos. It is faster and simpler than ECDSA but is not compatible with EVM. For a multi-chain treasury, you will likely need to implement support for both schemes.

Key Consideration: Your MPC provider's support for these schemes dictates which blockchains your treasury can interact with natively.

conclusion-next-steps
IMPLEMENTATION SUMMARY

Conclusion and Next Steps

You have now explored the core components for implementing a secure, multi-party computation (MPC) treasury custody solution. This final section consolidates key learnings and outlines practical next steps.

Implementing an MPC wallet for treasury management fundamentally shifts security from a single point of failure to a distributed trust model. The core workflow you've built involves: generating and distributing key shares via a TSS library like tss-lib, establishing a secure communication channel between signers, coordinating signing ceremonies for transaction approval, and finally broadcasting the signed transaction. This architecture ensures no single party ever has access to the complete private key, significantly mitigating insider threats and external attacks like phishing or malware targeting a single secret.

For production deployment, several critical operational considerations must be addressed. First, define and enforce a robust signing policy that mandates M-of-N approvals for transactions above specific thresholds. Second, implement comprehensive key management for share storage, considering Hardware Security Modules (HSMs) or secure enclaves for high-value treasuries. Third, establish clear procedures for share backup and recovery to prevent permanent fund loss, and define a secure protocol for signer rotation to maintain security over time. Tools like Fireblocks, Qredo, and Safeheron offer enterprise-grade platforms that abstract this complexity.

The next logical step is to integrate your custody solution with your broader financial stack. Connect your MPC wallet to DeFi protocols for yield generation, using smart contract allowances to limit exposure. Implement transaction monitoring services from providers like Chainalysis or TRM Labs for compliance and anomaly detection. For DAOs or organizations, connect the signing process to your governance framework, using tools like Snapshot and Zodiac's Reality module to bridge off-chain votes with on-chain execution.

To continue your learning, explore the following resources: the official documentation for MPC libraries (tss-lib, Multi-Party-ECDSA), audit reports of custody providers to understand real-world vulnerabilities, and research papers on advanced cryptographic protocols like GG18 and GG20. Testing your implementation on a testnet with substantial simulated value is a non-negotiable final step before mainnet deployment.

How to Implement MPC Wallets for DAO Treasury Custody | ChainScore Guides