LogoLogo
Duo SDK
  • Introduction
  • Overview
  • Code Stack
  • HOW TO
    • Silent Shard Duo SDK Example
      • Admin
      • Server Node
      • Client Node
        • React-Native
          • Installing Silent Shard Duo RN SDK
          • Quick start
          • Error handling
          • Hooks
            • useECDSAKeyGen
            • useECDSASignGen
            • useECDSAKeyRefresh
          • Functions
            • keyGenECDSA
            • signGenECDSA
            • keyRefreshECDSA
          • Classes
            • ECDSAP1PartyKeys class
            • ECDSAP1KeyshareV2 class
  • ADVANCED SETUP
    • Low Level API
      • Key Generation
      • Sign
      • Key Rotation
    • MPC + Account Abstraction Kits
      • Biconomy Smart Accounts
        • Quick Start
        • Using the CLI version
        • Experience this in a Biconomy x SL powered DApp
      • Stackup Account Abstraction SDK
        • Quick Start
        • Using the CLI version
        • Experience it in a Stackup x SL powered DApp
      • Resources
        • Structure of the repository
        • Integration and Hosting
  • REFERENCE
    • MetaMask Snap
    • Contact Us
Powered by GitBook
On this page
  • Deployment
  • Environment variables
  1. HOW TO
  2. Silent Shard Duo SDK Example

Server Node

Silent Shard Duo Server SDK Documentation

Last updated 10 months ago

Server Node is the server participant in the 2-party setup. Once the user authenticates with the Admin and obtains a user token user and server can start the key generation phase in order to further sign messages.

To give some intuition about how an MPC action looks like, here's an example of how key generation takes place for ECDSA. The flow is similar for other operations and signing algorithms (EdDSA).

Communication with the Server Node is done with Silent Shard Duo JS SDK.

Deployment

The server is provided as a docker image: rhonstin/sigpair:v2

The sigpair node instance needs a connection to a Postgres Database. The database is used to manage the keyshares and user information.

An example docker-compose file to run the node:

docker-compose.yml
version: '3.1'

services:
  db:
    image: postgres:14
    restart: always
    environment:
      POSTGRES_PASSWORD: YOUR_DB_PWD
      POSTGRES_USER: YOUR_DB_USER
      POSTGRES_DB: YOUR_DB
    ports:
      - 5432:5432

  sigpair:
    image: rhonstin/sigpair:v2
    restart: always
    environment:
      PGHOST: db
      PGUSER: YOUR_DB_USER
      PGDATABASE: YOUR_DB
      PGPASSWORD: YOUR_DB_PWD
      ADMIN_KEY: '64 char (32 bytes) secret hex string'
    ports:
      - 8080:8080
    depends_on:
      - db

Here we use a sample Postgres DB, in a real scenario the company will provide the DB url and credentials.

Environment variables

PGHOST, PGUSER, PGDATABASE, PGPASSWORD are Postgres related variables used to connect to the database.

ADMIN_KEY : This is shared secret between the admin and the node. It MUST be kept secret and managed securely. This is used as the JWT key to verify claims signed by the Sigpair Admin.

Distributed Key Generation