Skip to main content

Enum Definition

enum ThresholdSignatureScheme {
  TWO_OF_TWO = 'TWO_OF_TWO',
  TWO_OF_THREE = 'TWO_OF_THREE',
}

Values

TWO_OF_TWO

  • Description: 2-of-2 threshold signature scheme
  • Parties: 2 total parties
  • Threshold: 2 signatures required
  • Client Threshold: 1 client share
  • Server Threshold: 1 server share
  • Use Case: High security, requires all parties to sign

TWO_OF_THREE

  • Description: 2-of-3 threshold signature scheme
  • Parties: 3 total parties
  • Threshold: 2 signatures required
  • Client Threshold: 2 client shares
  • Server Threshold: 1 server share
  • Use Case: Balanced security and availability

Example

import { ThresholdSignatureScheme } from '@dynamic-labs-wallet/node';

// Create a wallet with 2-of-3 threshold
const wallet = await client.createWalletAccount({
  thresholdSignatureScheme: ThresholdSignatureScheme.TWO_OF_THREE,
  password: 'my-password'
});

// Check the threshold scheme
if (wallet.thresholdSignatureScheme === ThresholdSignatureScheme.TWO_OF_THREE) {
  console.log('Wallet uses 2-of-3 threshold scheme');
}

Configuration

Each threshold signature scheme has specific configuration:
const MPC_CONFIG = {
  [ThresholdSignatureScheme.TWO_OF_TWO]: {
    numberOfParties: 2,
    threshold: 2,
    clientThreshold: 1,
    dynamicServerThreshold: 1,
  },
  [ThresholdSignatureScheme.TWO_OF_THREE]: {
    numberOfParties: 3,
    threshold: 2,
    clientThreshold: 2,
    dynamicServerThreshold: 1,
  },
};