Skip to main content

Modules


Classes

Interfaces

Type Aliases

Action

Ƭ Action: keyof typeof Actions

Noalias


Algorithm

Ƭ Algorithm: keyof typeof Algorithms

Noalias


EcdsaFinishPreSignConfig

Ƭ EcdsaFinishPreSignConfig: Object

Config object for compute ECDSA pre-sign.

Type declaration

NameTypeDescription
derivationPath?stringThe BIP-32 non-hardened derivation path to use for signing msgHash. Defaults to 'm'
messageHashstringThe hex encoded message hash to sign.
preSignB64string-

EcdsaImportConfig

Ƭ EcdsaImportConfig: Object

Config object for ECDSA key import.

Type declaration

NameTypeDescription
privateKeystringThe hex encoded ECDSA private key.
rootChainCode?stringThe hex encoded BIP32 root chain code, if you don't have one generate random 32 byte.

EcdsaKeyExportConfig

Ƭ EcdsaKeyExportConfig: Object

Config object for ECDSA key export. Encryption algorithm details: NaCl crypto_box with ChaCha20 stream cipher.

  • Key Exchange: X25519
  • Encryption: XChaCha20
  • Authentication: Poly1305

Type declaration

NameTypeDescription
client_secret_keystringClient X25519 private key to perform Key Exchange for a common symmetric CHACHA key
encrypted_server_sharestringEncrypted server keyshare. (XChaCha20-Poly1305 ciphertext)
keyshareKeyshareThe client-side keyshare.
server_public_keystringServer X25519 public key to perform Key Exchange for a common symmetric CHACHA key

EcdsaPreSignConfig

Ƭ EcdsaPreSignConfig: Object

Config object for compute ECDSA pre-sign.

Type declaration

NameTypeDescription
keyshareec.KeyshareThe Ecdsa keyshare object to sign the message hash.

EcdsaSignConfig

Ƭ EcdsaSignConfig: Object

Config object for ECDSA sign.

Type declaration

NameTypeDescription
derivationPath?stringThe BIP-32 non-hardened derivation path to use for signing msgHash. Defaults to 'm'
keyshareec.KeyshareThe Ecdsa keyshare object to sign the message hash.
messageHashstringThe hex encoded message hash to sign.

EcdsaVerifyBackupConfig

Ƭ EcdsaVerifyBackupConfig: Object

Config object for ECDSA key verify backup.

Type declaration

NameTypeDescription
backupstringVerifiable encrypted backup of the server's keyshare as base64 string. Using RSA-based verifiable encryption.
keyshareKeyshareThe client-side keyshare.
labelstringLabel used while performing encryption of the server's keyshare. The label is required while decrypting the backup.
rsa_public_pemstringRSA public key in PEM format

EddsaBackupVerifyConfig

Ƭ EddsaBackupVerifyConfig: Object

Parameters for EdDSA key verify backup.

Type declaration

NameTypeDescription
backupstringVerifiable encrypted backup of the server's keyshare as base64 string. Using RSA-based verifiable encryption.
keyshareKeyshareThe client-side keyshare.
labelstringLabel used while performing encryption of the server's keyshare. The label is required while decrypting the backup.
rsa_public_pemstringRSA public key in PEM format

EddsaFinishPreSignConfig

Ƭ EddsaFinishPreSignConfig: Object

Config object for compute EdDSA pre-sign.

Type declaration

NameTypeDescription
messageHashstringThe hex encoded message hash to sign.
preSignB64string-

EddsaImportConfig

Ƭ EddsaImportConfig: Object

Config object for EdDSA key import.

Type declaration

NameTypeDescription
privateKeystringThe hex encoded EdDSA private key.

EddsaKeyExportConfig

Ƭ EddsaKeyExportConfig: Object

Config object for EdDSA key export. Encryption algorithm details: NaCl crypto_box with ChaCha20 stream cipher.

  • Key Exchange: X25519
  • Encryption: XChaCha20
  • Authentication: Poly1305

Type declaration

NameTypeDescription
client_encryption_keyEncryptionKeyThe client-sde encryption key.
encrypted_server_sharestringEncrypted server keyshare. (XChaCha20-Poly1305 ciphertext)
keyshareKeyshareThe client-side keyshare.
server_public_keystringX25519 public key to perform Key Exchange for a common symmetric CHACHA key

EddsaPreSignConfig

Ƭ EddsaPreSignConfig: Object

Config object for compute EdDSA pre-sign.

Type declaration

NameTypeDescription
keyshareed.KeyshareThe EdDSA keyshare object to sign the message hash.

EddsaSignConfig

Ƭ EddsaSignConfig: Object

Config object for EdDSA sign.

Type declaration

NameTypeDescription
keyshareed.KeyshareThe EdDSA keyshare object to sign the message hash.
messageHashstringThe hex encoded message hash to sign.

MpcAlgorithmType

Ƭ MpcAlgorithmType<T, A, B>: T extends "ecdsa" ? A : T extends "eddsa" ? B : never

Type parameters

NameType
Textends Algorithm
AA
BB

MpcProtocol

Ƭ MpcProtocol: keyof typeof MpcProtocols


SessionConfig

Ƭ SessionConfig: Object

Parameters for creating a ECDSA session.

Type declaration

NameTypeDescription
clientCloudWebSocketClientThe cloud client object.
cloudVerifyingKeystringThe hex encoded cloud verifying key (Ed25519 public key).
protocol?MpcProtocolThe MPC protocol to use 2 party or 3 party.

WebSocketOptions

Ƭ WebSocketOptions: { [optionName: string]: any; headers: { [headerName: string]: string; } } | null

Variables

Actions

Const Actions: Object

Noalias

Type declaration

NameType
export"export"
finish"finish"
import-key"import-key"
keygen"keygen"
pre"pre"
recovery"recovery"
refresh"refresh"
sign"sign"

Algorithms

Const Algorithms: Object

Noalias

Type declaration

NameType
ecdsa"ecdsa"
eddsa"eddsa"

MpcProtocols

Const MpcProtocols: Object

Type declaration

NameType
duo"duo"
trio"trio"

Functions

ecdsaKeyExport

ecdsaKeyExport(exportConfig): Promise<string>

Exports a keyshare from the MPC to ECDSA private key.

Parameters

NameTypeDescription
exportConfigEcdsaKeyExportConfigThe configuration for the key export.

Returns

Promise<string>

A promise that resolves to the exported private key in hex.

Throws

Throws if any field in EcdsaKeyExportConfig is missing or undefined


ecdsaVerifyBackup

ecdsaVerifyBackup(backupConfig): Promise<boolean>

Validates that the encrypted backup contains the server keyshare without decryption.

Parameters

NameTypeDescription
backupConfigEcdsaVerifyBackupConfigThe configuration for the verify key backup.

Returns

Promise<boolean>

A promise that backup is verified or not.

Throws

Will throw an error if any of EddsaBackupVerifyConfig is not set.


eddsaKeyExport

eddsaKeyExport(exportConfig): Promise<string>

Exports a keyshare from the MPC to ECDSA private key.

Parameters

NameTypeDescription
exportConfigEddsaKeyExportConfigThe configuration for the key export.

Returns

Promise<string>

A promise that resolves to the exported private key in hex.

Throws

Throws if any field in EddsaKeyExportConfig is missing or undefined


eddsaVerifyBackup

eddsaVerifyBackup(backupConfig): Promise<boolean>

Validates that the encrypted backup contains the server keyshare without decryption.

Parameters

NameTypeDescription
backupConfigEddsaBackupVerifyConfigThe configuration for the verify key backup.

Returns

Promise<boolean>

A promise that backup is verified or not.

Throws

Will throw an error if any of EddsaBackupVerifyConfig is not set.