@armada/sdk / index / deriveWalletStorageKey
Function: deriveWalletStorageKey()
deriveWalletStorageKey(
viewingPrivateKey):Uint8Array
Defined in: src/storage/encrypted.ts:38
Derive a per-wallet at-rest storage key from the wallet's viewing private key. Used instead of deriveStorageKey at the wallet-persistence boundary because the viewing key is present on EVERY wallet type — including view-only wallets, which have no rootSecret. HKDF ikm may be any length; a distinct info tag keeps this key independent of both the note-ECIES use of the same viewing key and the rootSecret-derived deriveStorageKey. Anyone already holding the viewing key can read the notes directly, so deriving the disk key from it protects exactly the intended threat: a disk-at-rest reader who lacks the wallet's keys.
Parameters
viewingPrivateKey
Uint8Array
Returns
Uint8Array