EcdsaSession
The EcdsaSession class offers APIs that facilitate easy access to Multi-Party Computation (MPC) functionalities.
Import
import { EcdsaSession } from '@silencelaboratories/silent-shard-sdk';
Extends
MpcSession
Properties
name
name:
string
Inherited from
MpcSession.name
protocol
protocol:
"duo"|"trio"
Inherited from
MpcSession.protocol
Methods
export()
export(
config):Promise<string>
Exports the ECDSA keyshare to a Private Key (Hex format).
Parameters
config
Returns
Promise<string>
finishPresign()
finishPresign(
config):Promise<string>
Generate signature (r|s|v) from a pre-sign process with the MPC ECDSA keyshares.
Parameters
config
The configuration for finishing the pre-sign.
Returns
Promise<string>
- A Promise that resolves to a signature (Base64 format).
import()
import(
config,option?):Promise<Keyshare>
Import private key into MPC (client and server) keyshares
Parameters
config
The configuration for the key import.
option?
DKGOption
Optional configuration for the Distributed Key Generation (DKG) process.
Returns
Promise<Keyshare>
- A Promise that resolves to a refreshed
Keyshareobject.
keygen()
keygen(
option?):Promise<Keyshare>
Generates a new MPC ECDSA client and server keyshares. And returns the client keyshare.
Parameters
option?
DKGOption
Optional configuration for the Distributed Key Generation (DKG) process.
Returns
Promise<Keyshare>
A Promise that resolves to a client keyshare.
preSign()
preSign(
config):Promise<string>
Compute pre-sign with the MPC ECDSA keyshares.
Parameters
config
The configuration for the pre-sign.
Returns
Promise<string>
- A Promise that resolves to a computed presign.
reconcile()
reconcile(
keyId):Promise<Keyshare>
Reconcile protocol synchronizes the keyshare state between client and server. After reconciliation, return the keyshare object.
Parameters
keyId
string
The key ID of the keyshare to reconcile.
Returns
Promise<Keyshare>
- A Promise that resolves when the reconciliation is complete.
recovery()
recovery(
keysharePublicKey,option?):Promise<Keyshare>
Recover MPC ECDSA Keyshares with the public key.
Parameters
keysharePublicKey
string
Public in hex format of the existing keyshare object to be recovered.
option?
DKGOption
Optional configuration for the Distributed Key Generation (DKG) process.
Returns
Promise<Keyshare>
- A Promise that resolves to a recovered
Keyshareobject.
refresh()
refresh(
keyshare,option?):Promise<Keyshare>
Refreshes an existing MPC ECDSA keyshares in both client and server. And returns refresh client keyshare.
Parameters
keyshare
The existing client keyshare to be refreshed.
option?
DKGOption
Optional configuration for the Distributed Key Generation (DKG) process.
Returns
Promise<Keyshare>
- A Promise that resolves to a refreshed client keyshare.
sign()
sign(
config):Promise<string>
Generate a signature (r|s|v) with digest(sha256,keccak, ...) using the MPC ECDSA keyshares.
Parameters
config
The configuration for the signing.
Returns
Promise<string>
- A Promise that resolves to a signature (Hex format).