You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
backups: the default backup leaves out the NBXplorer database that holds BTCPay hot wallet keys #146
with-bulk-data defaults to false and its description says "Bitcoin blockchain and other bulk data", so an operator who keeps the default expects the backup to hold everything but the chain. It doesn't hold the hot wallet keys. When a BTCPay store creates a hot wallet, BTCPay calls NBXplorer's wallet generation with SavePrivateKeys = isHotWallet (BTCPayServer/Plugins/Wallets/Controllers/UIStoreOnChainWalletsController.cs:295), and NBXplorer stores the mnemonic, the master key and the account key in its PostgreSQL table nbxv1_metadata (NBXplorer/Controllers/DerivationSchemesController.cs:258-264, NBXplorer/Backend/DbConnectionHelper.cs:200). Nothing else on the node has those keys. btcpaydb holds the store settings and the xpub, and /var/lib/nbxplorer holds settings.config and the API cookie.
After a disk loss the restore brings back BTCPay with its stores and invoices, NBXplorer rescans the xpubs, and every hot wallet comes back watch-only. The coins are still on chain but the key that spends them is gone, unless the operator wrote down the recovery phrase when BTCPay showed it once at creation.
Fix: include the nbxplorer database whenever btcpayserver is enabled. It holds the tracked wallets' transactions and UTXOs, so for a merchant node it's megabytes, not bulk data. If size matters, dump only the metadata table (pg_dump -t nbxv1_metadata nbxplorer) by default and keep the full database behind with-bulk-data. The backups test lists the expected archive members at test/tests.py:864 and should also expect var/backup/postgresql/nbxplorer.sql.gz. I can send the PR with the backups scenario run.
Found by DeepSeek V4.1 Flash 1017 (max) in the review of #143's tree, confirmed by Codex (GPT-6 Astra, xhigh), checked by Fable 5.1 against master ae771dc and the current BTCPay and NBXplorer sources.
Activity
backups: always include the nbxplorer database
backups: always include the nbxplorer database (bitcoinix#223)