Title: [Bitcoin-qt] When exporting txns to csv, ledger doesn't match wallet balance. Post by: DeathAndTaxes on August 23, 2014, 04:07:48 PM I used the export to csv functionality in bitcoin-qt to export txns from wallet for reconciliation of accounting ledger.
Here is a subset which shows the types of entries. The values have been replaced with placeholders to protect the details of the actual transactions. Code: Confirmed Date Type Address Amount TxId Since the export has the value of all "inbound" txns and "outbound" txns the sum of the amount column should equal the current balance shown in the client (i.e new wallet "receives" 100 BTC, "spends" 20 BTC and 30 BTC would have a "balance" of 50 BTC. The ledger would show +100, -30, -20 in the amount column. The sum of the ledger would also be 50 BTC). This isn't the case when I did an export. There is a difference of about 1% between the current "balance" in the client (sum of UTXO) and the sum of the amount column in the ledger. So why don't the numbers match? I figured there was a simple reason and five hours later I can't come up with a rational explanation. The number "should" match so even a discrepancy of 1 satoshi would bother me. Here are some potential explanations for the discrepancy but they turned out to be dead ends.
Title: Re: [Bitcoin-qt] When exporting txns to csv, ledger doesn't match wallet balance. Post by: DeathAndTaxes on August 24, 2014, 07:12:17 PM A bump. Any ideas? It would be important from an audit and accounting standpoint for the export to always produce the current "balance" of the wallet. I would imagine no accountant or IRS auditor is going to use the blockchain directly.
Title: Re: [Bitcoin-qt] When exporting txns to csv, ledger doesn't match wallet balance. Post by: DannyHamilton on August 24, 2014, 07:25:06 PM Figuring this out is probably going to require an analysis of your data that involves sharing more information than you want to share publicly.
I just tried it with a few of my Bitcoin Core wallets, and the sum of the amount column exactly matches my wallet balance on each of them. Clearly there is something different about the wallet you are looking at, but whatever it is, I haven't encountered it yet in any of the wallets I checked. A quick thought I just had while typing this... None of the wallets I tried it with include a multi-sig address (native or P2SH). Does your wallet include payments sent to (or received at) any multi-sig addresses? If so, perhaps the Export isn't handling that properly? Title: Re: [Bitcoin-qt] When exporting txns to csv, ledger doesn't match wallet balance. Post by: Fantastory on August 03, 2020, 09:33:51 AM I have the same issue.
Summary on exported data for the 2020-08-01 misses about 40% of balance. The wallet is 5 years old. It must be something more than "Payment to yourself" records since i removed them manualy. Any way I think it would be a good idea to change amount to 0 on "Payment to yourself" lines. Address column for those record is empty - only transaction id and date are filled. Title: Re: [Bitcoin-qt] When exporting txns to csv, ledger doesn't match wallet balance. Post by: Fantastory on August 03, 2020, 10:05:38 AM I found that I have many unconfirmed transactions from years ago.
Probably those transactions are dropped. I fix the report by adding 3 additional columns H =IF(A2,IF(C2="Payment to yourself",0,1),0) I =I3+H2*F2 J =J1-H2*F2 And filling J1 with current balance. Now summary differs only by 0.001% I thought it is because of rounding on calculations (it is libre office) so I multiplied all amounts by 100000000. But still the is the same difference. Title: Re: [Bitcoin-qt] When exporting txns to csv, ledger doesn't match wallet balance. Post by: HCP on August 03, 2020, 10:50:03 PM I think it would be a good idea to change amount to 0 on "Payment to yourself" lines. Why? ??? The amount in a "Payment to yourself" line is due to transaction fees being spent and is going to result in a (small) reduction to your overall balance... unless you somehow paid a fee of zero satoshis!!?! ::)If you did indeed change all those values to zero, that is most likely why your spreadsheet value will be incorrect... as you're effectively ignoring any reduction in your balance due to transaction fees for those transactions. |