Quick start

Silent Shard Duo React-Native SDK

The quick start guide will help you to quickly start integrating Silent Shard Duo React-Native SDK into your application. You can use either hooks or async functionsat your will.

Let's start!

Note: All MPC related functions functions(key-generation, sign-generation, key-rotation) are WS requests to the cloud node, and to secure the communications, the application needs a userToken and partyKey(ECDSAP1PartyKeys) to authenticate the user.

As a recap, a client user is authenticated to the server node through the admin which issues a JWT for that user. For the issuance of the token the admin needs a public Ed25519 key for that user which is provided by the user as partyKey. Then the user side has to make an HTTP request to the Admin SDK in order to get the token to be further used in MPC operations for authorization purposes. We have an example of user-side code that queries the Admin SDK to create the token. The flow is as follows: The user creates an Ed25519 signing key pair, queries the Admin SDK for token issuance with a createUserToken call, and the Admin SDK creates the token and returns it to the user.

1. Run server node locally

Please refer to this from the Server Node page.

2. Create an application backend

In this guide using bun run time to create a simple HTTP server to serve userToken JWT using Adming-SDK. Bun 1.0.15 higher is required.

Initialize Project

First, run the following command to initialize the HTTP project.

bun init

# Project name    - simple-backend
# Entry point     - index.ts

Install dependencies

Create an HTTP server

Populate an index.ts file in the root directory in the root directory with the following content.

Run HTTP server

If successful in the terminal logs 🦊 Elysia is running at 0.0.0.0:8000

3. Mobile application - quick start

Create a fetch function to get userToken JWT from the backend. We will be using this function to generate userToken before each MPC action.

This part assume, Server node and simple backend are running on local PC

Simple backend running at localhost:8000

Server node running at localhost:8080

Key generation quick start

Using the Hooks

Using async functions

ECDSA Signing quick start

Using the Hooks

Using async functions

Key Rotation quick start

Using the Hooks

Using async functions

Last updated