Skip to main content

Eddsa Keyshare Object

Keyshare class represents a EdDSA Keyshare. This class hold memory pointer to the keyshare in the sdk and handle various useful operations on the keyshare.


Import

main.dart
import 'package:duo_schnorr_flutter/duo_schnorr_flutter.dart' as schnorr;

// Then you can use it as
schnorr.Keyshare;

Usage

main.dart
  // Get public key and key id from keyshare
final publicKey = await keyshare.publicKeyB64();
final publicKeyHex = await keyshare.publicKeyHex();
final keyId = await keyshare.id;

// Get keyshare bytes
final keyshareBytes = await keyshare.toBytes();

// Recreate keyshare from keyshare bytes
final keyshareFromBytes = await schnorr.Keyshare.fromBytes(data: keyshareBytes);


Properties

id

String *id**

ID of the keyshare in base64


publicKeyBase64

String publicKeyBase64

Public key of the keyshare in base64 format

Accessors

publicKeyHex

String publicKeyHex

Public key of the keyshare in hex format


handle

int handle

Handle of keyshare in int


Methods

deriveChildPublicKeyHex()

String deriveChildPublicKeyHex(derivationPath)

Derive child public key from keyshare in hex

Parameters

String derivationPath

BIP 32 derivation path

Returns

String

Derived public key (string hex encode)


deriveChildPublicKeyBase64()

String deriveChildPublicKeyBase64(derivationPath)

Derive child public key from keyshare in base64

Parameters

String derivationPath:

BIP 32 derivation path

Returns

String

Derived public key (string base64 encode)


free()

void free()

Free up the native memory allocated for the keyshare

Returns

void


toBytes()

Uint8List toBytes()

Get the keyshare in bytes

Returns

Uint8List

Keyshare in bytes format


fromBytes()

Keyshare.fromBytes(bytes)

Create a Keyshare instance from bytes

Parameters

Iterable<int> bytes

base64 encoded string of the keyshare

Returns

Keyshare

Keyshare instance