Key import

Shows how to import existing private key and shard it into 2 keyshares (one on phone and one on cloud node)

Code example:

// First, obtain existing private key in hex string format
final existingPrivateKey = '00112233445566778899aabbccddeeff';

// Create keygen session
final partyKeys = sdk.partyKeys();
final keygenSession = sdk.keygenSession(cloudClient, partyKeys);

// Start import procedure 
// This will uploads keyshare to cloud node and perform key refresh automatically
final keyshare = await keygenSession.import(existingPrivateKey);

print('Imported new key:');
print('\tId: ${keyshare.id}');
print('\tPublic Key: ${keyshare.publicKey}');

Last updated