VTXO Management is a new feature in v0.3. It automates the renewal and recovery of virtual coins to prevent expiration and loss of funds.
Overview
VTXOs can be in different states and have an expiration time based on the batch expiry. TheVtxoManager class provides automated management for:
- Renewal: Renew VTXOs before they expire to maintain unilateral control of your funds
- Recovery: Reclaim expired and swept VTXOs back to your wallet
Creating a VTXO Manager
VTXO Renewal
Renew VTXOs before they expire to keep your liquidity available. This settles all VTXOs (including recoverable ones) back to your wallet with a fresh expiration time.Checking Expiring VTXOs
Renewing VTXOs
VTXO Recovery
Recover VTXOs that have been swept by the server or consolidate small amounts (sub-dust).Checking Recoverable Balance
Recovering VTXOs
Best Practices
Automatic Renewal
Automatic Renewal
Implement automatic renewal checks in your application:
Recovery Monitoring
Recovery Monitoring
Periodically check for recoverable funds:
Threshold Configuration
Threshold Configuration
The threshold specifies the remaining portion of a VTXO’s lifetime at which renewal should be triggered. Adjust the threshold percentage based on your needs:
- 10% (default): Good balance between proactive renewal and transaction costs
- 5%: More aggressive, suitable for high-value or frequently active wallets
- 20%: More relaxed, suitable for infrequently used wallets
Complete Example
Here’s a complete example of VTXO management:Next Steps
- Service Worker - Run your wallet in a background service worker
- Expo/React Native - Set up Arkade in React Native applications