EddsaSession class
The EddsaSession class offers APIs that facilitate easy access to Multi-Party Computation (MPC) functionalities.
Import
import 'package:silent_shard_sdk/silent_shard_sdk.dart' as sdk;
Usage
final cloudClient = sdk.CloudClient(
baseUri: nodeUri,
isSecure: false,
webSocketClient: SocketExtended(),
);
final sessionConfig = sdk.SessionConfig(
cloudClient: cloudClient,
cloudVerifyingKeyHex: cloudVerifyingKey,
protocol: sdk.Protocol.duo // Or use sdk.Protocol.trio for trio
);
await schnorr.init();
final session = sdk.EddsaSession(sessionConfig);
Keygen
final keyshare = await session.keygen();
Key refresh
final refreshedKeyshare = await session.refresh(keyshare: keyshare);
Signature generation
final signature = await session.sign(keyshare: keyshare, messageHash: messageHash);
Constructors
- EddsaSession(SessionConfig config)
- Creates a new EdDSA Session. SessionConfig config - The configuration for the session.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
export(
{}) → Future< Uint8List> - Exports a keyshare from the MPC to EdDSA private key. (Only trio)
-
import(
{required String privateKey, String? rootChainCode}) → Future< SchnorrKeyshare> - Import private key into MPC (client and server) keyshares
-
init(
) → Future< void> - Initialize the schnorr before using core functionalities, recommeneded to use it before any usage of EdDSA.
-
keygen(
) → Future< SchnorrKeyshare> - Generates a new EdDSA keyshare
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
recovery(
{required String publicKey}) → Future< SchnorrKeyshare> - Recover keyshare with public key in hex (only trio)
-
refresh(
{required String keyId}) → Future< SchnorrKeyshare> - Perform EdDSA keyrotation using schnorr.SchnorrKeyshare
-
sign(
{required String keyId, required String messageHash, String derivationPath = 'm'}) → Future< Uint8List> - Signs a message hash with the EdDSA keyshare
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited