React Native TSS SDK

Access the API references for publicly exported classes and their respective methods.

The library exports three classes:

  • The main class performs and manages all the TSS functionality. P1Tss

  • The two helper classes are (P1PartyKeys and KeyshareP1) are input or output of P1Tss methods.

P1Tss methods

Key generation

static async keygen(
  base64SessionId: string,
  p1Keys: P1PartyKeys,
  apiUrl: string
): Promise<KeyshareP1>
  • Performs key generation with TSS server node

  • Accepts base64SessionId keygen session id in encode base64 string

  • Accepts p1Keys key pair of the party

  • Accepts apiUrl of the TSS server node

Signature

static async signParty(
  base64SessionId: string,
  keyshareP1: KeyshareP1,
  p1Keys: P1PartyKeys,
  base64MessageHash: string,
  chainPath: string = 'm',
  apiUrl: string
): Promise<string>;
  • Generate signature

  • Accepts base64SessionId sign session id in encode base64 string

  • Accepts keyshareP1 key share of the party instance

  • Accepts p1Keys key pair of the party instance

  • Accepts base64MessageHash hash of the message to be signed in encode base64 string

  • Accepts chainPath of the key to be used for signing

  • Accepts apiUrl of the TSS server node

Key refresh

static async refreshKeygen(
  base64SessionId: string,
  p1Keys: P1PartyKeys,
  keyshare: KeyshareP1,
  apiUrl: string
): Promise<KeyshareP1>;
  • Performs key refresh with TSS server node

  • Accepts base64SessionId key-refresh session id in encode base64 string

  • Accepts p1Keys key pair of the P1PartyKeys instance

  • Accepts keyshare keyshare of the KeyshareP1 instance

  • Accepts apiUrl of the TSS server node

P1PartyKeys methods

Create a new key pair

static async create(): Promise<P1PartyKeys>;
  • Create a new key pair

Get base64 string representation of the key pair

async toBase64String(): Promise<string>;

Create a key pair from base64 string

static async fromBase64String(base64Keys: string): Promise<P1PartyKeys>

Get the bytes representation of the key pair

async toBytes(): Promise<Uint8Array>;

Create a key pair from bytes

static async fromBytes(bytes: Uint8Array): Promise<P1PartyKeys>;
  • Accepts bytes of the key pair

Get the signing public key of the key pair

async extractPk(): Promise<string>;

Get

async messageSign(base64Message: string): Promise<string>;
  • Message content in base64 encode string

KeyshareP1 methods

Get public key of the key share

async getPublicKey(): Promise<string>;

Get key id of the key share

async getKeyId(): Promise<string>

Get base64 string representation of the key share

async toBase64String(): Promise<string>;

Create a key share from base64 string

static async fromBase64String(base64Keyshare: string): Promise<KeyshareP1>;
  • Accepts base64Keyshare of the key share

Get the bytes representation of the key share

async toBytes(): Promise<Uint8Array>;

Create a key share from bytes

static async fromBytes(bytes: Uint8Array): Promise<KeyshareP1>;
  • Accepts bytes of the key share

Last updated