Class: UnlockedSeedBundle

hcSeedBundle.UnlockedSeedBundle(secret, appData)

Represents a seed bundle with access to secret seeds for derivation. WARNING: Before forgetting about an UnlockedKeyBundle instance, you should probably call the `zero` function to clear the internal secret data. HOWEVER, being javascript, there is no guarantee we haven't leaked secret data. You may want to consider using the rust library for seed generation and derivation.

Constructor

new UnlockedSeedBundle(secret, appData)

You should not use this constructor directly. Use one of: - `UnlockedKeyBundle.newRandom(appData)` - `UnlockedKeyBundle.fromLocked(encodedBytes)` WARNING: see class-level note about zeroing / secrets.
Parameters:
Name Type Description
secret PrivSecretBuf parseSecret(Uint8Array)
appData object appData to associate with bundle
Source:

Members

appData :object

any app / user data to provide context for this particular seed
Type:
  • object
Source:

signPubKey :string

the base64 encoded public key associated with this seed
Type:
  • string
Source:

Methods

(static) fromLocked(encodedBytes) → {Array.<LockedSeedCipher>}

Extract the LockedSeedCipher list capable of decrypting an UnlockedSeedBundle from an encrypted SeedBundle. WARNING: see class-level note about zeroing / secrets.
Parameters:
Name Type Description
encodedBytes Uint8Array encoded bytes to decode / decrypt
Source:
Returns:
Type
Array.<LockedSeedCipher>

(static) newRandom(appData) → {UnlockedSeedBundle}

Construct a new completely random root seed with given app / user data. WARNING: see class-level note about zeroing / secrets.
Parameters:
Name Type Description
appData object appData to associate with bundle
Source:
Returns:
Type
UnlockedSeedBundle

derive(subkeyId, appData) → {UnlockedSeedBundle}

Derive a subkey / seed from this seed bundle seed. WARNING: see class-level note about zeroing / secrets.
Parameters:
Name Type Description
subkeyId number derivation subkeyId
appData object appData to associate with subseed bundle
Source:
Returns:
Type
UnlockedSeedBundle

lock(seedCipherList) → {Uint8Array}

Encrypt this seed into seed bundle bytes with given seedCipherList - note, all seedCiphers will be zeroed. WARNING: see class-level note about zeroing / secrets.
Parameters:
Name Type Description
seedCipherList Array.<SeedCipher> list of seed ciphers to encrypt into the bundle
Source:
Returns:
Type
Uint8Array

setAppData(appData)

You may change the app/user data with this function.
Parameters:
Name Type Description
appData object appData to associate with bundle
Source:

zero()

Zero out the internal secret buffers. WARNING: see class-level note about zeroing / secrets.
Source: