Threat model and security considerations for Dusk Wallet.
Dusk Wallet is a self-custody wallet — users control their own keys. This document outlines security measures, known limitations, and recommendations.
| Asset | Sensitivity | Storage |
|---|---|---|
| Mnemonic phrase | Critical | Encrypted in vault |
| Private keys | Critical | Derived in-memory from mnemonic |
| Shielded notes | High | IndexedDB (per-network) |
| Contacts | Medium | Platform storage, AES-GCM-256 per wallet; the key is HKDF-SHA-256 over the seed, held by the engine while unlocked |
| dApp permissions | Medium | Platform storage |
| User settings | Low | Platform storage |
- Malicious websites — XSS, phishing, fake dApps
- Browser extensions — Malicious or compromised extensions
- Local attackers — Physical access to device
- Network attackers — MITM, malicious nodes
- Supply chain — Compromised dependencies
@noble/curves and @noble/hashes execute in key derivation and signing paths,
so their direct dependency versions are pinned exactly to make upgrades an
explicit review decision. The lockfile already fixes versions for npm ci;
exact manifest pins also constrain resolution when a lockfile is created or
updated. Pins and integrity checks do not replace dependency review.
| Platform | Algorithm | Parameters |
|---|---|---|
| Extension | PBKDF2 + AES-GCM-256 | 900,000 iterations |
| Tauri | Stronghold + Argon2 | OS-level encrypted storage |
// Extension vault encryption
const key = await crypto.subtle.deriveKey(
{ name: "PBKDF2", salt, iterations: 900000, hash: "SHA-256" },
passwordKey,
{ name: "AES-GCM", length: 256 },
false,
["encrypt", "decrypt"]
);Every recovery phrase on the device is sealed under the same password, each
with its own IV, wallets added with the salt of one already there (dusk_vault_v2, see ARCHITECTURE.md).
Adding a wallet, removing one and changing the password each ask for the
password the wallets were unlocked with, and every change is read back and
checked before it's kept. Nothing
the password doesn't open is changed or removed, except by Reset.
- Every unlocked wallet's mnemonic held in JavaScript heap after unlock, so a switch of wallet needs no password
- All cleared on explicit lock or auto-lock timeout
- Limitation: Cannot guarantee memory zeroization in JavaScript
- Keep PBKDF2 iterations aligned with industry guidance (currently 900,000)
- Keep rate limiting on unlock attempts (exponential backoff)
The wallet automatically locks after a configurable timeout:
| Setting | Options |
|---|---|
| Auto-lock timeout | 1, 5, 15, 30, 60 minutes |
| Default | 5 minutes |
Implementation uses chrome.alarms API for reliable timing even when service worker sleeps.
The last activity timestamp is persisted in extension session storage when available
(falling back to local storage outside extension contexts), so a restarted background
service worker does not immediately lock an otherwise active unlocked wallet.
Settings can ask for the password again on any send above an amount chosen, off by default. It covers everything that moves money out, the wallet's own sends and a site's in its approval window. What counts is what goes out with the most its fee can be; what comes back counts only its fee; and a token's transfer or allowance, or a call of a contract the network's file doesn't name, asks on any amount, as it can't be counted in DUSK.
The background checks the password against the vault, for the wallet that's open, before anything
of the send is made, under the unlock's own backoff: a page's say-so isn't enough. A wallet's own
send carries a ticket the background gave for that send, once; a site's request stays waiting until
its window gives the password. Changing the amount takes the password too. The amount is kept on its
own (dusk_send_password_v1); no provider method reads or changes it, and the background refuses
those messages from anything but the wallet's own pages. The engine answers only the background.
- Each origin must explicitly request connection
- User approves via popup before granting access
- Permissions stored per wallet, then per origin, with the selected profile/account index and grants
- A site connected to one wallet sees nothing of another unless it's connected there too
- A site that disconnects itself is disconnected from every wallet
- A connection can be set to end after 1, 7 or 30 days, for a site or for new sites: past its end the site is as if never connected, and what it had waiting is refused
// Permission record, under its wallet's ID (its first public account)
{
"2Z8m...": {
"https://dapp.example.com": {
profileId: "account:0:...",
accountIndex: 0,
grants: {
publicAccount: true,
shieldedReceiveAddress: false
},
connectedAt: 1706400000000,
updatedAt: 1706400000000,
// Only for one set to end
lastsMs: 604800000,
expiresAt: 1707004800000,
}
}
}The wallet also keeps a record per site (dusk_site_records_v1), for Settings: when it last used its
connection, and what it asked for and how that was answered, with a contract call's function name. Never
an amount, recipient, memo, message, contract or hash. It's bounded (30 requests a site, 50 sites a wallet, what
was approved kept longest), stays once a site is disconnected until it's forgotten, and goes with its wallet or a reset.
No provider method reads it.
| Method | Permission Required | Unlock Required |
|---|---|---|
dusk_getCapabilities |
No | No |
dusk_requestProfiles |
No (grants it) | Yes (prompt) |
dusk_profiles |
Yes (returns [] otherwise) |
Yes (returns [] otherwise) |
dusk_requestShieldedAddress |
No (grants or upgrades it) | Yes (prompt) |
dusk_chainId |
No (null until connected) |
No |
dusk_switchNetwork |
Yes | No |
dusk_getPublicBalance |
Yes | Yes |
dusk_estimateGas |
Yes | No |
dusk_sendTransaction |
Yes | Yes |
dusk_watchAsset |
Yes | Yes |
dusk_signMessage |
Yes | Yes |
dusk_signTypedData |
Yes | Yes |
dusk_signAuth |
Yes | Yes |
dusk_disconnect |
No | No |
dusk_openPaymentLink |
No (a network's own web wallet, its own Send's link, on a press) | No (Send asks to unlock) |
dusk_signMessage and dusk_signAuth sign domain-separated Moonlight memo
envelopes. They are not raw BLS digest-signing methods and must not be used for
on-chain verification against a caller-supplied digest. Raw-digest signing is
tracked in wallet issue #90.
All dusk_sendTransaction calls require explicit user approval via a popup window. Users can:
- Review transaction details
- Adjust gas settings
- Approve or reject
Every approval is for one wallet: the one unlocked when the site asked, or, asked while locked, the one its window shows first. Its window shows no other, and what it approves is granted, signed or sent only while that wallet is the one unlocked. The wallet's own screens act for the wallet they were drawn for: a send goes only from its Review's wallet, profile and network, and a change to a wallet's profile, contacts, tokens or connected sites is refused once another wallet is open.
Manifest V3 enforces strict CSP by default:
- No inline scripts
- No
eval() - No remote code execution
The public repository does not currently include a native Tauri wrapper, so there is no checked-in tauri.conf.json to audit here.
- All node communication over HTTPS
- Users can configure custom node URLs
- No hardcoded API keys or secrets
- Nothing a node serves runs: the wallet core is the copy packaged with the wallet, never w3sper's download from the node
- A node can't name its network: Mainnet, Testnet and Devnet are only the exact addresses in
@dusk-network/networks; anything else is Custom, with its host showing - A node can't choose the chain ID that's signed: a known address's comes from
@dusk-network/networks, a custom node's is read once when it's added and fixed, and w3sper's builders get that one (pinNodeInfoinwalletEngine.js). A node that later answers another chain ID gets no signature - A custom node can answer a
.duskname check with whatever it likes: wherever a name is taken for a payment (Send, Review, a site's approval window, the contact form, a contact's check) the wallet says which node checked it, and its answers are kept apart from those of the network's own node
- Prover receives transaction circuits (no private keys)
- Timeouts prevent hanging connections
- Fallback to node URL if prover fails
- Content scripts run in isolated world
- Cannot access page JavaScript context
- Provider injected via script tag with controlled interface
The in-page postMessage transport is visible to other scripts in the same page.
Its request IDs, wallet routing ID and event.source check do not authenticate a
response against such scripts. The first matching response consumes a request;
changing whether the pending entry is deleted before or after resolving/rejecting its Promise
does not make a later genuine response win. Applications must independently verify
returned signatures, signer identity and expected context; a resolved provider
Promise is not proof of authenticity.
- No DOM access (by design)
- Wallet engine runs in offscreen document
- Message passing with validation
JavaScript does not provide memory zeroization guarantees. Private keys and mnemonic remain in heap memory until garbage collected.
Mitigation: Lock wallet when not in use; rely on OS-level protections.
Users must trust:
- The extension itself (install from official source)
- Other installed extensions (could attempt to steal data)
Mitigation: Keep requested permissions minimal and review host_permissions regularly (broad host access increases blast radius).
Shielded notes are stored in IndexedDB without encryption.
Risk: Local attacker with file system access could read notes.
Mitigation: Consider encrypting IndexedDB contents; rely on OS-level encryption.
Current iteration count is 900,000.
Risk: Brute-force resistance still depends on password strength.
Mitigation: Maintain a high iteration count and monitor guidance for updates.
Dusk uses BLS12-381 signatures, which Ledger/Trezor do not support.
Status: Not possible with current hardware wallet firmware.
- Use a strong, unique password for the wallet
- Write down mnemonic phrase and store securely offline
- Enable auto-lock with short timeout
- Verify transaction details before approving
- Only connect to trusted dApps
- Keep browser and extensions updated
- Never log sensitive data (mnemonic, private keys)
- Validate all message inputs
- Use strict CSP in any native wrapper builds
- Keep dependencies updated
- Run security-focused code review for crypto code
- Immediately transfer funds to a new wallet
- Create new wallet with fresh mnemonic
- Revoke all dApp permissions on compromised wallet
- Uninstall extension immediately
- Assume mnemonic is compromised
- Follow mnemonic compromise steps above
Status: No external audit completed yet.
Recommendation: Before production release, conduct:
- Cryptographic implementation review
- Smart contract interaction audit
- Browser extension security audit
If you discover a security vulnerability, please:
- Do not open a public GitHub issue
- Report it privately through GitHub Security Advisories: https://github.com/dusk-network/wallet/security/advisories/new
- Include detailed reproduction steps
- Allow reasonable time for fix before disclosure