Skip to main content

Restore Wallet from Backup

Minimal Flutter restore flow using BackupService.restore.

Example (PIN unlock)

import 'package:blockchain_kit_sdk_flutter_plugin/blockchain_kit_sdk_flutter_plugin.dart';

final sdk = BlockchainKitSdk();
const groupId = 'YOUR_GROUP_ID';

final strategy = FlutterUnlockStrategy(
'pin',
null, // credentialId
null, // recoveryId
null, // kekId
'123456',
null, // password
);

final result = await sdk.backupService.restore(groupId, strategy, null);

result.fold(
(wallets) {
if (wallets.isEmpty) {
print('Restore succeeded but no wallets returned');
return;
}
print('Restored wallet: ${wallets.first.groupId}');
},
(error) {
print('Restore failed: ${error.message}');
},
);

Switching strategy

  • Passkey-style: use strategy type all_passkeys
  • Password-style: use strategy type password and set password
  • Guardian escrow: use strategy type guardian_gated_escrow_no_gate with recoveryId + kekId