- Record the mnemonic (seed phrase): This alone is enough to recover a wallet’s balance, with the Ark server’s cooperation. It can’t restore payment history or the state of any in-progress exits, and it’s also the key that decrypts encrypted continuous backups.
- Maintain a continuous backup of the wallet database: A backup the user fully controls. It restores a wallet in full, payment history and in-progress exits included, without any support from the server.
Seed phrase backups
Every Bark wallet posts a record of its VTXOs to a mailbox on the Ark server that only its mnemonic can unlock. A wallet restored from the mnemonic alone derives its keys, pulls the VTXO record back, verifies every VTXO, then rebuilds the spendable off-chain balance. A chain scan then recovers the on-chain balance. The seed phrase alone is a safety net, but it isn’t a complete backup.- The backup depends on the server to cooperate and respond with the required data.
- It restores the balance, not the payment history or the state of an in-progress exit.
Revealing the seed phrase
- Bark SDK
- Barkd
The SDK does not hold the mnemonic for you by default. You’ll need to ensure your app generates it, stores it, and reveals it when required.
1
Generate the phrase
Call
generateMnemonic and pass the result in when you create the wallet.2
Store it securely
Write the phrase to your app’s secure storage.
3
Offer a reveal screen
Show the words on demand from a settings screen, behind your app’s own authentication.
Continuous backups
To ensure users don’t have to rely on the Ark server for backups, your app should keep backups of the wallet database that update after every wallet state change, in addition to recording the mnemonic. An up-to-date wallet database backup includes all the off-chain transactions that make up a user’s VTXOs. Therefore it will restore the wallet in full: the whole balance, the payment history, and any in-progress exits, all without the Ark 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. Anything a backup misses can only be recovered through the seed phrase mailbox.
- Store backups somewhere that outlives the host device: A copy kept on the wallet’s own device disappears with it.
- Encrypt backups with a key derived from the mnemonic: The seed holder can always decrypt, so a restore needs nothing but the phrase, and the backup grants no access that the seed doesn’t 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.