Introduction
TheWallet struct is the central entry point for using Bark as an Ark client. It encapsulates the complete Ark implementation including address generation, boarding onchain funds, sending/receiving payments, and managing VTXOs.
Architecture
The Wallet provides:- Address Management: Derive and peek deterministic Ark addresses
- Funds Lifecycle: Board from onchain, send Ark payments, offboard to onchain
- VTXO Management: Query, select, and refresh virtual UTXOs
- Synchronization: Sync with Ark server and onchain sources
- Exit Subsystem: Unilateral exits without server cooperation
Key Components
Wallet Struct
Core wallet structure and creation methods
Boarding Methods
Bring onchain funds into Ark
Payment Methods
Send and receive Ark payments
Exit Methods
Unilateral exits and offboarding
Quick Example
Construction Patterns
Wallets can be created in several ways depending on your needs:Basic Wallet (Offchain Only)
With Onchain Support
State Management
The Wallet maintains several types of state:- VTXOs: Virtual UTXOs in various states (spendable, locked, pending)
- Movements: Transaction history and fund movements
- Rounds: Participation in Ark rounds
- Exits: Unilateral exit status
Persistence
All wallet state is persisted through theBarkPersister trait. The SDK includes a SQLite implementation:
Next Steps
Create a Wallet
Learn about wallet creation and configuration
Board Funds
Bring Bitcoin onchain into Ark