EddsaSession
The EddsaSession
class offers APIs that facilitate easy access to Multi-Party Computation (MPC) functionalities.
Import
import { EddsaSession } from '@silencelaboratories/silent-shard-sdk';
Constructors
new EddsaSession()
new EddsaSession(
config
):EddsaSession
Creates a new EdDSA 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
>
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.
import()
import(
config
):Promise
<Keyshare
>
Import private key into MPC (client and server) keyshares and create a new EdDSA keyshare
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 EdDSA 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 EdDSA 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 EdDSA keyshare
Parameters
config
The configuration for the signing.
Returns
Promise
<string
>
- Returns a promise that resolves to a signature.