EcdsaSession
The EcdsaSession
class offers APIs that facilitate easy access to Multi-Party Computation (MPC) functionalities.
Import
import { EcdsaSession } from '@silencelaboratories/silent-shard-sdk';
Constructors
new EcdsaSession()
new EcdsaSession(
config
):EcdsaSession
Creates a new ECDSA Session
Parameters
config
The configuration for the session.
Returns
Methods
export()
export(
config
):Promise
<string
>
Parameters
config
Returns
Promise
<string
>
finishPresign()
finishPresign(
config
):Promise
<string
>
Parameters
config
Returns
Promise
<string
>
import()
import(
config
):Promise
<Keyshare
>
Import private key into MPC (client and server) keyshares
Parameters
config
The configuration for the key import.
Returns
Promise
<Keyshare
>
- Returns a promise that resolves to a refreshed
Keyshare
object.
keygen()
keygen():
Promise
<Keyshare
>
Generates a new Ecdsa keyshare
Returns
Promise
<Keyshare
>
Returns a promise that resolves to a Keyshare
object.
preSign()
preSign(
config
):Promise
<string
>
Compute pre sign with the Ecdsa keyshare
Parameters
config
The configuration for the pre sign.
Returns
Promise
<string
>
- Returns a promise that resolves to a computed presign.
recovery()
recovery(
keysharePublicKey
):Promise
<Keyshare
>
Recover keyshare with public key
Parameters
keysharePublicKey
string
Public in hex format of the existing keyshare object to be recovered.
Returns
Promise
<Keyshare
>
- Returns a promise that resolves to a recovered
Keyshare
object.
refresh()
refresh(
keyshare
):Promise
<Keyshare
>
Refreshes an existing Ecdsa keyshare
Parameters
keyshare
The existing keyshare object to be refreshed.
Returns
Promise
<Keyshare
>
- Returns a promise that resolves to a refreshed
Keyshare
object.
sign()
sign(
config
):Promise
<string
>
Signs a message hash with the Ecdsa keyshare
Parameters
config
The configuration for the signing.
Returns
Promise
<string
>
- Returns a promise that resolves to a signature.