Guides

Coming from Stronghold

How the API maps to tauri-plugin-stronghold, what behaves differently, and how to move existing data.

The JavaScript API has the same shape as tauri-plugin-stronghold. Most code changes only its imports and class names.

StrongholdThis plugin
Stronghold.load(path, password)KeyringSession.load(path, password)
ClientKeyringClient
StoreKeyringStoreView
VaultKeyringVault
Location.generic / Location.counterthe same
vault.generateSLIP10Seed, deriveSLIP10, recoverBIP39, generateBIP39, getEd25519PublicKey, signEd25519the same
-import { Stronghold } from "@tauri-apps/plugin-stronghold";
-const stronghold = await Stronghold.load(vaultPath, password);
+import { KeyringSession } from "tauri-plugin-keyring-store-api";
+const stronghold = await KeyringSession.load("/wallet/main", "");
 const client = await stronghold.loadClient("main");
 const store = client.getStore();

What behaves differently

StrongholdThis plugin
A snapshot file encrypted with a key derived from the passwordNo file; each record is an OS keyring entry
save() writes the snapshotsave() writes nothing (every write is immediate); it still fails if the session is not loaded
The password decrypts the snapshotThe password is not verified or used
Procedures run in the Stronghold runtimeProcedures run in the plugin's Rust code; outputs are stored in the keyring
Record size limited by memoryPlatform limits, e.g. about 960 bytes per record on Windows
insert(key, value, lifetime) expires recordslifetime is ignored

Procedure results match Stronghold: no procedure returns a private key. generateBIP39 returns the new mnemonic (as UTF-8 bytes) so the user can back it up.

Moving existing data

There is no import from a Stronghold snapshot. Read the data with Stronghold once and write it here:

  • Store records: oldStore.get(key) then keyringStore.insert(key, value) for every key you know.
  • Wallet keys: if you have the mnemonic, call recoverBIP39 into the new vault. Stronghold does not return private keys, so keys without a mnemonic cannot be copied; generate new ones.

After the move, delete the snapshot file.