Enum Definition

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

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

THREE_OF_FIVE

  • Description: 3-of-5 threshold signature scheme
  • Parties: 5 total parties
  • Threshold: 3 signatures required
  • Client Threshold: 3 client shares
  • Server Threshold: 2 server shares
  • Use Case: Maximum availability with high security

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,
  },
  [ThresholdSignatureScheme.THREE_OF_FIVE]: {
    numberOfParties: 5,
    threshold: 3,
    clientThreshold: 3,
    dynamicServerThreshold: 2,
  },
};