Expand description
Bounded legacy Web3 v3 / x-quais keystore interchange.
Native authenticated full-wallet backups belong to quai-wallet. This format
only protects the private-key ciphertext with its legacy MAC. Optional mnemonic
metadata is accepted only when its derived key matches the decrypted key.
KDFs are synchronous CPU work: use a bounded worker, never an async executor/UI thread.
Modules§
- derive
- Standalone guarded key derivation, independent of encrypted document parsing. Standalone bounded PBKDF2/scrypt utilities with guarded derived output.
Structs§
- Encrypted
Keystore - Encrypted legacy JSON; diagnostics omit ciphertext, identifiers and metadata.
- KdfLimits
- Fixed hostile-input KDF limits; all checked before deriving or allocating work memory.
- Keystore
- Validated, encrypted document. Parsing does no KDF or entropy work.
- Keystore
Account - Decrypted key and optional mnemonic whose derivation was checked against it.
- Verified
Mnemonic - Derivation-verified mnemonic. Legacy format cannot represent a BIP39 passphrase.
Enums§
- Keystore
Error - Sanitized failures never include passwords, keys or mnemonic metadata.
- Password
- Explicit text normalization versus exact password bytes, matching quais.js.
Functions§
- encrypt
- Export a single key using fresh OS/Web Crypto salt, IV and UUID and pinned-JS scrypt defaults. This synchronous operation uses about 128 MiB of scrypt working memory.
- encrypt_
with_ mnemonic - Export a derivation-verified mnemonic with a legacy key. Only the empty BIP39 passphrase is representable; mismatched entropy/language/path fails before KDF. Metadata is not authenticated by this legacy format; import always rederives it.