Skip to main content
Platform

Quick Start

Set up the Duo SDK and run your first MPC operations. Pick your framework and follow the steps. Each quickstart runs against our hosted demo server, so you can generate a key and sign without deploying anything first.

Set up the Mobile SDK and run your first MPC operations. You will create a working MPC two-party setup, where the first party, a React Native mobile application interacts with Duo Server as a second party. We are providing a demo server endpoint for your convenience.

For quick testing, use our hosted demo server. No deployment is needed.

  • Cloud Node Endpoint: demo-server.silencelaboratories.com
  • Cloud Verifying Key: 01cfa1ff5424d14eb60614d7ddf65a32243d26ddf7000d10007853d7336395efe4

As a shared demo server, it has no rate limits or uptime guarantees, and keyshares stored on it may be cleared at any time. Use it for quick testing only.

Prerequisites

  • Node.js (LTS) and a package manager (npm or Yarn).
  • An NPM token from Silence Laboratories to install the SDK from our private registry. Don't have one? Email [email protected].
  • A running iOS Simulator (Xcode) or Android emulator (Android Studio) to launch the app on.

Setup the Mobile SDK (React Native)

Create a new React Native project

npx create-expo-app@latest SilentMPC --template blank-typescript

Configure Your Package Manager

Configure your package manager with a private token provided by us to access the private registry.

Use a consistent install workflow throughout (either npm install or yarn add). Note that .npmrc configuration applies to both npm and Yarn v1, while Yarn v2+ uses .yarnrc.yml.

  • Create a .yarnrc.yml file in the root of your project and add the following line:
npmScopes:
"silencelaboratories":
npmAlwaysAuth: true
npmRegistryServer: "https://registry.npmjs.org"
npmAuthToken: ${NPM_TOKEN}
  • Add the npm token as an environment variable, e.g., in a terminal session run:
export NPM_TOKEN=your-npm-token

Install the core library

npm install @silencelaboratories/silent-shard-sdk

Install the native SDK(s) for your wallet types

You only need the native SDKs for the wallet families your app actually supports — installing extras only adds bundle size.

Wallet familyAlgorithmNative package
EVM, Bitcoin, etc.ECDSA@silencelaboratories/dkls-sdk
Solana, etc.EdDSA@silencelaboratories/schnorr-sdk
Post-quantum walletsMLDSA@silencelaboratories/mldsa-sdk
npm install @silencelaboratories/dkls-sdk

Project setup

Run the following command to generate the native code for your project:

npx expo prebuild

Session Creation

The Session object is the main entry point to interact with the Silent Shard SDK. It manages the lifecycle of the MPC operations.

import { CloudWebSocketClient } from "@silencelaboratories/silent-shard-sdk";
import { createEcdsaDuoSession } from "@silencelaboratories/silent-shard-sdk/ecdsa";

// Create a session
const cloudClient = new CloudWebSocketClient(
"demo-server.silencelaboratories.com",
true // Use true for secure connection, otherwise use false for local server
);

const session = await createEcdsaDuoSession({
cloudVerifyingKey: "01cfa1ff5424d14eb60614d7ddf65a32243d26ddf7000d10007853d7336395efe4",
client: cloudClient,
});

Run the MPC operations

After creating the session, you can perform MPC operations.

Key Generation

Generate MPC keyshares and return the client keyshare with keygen method.

const clientKeyshare = await session.keygen();
console.log("Client Public Key:", clientKeyshare.publicKeyHex);

Signature Generation

Sign a message using the sign method.

const signature = await session.sign({
keyshare: clientKeyshare,
// Keccak256 Hash("Trusted Third Parties are Security Holes")
messageHash:
"53c48e76b32d4fb862249a81f0fc95da2d3b16bf53771cc03fd512ef5d4e6ed9",
derivationPath: "m",
});
console.log("Generated signature: ", signature);

Complete Code Example

Add the following code to your App.tsx.

App.tsx
import * as React from 'react';
import { CloudWebSocketClient } from '@silencelaboratories/silent-shard-sdk';
import { createEcdsaDuoSession } from '@silencelaboratories/silent-shard-sdk/ecdsa';

export default function App() {
React.useEffect(() => {
// We will MPC functions here
const mpcTest = async () => {
try {
// Create a session.
// 1st arg: the Cloud Node Endpoint (Duo Server host). Here we use the demo server.
// 2nd arg: secure flag — true => wss:// (TLS), false => ws:// (e.g. a local server).
const cloudClient = new CloudWebSocketClient('demo-server.silencelaboratories.com', true);
const session = await createEcdsaDuoSession({
// The server's public signing key, used to verify messages from the server party.
cloudVerifyingKey: '01cfa1ff5424d14eb60614d7ddf65a32243d26ddf7000d10007853d7336395efe4',
client: cloudClient,
});

// Key generation
const clientKeyshare = await session.keygen();

// Get public key of newly generated wallet
console.log('Client Public Key:', clientKeyshare.publicKeyHex);

// Signature generation
const signature = await session.sign({
keyshare: clientKeyshare,
// Keccak256 Hash("Trusted Third Parties are Security Holes")
messageHash: '53c48e76b32d4fb862249a81f0fc95da2d3b16bf53771cc03fd512ef5d4e6ed9',
derivationPath: 'm',
});

console.log('Generated signature: ', signature);
} catch (err) {
console.error('MPC test failed:', err);
}
};
mpcTest();
}, []);

return null;
}

Run your application!

Run your application in a classic way.

Expo Go support is coming soon too!

npm run android

or

npm run ios

Once the application is running, check your console log to see the key generation and signing process updates in real-time.

Happy signing!

The steps above run against our hosted demo server (endpoint and verifying key in Prerequisites), so you can generate a key and sign without deploying anything. To run your own Duo Server in production, see Duo Server.