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
  • Import
  • Methods
  • Create a new key pair
  • Get public key of the key pair in base64 string
  • Get base64 string representation of the key pair
  • Create a key pair from base64 string
  • Get the bytes representation of the key pair
  • Create a key pair from bytes
  1. HOW TO
  2. Silent Shard Duo SDK Example
  3. Client Node
  4. React-Native
  5. Classes

ECDSAP1PartyKeys class

This class is used for current SDK user identity. The core SDK and cloud-node uses to authenticate the user for the two-party MPC actions.

Import

import { ECDSAP1PartyKeys } from '@silencelaboratories/react-native-two-party-ecdsa';

Methods

The all methods are interacted with React-Native's NativeModules and return a Promise that resolves to the result of the operation.

The most string parameters and return values are base64 encoded and prefixed.

Create a new key pair

static async create(): Promise<ECDSAP1PartyKeys>

// Example usage
const keys = await ECDSAP1PartyKeys.create();

Get public key of the key pair in base64 string

async extractPk(): Promise<string>;

// Example usage
const publicKey = await keys.extractPk();
  • This public key is used for generating the user_token's JWT.

Get base64 string representation of the key pair

async toBase64String(): Promise<string>;

// Example usage
const base64Keys = await keys.toBase64String();

Create a key pair from base64 string

static async fromBase64String(base64Keys: string): Promise<ECDSAP1PartyKeys>;

// Example usage
const keys = await ECDSAP1PartyKeys.fromBase64String(base64Keys);

Get the bytes representation of the key pair

async toBytes(): Promise<Uint8Array>;

// Example usage
const bytes = await keys.toBytes();

Create a key pair from bytes

static async fromBytes(bytes: Uint8Array): Promise<ECDSAP1PartyKeys>;

// Example usage
const keys = await ECDSAP1PartyKeys.fromBytes(bytes);

Last updated 1 year ago