Skip to main content
Platform

Quick Start

Set up the Mobile SDK and run your first MPC operations. You will create a working MPC three-party setup, where the first party, a React Native mobile application, interacts with the two Trio nodes as the second and third parties. 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: trio-server.demo.silencelaboratories.com
  • Cloud Verifying Key: 019c4c79e942bbc3ff1d6ace7256404d701498056978cc4638c35832acdf821b1e

As a shared demo server, it offers no rate-limit or uptime guarantees, and keyshares stored on it may be purged without notice. It is intended for evaluation and testing, not for production use.

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.

If you don't have NPM token, please contact us at [email protected].

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
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 { createEcdsaTrioSession } from "@silencelaboratories/silent-shard-sdk/ecdsa";

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

const session = await createEcdsaTrioSession({
cloudVerifyingKey: "019c4c79e942bbc3ff1d6ace7256404d701498056978cc4638c35832acdf821b1e",
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 { createEcdsaTrioSession } 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 (Trio Servers host). The single demo host
// fronts both Trio servers. 2nd arg: secure flag — true => wss:// (TLS), false => ws://.
const cloudClient = new CloudWebSocketClient('trio-server.demo.silencelaboratories.com', true);
const session = await createEcdsaTrioSession({
// The servers' public signing key, used to verify messages from the server parties.
cloudVerifyingKey: '019c4c79e942bbc3ff1d6ace7256404d701498056978cc4638c35832acdf821b1e',
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, so you can generate a keyshare and sign without deploying anything. To run your own Trio nodes in production, see Trio Server.