Back to Blog

Bitcoin Mining Accounting Guide | On-Chain and Lightning, Every Payout Tracked

· 6 min read

If you're running mining hardware, you already know the accounting is brutal. Pools pay out daily, sometimes more. Payouts may hit different addresses. Each one needs to be valued at the Bitcoin price when you received it. Multiply that across a year, across multiple pools, and you're looking at potentially thousands of transactions that all need proper income recognition and cost basis tracking.

That's just on-chain. A growing number of pools now offer Lightning payouts, adding invoice tracking and settlement complexity on top of already high-volume accounting. Lightning has made payouts faster and cheaper, but it's also made bitcoin mining accounting a multi-layer problem.

The Volume Problem

A holder buys Bitcoin a few times a year and tracks cost basis on those purchases. A miner receives Bitcoin continuously. Every pool payout is an income event valued at the spot price at the moment of receipt. Miss a price, misvalue a payout, and your cost basis is wrong from that point forward. Errors compound across thousands of entries.

Manual tracking doesn't scale here. A miner receiving daily payouts to a single address accumulates 365 taxable income events per year. Run multiple rigs across two or three pools, each paying to different addresses, and that number climbs into the thousands. Add Lightning payouts from pools running nodes, and you're dealing with on-chain transactions and off-chain settlements simultaneously, each with different accounting treatment.

At that volume, per-transaction pricing on hosted accounting platforms gets expensive fast. Clams runs locally or self-hosted on your own infrastructure, with no transaction limits at any tier.

Then there's reconciliation. Pool dashboards report your earnings. Your on-chain wallet shows what arrived. These numbers don't always match. Pool fees, dust thresholds, timing differences between pool accounting periods and on-chain confirmations, and payout method differences (FPPS, PPLNS, PPS+) all create discrepancies that need to be resolved before your books are clean.

Connect Everything in One Place

The first step is getting all your mining transactions into a single accounting system. The workflow is the same regardless of connection type: create a connection, sync it, then process journals.

XPub: the most common setup for on-chain pool payouts. Clams derives every address automatically, so whether your pool rotates payout addresses or you use a single static address, every transaction is captured without manual entry.

clams connections create --label foundry --kind XPub \
  --configuration '{"xpub": "<your-xpub>", "address_types": ["bech32"]}'
clams connections sync --label foundry
clams journals process

Address: if you receive payouts to a few specific addresses and don't want to provide an XPub, you can track just those addresses directly.

clams connections create --label ocean --kind Address \
  --configuration '{"addresses": ["<payout-address-1>", "<payout-address-2>"]}'
clams connections sync --label ocean
clams journals process

Lightning: for pools that pay via Lightning, connect your node directly. Clams syncs your full node history: invoices, payments, forwards, channel opens and closes. If a pool pays you via Lightning, those invoices are pulled from your node alongside your on-chain payout history.

# LND via Lightning Node Connect
clams connections create --label my-lnd --kind Lnd \
  --configuration '{"transport": "lnc", "config": {"pairing_phrase": "<your-pairing-phrase>"}}'
clams connections sync --label my-lnd
clams journals process

# Core Lightning via Rune
clams connections create --label my-cln --kind CoreLn \
  --configuration '{"transport": "commando", "config": {"address": "<pubkey>@<host>:9735", "rune": "<your-rune>"}}'
clams connections sync --label my-cln
clams journals process

CSV import: if you're consolidating data from multiple pools with different export formats, create a mapping for each pool's CSV format and reuse it for every import.

clams connections create --label slushpool --kind Custom --configuration-file slushpool-mapping.json
clams connections import --label slushpool --input-format csv --file pool-payouts.csv
clams journals process

The custom connections guide walks through building a mapping file from scratch, or you can have an LLM generate one from a sample of your CSV.

Multisig is supported natively too. Connect via Descriptor for collaborative custody setups.

Want to sync all your connections at once? Run clams connections sync --all.

Automate Cost Basis Across Every Payout

Once your connections are synced, Clams processes raw transactions into structured double-entry journal entries. Each mining payout is recorded as income at the Bitcoin price on the day it was received, denominated in your chosen fiat currency (19 supported).

Cost basis is calculated automatically using FIFO, LIFO, or HIFO. Your accountant picks the method that fits your situation. When you eventually sell Bitcoin to cover operating costs, the capital gains calculation traces back to the specific payouts being disposed of, with the correct cost basis already assigned.

This matters at mining scale. A single bulk sale of Bitcoin to cover an electricity bill might dispose of hundreds of individual payout lots, each with its own cost basis. Clams handles that calculation across all of them.

Separate Mining Income From Everything Else

Mining revenue doesn't stay in one place. You're moving Bitcoin between wallets, consolidating UTXOs, selling to cover operating costs. Come tax time, mining income needs to be cleanly separated from other activity.

Use transaction tagging to label mining income by pool, by rig, or by entity. Filter reports by tag to isolate mining revenue from non-mining holdings. If you run a multi-entity structure (mining company plus holding company), use separate profiles within the same Clams workspace to keep books fully isolated while managing both from one install.

Books Your Accountant Can Verify

Clams produces four report types: balance sheet, portfolio summary, capital gains, and journal entries. All export as CSV.

For mining operations, the most relevant outputs are journal entries (every payout recorded as a proper double-entry accounting event) and capital gains (for any Bitcoin sold during the period). Journal entries matter especially for audits. An accountant or CFO can fact-check a balance sheet or capital gains report by tracing the numbers back to the underlying journals. Clams also archives the canonical raw transaction data: UTXOs, Lightning invoices, channel events. If an audit occurs, whether internal or external, the full trail from raw data to journal entry to report is there.

Generate reports for any time range: monthly for internal tracking, quarterly for estimated payments, annually for tax filing.

# Capital gains for 2025 tax year
clams reports capital-gains --start 2025-01-01T00:00:00Z --end 2025-12-31T23:59:59Z --format csv --output gains-2025.csv

# Full journal entries export
clams reports journal-entries --format csv --output journals.csv

# Balance sheet
clams reports balance-sheet

Your accountant gets a clean file, not a spreadsheet you assembled by hand. They handle the filing and compliance decisions. Clams produces the numbers they need.

For larger operations that want to automate this entirely, the CLI supports scripted sync and report generation. A cron job that syncs all connections, processes journals, and exports quarterly reports:

clams connections sync --all && clams journals process
clams reports capital-gains --start 2025-04-01T00:00:00Z --end 2025-06-30T23:59:59Z --format csv --output q2-gains.csv

The REST API opens the same workflows to any tool that can make HTTP requests.

Get Started

Bitcoin mining accounting is a volume problem layered on a complexity problem. On-chain payouts, Lightning settlements, multiple pools, multiple entities. The transactions pile up fast, and each one carries a cost basis that matters when you sell.

Clams handles both layers. Connect your wallets and nodes. Sync your history. Get clean books without rebuilding your accounting from scratch every quarter.

Install Clams and connect your first mining wallet in under five minutes. For larger operations, enterprise licensing is available.

Questions? Reach out at hello@clams.tech.

Clams Team

Stay in the loop

Get updates on new features and guides delivered to your inbox.