Skip to main content
This guide demonstrates how to integrate Sodot’s secure Multi-Party Computation (MPC) technology with the Adamik API, based on our live demo application. By following this implementation, you can leverage a single MPC infrastructure to sign transactions across all Adamik-supported blockchains.

Overview

The sodot-multichain demo showcases how Sodot MPC technology can be combined with Adamik API to:
  • Generate cryptographic keys securely using MPC across multiple parties
  • Sign transactions for 60+ blockchains without exposing private keys
  • Provide institutional-grade security for blockchain operations
The complete source code for this implementation is available in our GitHub repository.

Implementation Architecture

The integration consists of three main components:
  1. Sodot MPC Signer: Handles key generation and transaction signing
  2. Adamik API Client: Manages blockchain interactions (encoding addresses, preparing and broadcasting transactions)
  3. Application Logic: Connects these components in a seamless workflow

Implementing the Sodot Signer

The core of the integration is the SodotSigner class, which implements the BaseSigner interface:
Here’s a simplified implementation based on our demo application:

Integration Workflow

The demo application follows this workflow:
  1. Initialize the Signer: Create a SodotSigner instance for the selected blockchain
  2. Generate Public Key: Call getPubkey() to generate or retrieve the MPC key
  3. Encode Address: Use Adamik API to convert the public key to a blockchain address
  4. Prepare Transaction: Use Adamik API to encode a transaction
  5. Sign Transaction: Use the SodotSigner to sign the encoded transaction
  6. Broadcast Transaction: Send the signed transaction to the network via Adamik API
Here’s how this workflow is implemented in the demo application:

Adamik API Integration

The demo application uses a set of utility functions to interact with the Adamik API. These functions are located in the src/adamik directory:
  • encodePubkeyToAddress.ts: Converts a public key to a blockchain address
  • encodeTransaction.ts: Prepares a transaction for signing
  • broadcastTransaction.ts: Broadcasts a signed transaction to the network
These functions handle the API calls, error handling, and logging, making it easy to integrate with the Sodot MPC signer.

Security Considerations

This demo application uses the Sodot Demo API for demonstration purposes only. For production deployments, it is critical to:
  1. Use Official Sodot Setup: Always work with Sodot through official channels to set up your production MPC infrastructure
  2. Never Use Demo API in Production: The Demo API is for testing and educational purposes only
  3. Follow Security Best Practices:
    • Distributed Key Generation: Keys are generated across multiple parties (vertices)
    • Threshold Signing: Requires multiple parties to collaborate for signing
    • No Private Key Exposure: Private key material is never combined or exposed
    • API Logging: All API calls are logged for audit purposes

Testing the Integration

You can test this integration by:
  1. Visiting the live demo
  2. Cloning the GitHub repository
  3. Setting up your own environment with Sodot MPC and Adamik API

Conclusion

The integration of Sodot MPC with Adamik API provides a powerful solution for secure multi-chain applications. By following the implementation in our demo application, you can leverage this integration to build your own secure blockchain applications. For more details, explore the full source code in our GitHub repository, particularly the src/signers/Sodot.ts file for the MPC implementation and the src/adamik directory for the API integration.