Expand description
BIP39/BIP32 derivation, encrypted seed backups, selection and optional native storage. Bounded watch-only discovery relies on explicitly tagged node observations. No verified chain-proof recovery or complete reorg engine is implemented.
Secret-owning wrappers redact diagnostics and do not implement Clone,
Display, or generic serialization. Secret exports require explicit access.
Zeroization is best effort; it cannot erase caller copies or guarantee that
cryptographic dependencies/compiler temporaries never retain copies.
Modules§
- account_
custody - Portable account nonce and signed-candidate custody, with bounded public encoding.
- allocation
- Bounded public journal for durable HD address allocation.
- discovery
- Bounded, history-aware watch-only discovery; observations are not chain proofs.
- full_
backup - Portable authenticated wallet-state backups, with optional native capture/restore. Old QUAISEED envelopes remain separate. Plaintext serialization is explicit, bounded and zeroized; no wallet serde is exposed.
- metadata
- Portable immutable public key origins, shared by native and browser wallet state.
- payment_
allocation - Public, bounded payment-code allocation journal. Persist ranges before search and completions before exposure; the browser adapter supplies atomic commits.
- qi_
addresses - Scoped, advisory Qi address inventory and cached usage views. Never allocation authority.
- qi_
custody - Portable Qi input custody. Source observations are explicit and never history proofs.
- qi_keys
- Explicit local Qi key resolution across HD, imported and payment origins.
- storage
- Native SQLite storage primitives, not a scanner or verified reconciliation engine.
- wordlist
- Bounded wordlist utilities and published OWL/OWL-A dictionary decoding. The compression format is documented by quais.js’s MIT-licensed wordlist sources.
Structs§
- Account
Public - An account xpub and explicit origin metadata, suitable for watch-only use.
- Aggregation
Policy - Threshold aggregation policy. Increasing denominations requires the pinned node’s first-Qi-transaction block exception; this selector cannot arrange it.
- Backup
Kdf - Explicit Argon2id v1.3 cost parameters, bounded before any KDF allocation.
- Candidate
Coin - Caller-supplied, validated-index UTXO candidate; this type does not prove on-chain ownership.
- Coin
Selection - Pure selection result; reserving these inputs and fresh output addresses is a separate atomic step.
- Derived
Address - Public derivation metadata; contains no secret key, mnemonic, seed or chain code.
- Encrypted
Seed Backup - Fixed-size authenticated encrypted seed backup; safe to persist as ciphertext. No file I/O or generic wallet serialization is performed by this type.
- Extended
KeyMetadata - Public BIP32 derivation metadata. Sharing chain information reduces wallet privacy. A four-byte fingerprint is a routing hint, not proof of key ownership.
- Extended
Private Key - BIP32 private extended key with redacted diagnostics and a zeroizing scalar.
- Extended
Public Key - Public BIP32 key for nonhardened watch-only derivation. Extended public keys reveal wallet activity; diagnostics omit their value.
- HdWallet
- Wallet root at m/44’/coin’. Derivation is stateless and stores no addresses or mnemonic.
- Mnemonic
- A validated mnemonic stored as word indexes; no passphrase is retained.
- Mnemonic
Entropy - Explicitly exported BIP39 entropy, containing 16, 20, 24, 28 or 32 bytes. The owned buffer zeroizes on drop; diagnostics never expose its contents.
- Reservation
Id - Application-chosen identity of one durable operation, shared by the native store and both custody books. Application-chosen identity of one durable operation, shared by the native store and both custody books. Application-chosen identity of one durable operation, shared by the native store and both custody books. Caller-generated unique 128-bit operation identifier; never reuse, including after release.
- Search
- Explicit search range; returned continuation metadata supports caller-owned checkpoints.
- Search
Result - Successful search and safe continuation information.
- Search
Window - Matching addresses from one
AccountPublic::search_windowcall. - Secret
String - Explicitly exported secret text. Diagnostics redact the text; Drop zeroizes it.
- Seed
- A 64-byte BIP39 seed whose owned buffer is zeroized on drop.
- Seed
Backup - Original seed bytes plus explicit coin and preferred account metadata.
- Selection
Request - Explicit transfer constraints, including the fee budget approved by the caller.
Enums§
- Backup
Error - Backup errors do not reveal input secrets or distinguish corruption from a wrong password.
- Coin
Type - BIP44 coin types from the pinned Quai SDK.
- Grinding
- How a scan derives candidate addresses.
- Language
- All ten BIP39 languages supported by the pinned JavaScript reference. Language to be used for the mnemonic phrase.
- Reservation
State - Application-chosen identity of one durable operation, shared by the native store and both custody books. Application-chosen identity of one durable operation, shared by the native store and both custody books. Application-chosen identity of one durable operation, shared by the native store and both custody books. Durable monotonic operation state.
- Selection
Error - Invalid snapshot, insufficient spendable value, or bounded planning failure.
- Sweep
Mode - Output policy for sweeping or threshold aggregation in a bounded snapshot.
- Wallet
Error - Wallet errors never echo phrases, passphrases, seeds or extended private keys.
- Window
Stop - Why a
SearchWindowended.
Functions§
- denominate_
largest - Fewest largest-first denominations for an exact value, the analogue of the
reference’s uncapped
denominate. - preserves_
denominations - Verify that outputs can split the input inventory without combining smaller input denominations into larger outputs. Output ordering does not affect this capacity check; aggregation requires a separate explicit block-position policy.
- select_
aggregate - Aggregate an ascending stable prefix of eligible small coins; fund the exact fee from other eligible coins, removing the smallest aggregation coins when needed. Fee inputs precede aggregation inputs; their refund denominations are appended after aggregation outputs, matching the reference’s ordering.
- select_
fewest - Match the reference’s fewest-input policy: smallest sufficient single coin, otherwise descending-value greedy inputs. No exponential subset search.
- select_
fewest_ converting select_fewestfor a conversion or a wrapping, whose spend outputs are one Quai-ledger destination the node credits as a single aggregated value.- select_
sweep - Spend eligible, unreserved coins with no change.
request.targetmust be zero; output value is total minus the explicit fee. Exceeding an input bound fails instead of silently leaving coins behind. Aggregation must reduce output count and may need a node capable of arranging first-Qi block placement. AggregateThreshold delegates to select_aggregate and has its own explicit threshold/reduction policy; the other modes spend every eligible coin. - select_
with_ fee - Re-select until the exact selected shape’s quoted fee is covered, never exceeding the authorized maximum. Fees only increase to prevent oscillation; an overestimate can therefore remain paid and is reported in the result. The estimator must price the final input/output shape, including change.