BTCPay Server
Bitcoin Accounting
BTCPay Server + Clams
xPub LNC RuneBTCPay Server is a self-hosted Bitcoin payment processor used by merchants worldwide. Clams tracks your BTCPay payments on-chain using the store's xPub, and Lightning payments via LND or Core Lightning. Full payment history with accurate cost basis for merchant accounting.
What Clams tracks
On-chain (xPub)
- All addresses from your store wallet
- Incoming customer payments
- Individual UTXOs with cost basis
- Transaction fees paid
- Capital gains on each spend
Lightning (LND or Core Lightning)
- Channel opens and closes with on-chain fees
- Lightning invoices and payments
- Routing fee income from forwarded payments
- On-chain funding transactions
- Automatic cost basis tracking per transaction
How it works
On-chain tracking
Export xPub from BTCPay Server
In BTCPay Server, go to Store > Wallets > On-Chain settings to find your xPub.
Add connection in Clams
Create an xPub connection with the Clams CLI. Replace the xpub value in the command below with your exported key.
$ clams connections create --label my-btcpay --kind XPub --configuration '{"xpub":"YOUR_XPUB","address_types":["bech32"]}'
Sync payment history
Run the sync command below to discover all addresses and import your full payment history.
$ clams connections sync --label my-btcpay
Generate journal entries
Process your imported transactions into accounting journals with the command below.
$ clams journals process
Lightning tracking
Generate read-only credentials
For LND, create an LNC pairing phrase. For Core Lightning, generate a read-only Rune.
Add connection in Clams
Create a connection for your Lightning node with the Clams CLI. Choose the LND or Core Lightning command below based on your node type.
$ clams connections create --label my-btcpay-lnd --kind Lnd --configuration '{"transport":"lnc","config":{"pairing_phrase":"YOUR_PAIRING_PHRASE"}}'
$ clams connections create --label my-btcpay-cln --kind CoreLn --configuration '{"transport":"commando","config":{"address":"PUBKEY@HOST:9735","rune":"YOUR_RUNE"}}'
Sync Lightning activity
Run the sync command below to import channels, invoices, payments, and routing fees.
$ clams connections sync --label my-btcpay-lnd
Generate journal entries
Process your imported transactions into accounting journals with the command below.
$ clams journals process
Frequently asked questions
What data does Clams import from BTCPay Server?
Clams imports all addresses derived from your store's xPub, incoming payments, UTXOs, and calculates cost basis per transaction. Your private keys stay in BTCPay Server.
Does Clams access my private keys?
No. Clams uses watch-only access via xPub. Your private keys remain secure in BTCPay Server. The xPub only allows Clams to view addresses and transactions, not spend funds.
Can I track multiple BTCPay Server stores?
Yes. Add each store's xPub separately in Clams. Each store gets independent tracking and reporting.
Does BTCPay Server support Lightning?
Yes. BTCPay Server supports Lightning via LND or Core Lightning. Connect your Lightning node directly to Clams for full tracking of channels, invoices, payments, and routing fees.
How do I get capital gains reports from my BTCPay Server payments?
Export your store's xPub from BTCPay Server and add it to Clams. Clams calculates cost basis for every payment and tracks capital gains when you spend. Export reports from the Exports widget.
Where do I find my xPub in BTCPay Server?
In BTCPay Server, go to your Store settings, then Wallets, then On-Chain. Click on the wallet and view the wallet settings to see the xPub.
Start tracking your BTCPay Server payments
Install Clams and connect your store in minutes.