Installation
1. Configure your package manager
-
Get a NPM token from a Silencelaboratories team.
-
Configure your package manager to use the
@silencelaboratoriesprivate NPM registry.
For npm and yarn v1 users:
- Create a
.npmrcfile in the root of your project and add the following line:
//registry.npmjs.org/:_authToken=${NPM_TOKEN}
For yarn v2 users:
- Create a
.yarnrc.ymlfile 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
2. Install the library
The @silencelaboratories/silent-shard-sdk is the main package that contains the high-level APIs for the MPC operations.
Each signature curve lives behind its own subpath and pulls in only the native package it needs — install just the curve(s) your app uses:
| Curve | Subpath | Native package to install |
|---|---|---|
| ECDSA | /ecdsa | @silencelaboratories/dkls-sdk |
| EdDSA | /eddsa | @silencelaboratories/schnorr-sdk |
| ML-DSA | /mldsa | @silencelaboratories/mldsa-sdk |
# Example: an ECDSA-only app
# Using npm
npm install @silencelaboratories/silent-shard-sdk @silencelaboratories/dkls-sdk
# or using yarn
yarn add @silencelaboratories/silent-shard-sdk @silencelaboratories/dkls-sdk
Requires React Native >= 0.77.
Android
No additional steps are required.
iOS
To run on the iOS platform, install pods before running the application:
cd ios && pod install
For Expo users:
For the current version of libraries, doesn't support Expo Go projects.
However, Expo users can use the Expo prebuild to extract native modules. Then auto-link should handle the linking of the native dependencies.
Usage
Curve APIs are reached only through their subpath. The package root exports the shared core (clients, storage, common types) — never curve code.
// ECDSA
import { createEcdsaDuoSession } from '@silencelaboratories/silent-shard-sdk/ecdsa';
// EdDSA
import { createEddsaDuoSession } from '@silencelaboratories/silent-shard-sdk/eddsa';
// ML-DSA
import { createMldsaDuoSession } from '@silencelaboratories/silent-shard-sdk/mldsa';
// Shared core
import { CloudWebSocketClient } from '@silencelaboratories/silent-shard-sdk';
Migrating to v3
v3 is a breaking change. The package root no longer re-exports curve APIs — importing
createEcdsaDuoSession, EcdsaSession, etc. from @silencelaboratories/silent-shard-sdk
will fail. Move every curve import to its subpath:
- import { createEcdsaDuoSession } from '@silencelaboratories/silent-shard-sdk';
+ import { createEcdsaDuoSession } from '@silencelaboratories/silent-shard-sdk/ecdsa';
Shared symbols (CloudWebSocketClient, StorageClient, MpcProtocol, MldsaLevels, …)
stay on the root import. The benefit: an ECDSA-only app no longer bundles or links the
EdDSA / ML-DSA native modules.