Overview
TheWallet is the central entry point for using Bark as an Ark client. This guide shows you how to create and configure a wallet using the Rust API.
Prerequisites
Before creating a wallet, you’ll need:- A BIP39 mnemonic (12 or 24 words) for deterministic key derivation
- A database implementation (e.g.,
SqliteClient) - Network configuration (Bitcoin, Signet, Regtest)
- Ark server connection details
Creating a New Wallet
Basic Wallet Creation
Create an offchain-only wallet without onchain capabilities:Wallet with Onchain Support
For full functionality including boarding and unilateral exits, create a wallet with onchain support:Opening an Existing Wallet
Restore a previously created wallet using the stored mnemonic:Opening with Onchain Support
Configuration Options
TheConfig struct controls wallet behavior:
Wallet Properties
Retrieve wallet metadata:Key Derivation
Bark uses BIP32 hierarchical deterministic key derivation:- Derivation path:
m/350'/0'/[index]for VTXO keys - Mailbox key:
m/350'/1'for receiving payments
Best Practices
Handle server pubkey changes
The wallet stores the server’s public key on first connection. If it changes, users must exit their VTXOs:
Error Handling
Common wallet creation errors:Next Steps
Boarding Funds
Move Bitcoin from onchain to Ark
Receiving Payments
Generate addresses and receive Ark payments