Mnemonic backups
Every Bark wallet posts the IDs of its VTXOs to a recovery mailbox on the Ark server. Reading that mailbox takes a key derived from the mnemonic. The server itself sees the IDs. A wallet restored from the mnemonic alone first asks the server for every VTXO held by keys derived from the mnemonic. It then reads its mailboxes, checks each VTXO with the server, and rebuilds the spendable off-chain balance. A chain scan recovers the on-chain balance.A wallet restored from the mnemonic gets its Ark balance back only through the Ark server, while a database backup opened with the same mnemonic brings the whole wallet back without it
The mailbox is Bark’s equivalent of a Lightning static channel backup, except that every Bark-based wallet app maintains it automatically. There is nothing to enable and nothing extra for you to store on the user’s behalf.
Show the mnemonic next to the database backup
Show the mnemonic and the continuous backup on the same screen, and say what each one brings back. The mnemonic recovers the balance, with the Ark server’s cooperation. The database backup restores everything without it. If your app has a native on-chain wallet with a mnemonic of its own, pick one of two options:- One mnemonic for both balances: Pass that same mnemonic to Bark when you create the wallet. Bark’s own on-chain wallet derives BIP86 addresses from it. If your native wallet does too, pass it to Bark as a custom on-chain wallet (native bindings only) rather than running two wallets on the same coins.
- Two mnemonics, each labeled: Show Bark’s mnemonic next to the native one and say which balance each one recovers.
Revealing the mnemonic
- Bark SDK
- Barkd
The SDK does not hold the mnemonic for you. Your app generates it, stores it, and reveals it when required.
1
Generate the mnemonic
Call
generateMnemonic and pass the result in when you create the wallet.2
Store it securely
Write the mnemonic to your platform’s secure store, or encrypt it in the browser, preferably with a user password.
3
Offer a reveal screen
Show the words on demand from a settings screen, behind your app’s own authentication.
Continuous backups
In addition to recording the mnemonic, back up the wallet database after every wallet state change. Users then never have to rely on the Ark server for recovery. An up-to-date database backup restores the wallet in full, the whole balance, the payment history, and any in-progress exits, without the server’s involvement. Any good backup solution follows three rules.- Back up on every state change, not on a schedule: Wallet state changes with every board, send, receive, refresh, offboard, and exit. Some of what a backup misses does not come back on a database restore. Recover those VTXOs by ID, or restore from the mnemonic (compare what each restore path brings back).
- Store backups somewhere that outlives the host device: A copy stored on the wallet’s own device disappears with it.
- Encrypt backups with a key derived from the mnemonic: The mnemonic holder can always decrypt, so a restore needs nothing but the mnemonic. The backup grants no access that the mnemonic does not already grant.
- Bark SDK
- Barkd
The SDK persists wallet data through the storage your app provides, so backing it up is your app’s responsibility.
- Mobile and desktop apps: Wallet data lives in the app sandbox. Ship a copy to storage the user controls, such as their platform-native cloud drive, after each state change. Noah, a full-stack React Native wallet, has a mature example of mobile backups for Bark.
- Web apps: The SDK stores wallet data in IndexedDB, which the browser can evict. Ship every change to another secure location and make sure the user has recorded their mnemonic.
How Bark Wallet does it
How Bark Wallet does it
- Mnemonic: Bark Wallet reveals the 12 words behind the eye icon on its Settings page (back up Bark Wallet).
- Continuous backups: On Start9, Bark Wallet snapshots the wallet data on every state change, encrypts each snapshot, and ships it to the targets the user sets through Configure Continuous Backups. On Umbrel and self-hosted installs, its guide points users at umbrelOS backups, bark-backupd, or Litestream (Set up continuous backups).