Announcing the Newest Feature in Faraday: Track Your Sats with Accounting for LND!

September 15, 2020

Today, we’re excited to announce the latest release of Faraday, which now includes full accounting reports to keep track of your sats with lnd. This is the second feature in Faraday’s suite of tools to help routing nodes and businesses run on Lightning.

It’s been great to watch the community build and explore new use cases on the foundation of lnd. From financial services to in-game micropayments, the foundation for a Lightning-powered economy is emerging. As a company building services like Lightning Loop on lnd ourselves, we feel many of the same pain points as our community and we are dedicated to creating tools to help ease the operational burden of running a Lightning-centric business. To reduce this friction, we released the first iteration of Faraday, which gave node operators better insight into their node’s revenue and helped identify non-performant channels.

Today’s release adds accounting to the Faraday suite of tools. Support for full on-chain and off-chain accounting reports for lnd provides node operators and businesses the much-needed ability to audit their nodes. This release was motivated by feedback from businesses building on lnd, and by internal requirements for our Loop lnd node. We have switched over from manually creating our monthly statements to using the reports generated by Faraday, and we hope this release will help other companies using Lightning do the same!

New Accounting for a New Economy

We all know the age-old story of Carol being able to purchase her morning coffee with lightning-fast payments, but we often fail to mention the merchant selling her that daily “blockachino”. Behind the scenes, StarBlocks is opening channels from their node to well-connected peers, closing out channels with unperformant peers, and managing their incoming liquidity so that Carol’s payment will successfully route, using a service such as Lightning Loop or through circular rebalancing.

All of these tasks are part of the operational overhead of transitioning to a Lightning-powered economy. Spending an afternoon at the bank to set up your business’s account is replaced with waiting for your node’s channels to confirm, often opaque credit card fees supplanted by a competitive market for routing fees, and shuffling balances between operational accounts is upgraded to liquidity management.

While the formidable StarBlocks team may have these concepts mastered, their no-coiner accountant is unlikely to understand this new vocabulary, let alone the higher level concepts, and existing reporting solutions often do not account for Lightning-specific expenses such as sweep transactions and circular rebalances. Faraday’s report provides a full account of all of the transactions that lnd has generated, and separates operational expenses out from regular transaction types. The StarBlocks team are freed from hours of uninspiring investigation into the edge cases that inevitably pop up when manually reporting, and spend their time on the rewarding task of building features which utilize the unique utility of Lightning!



trackingsats

The NodeAudit endpoint in Faraday can be used to produce this report for your lnd node. The Harmony accounting format is used to produce a set of records for the transactions that your node has participated in. Please see our Faraday documentation for full details of the entries that this report produces.

./frcli audit --start_time=1593561600 --end_time=1596240000 --enable_fiat { "timestamp": "1597155079", "on_chain": false, "amount": "998784000", "credit": false, "asset": "BTC", "type": "PAYMENT", "txid": "89bf5fd3ca7a7cf6e10b1c147817997194dba3c9e32efb88add5ada3d5a73e46", "fiat": "116.484852968064", "reference": "4:252eccb99650a1621d2bacc31883772e7b8d6d3b35adda55bb91728d8ea16abe", "note": "030df6a20f28d7b4b253fe1cd4de36eeaac53b4646c37b5748790f20b98828dbfa", "btc_price": { "price": "11662.6671015111366222", "price_timestamp": "1597154400" } }, { "timestamp": "1597155079", "on_chain": false, "amount": "1998", "credit": false, "asset": "BTC", "type": "FEE", "txid": "89bf5fd3ca7a7cf6e10b1c147817997194dba3c9e32efb88add5ada3d5a73e46", "fiat": "0.000233020088658", "reference": "4:252eccb99650a1621d2bacc31883772e7b8d6d3b35adda55bb91728d8ea16abe:-1", "note": "030df6a20f28d7b4b253fe1cd4de36eeaac53b4646c37b5748790f20b98828dbfa", "btc_price": { "price": "11662.6671015111366222", "price_timestamp": "1597154400" } }

This report contains entries for every transaction your node has participated in, off-, and on-chain, for the period specified. If using the frcli command line tool, the --csv_path flag can be used to write this information to a .csv file, which can easily be imported straight into excel or Google sheets.



accounting

Reports can optionally include USD values, sourced from the CoinCap historical prices API, for each transaction using the --enable_fiat option. The Bitcoin price and timestamp that were used to calculate the fiat value of the transaction are included so that price calculation is transparent.

Requirements

To correctly calculate fees for reporting, Faraday requires a connection to a bitcoind or btcd node with --txindex enabled. See Faraday’s readme for instructions on how to connect to a node. This version of Faraday also requires lnd v0.11.0-beta to generate reports, because lnd’s api was extended to allow for accounting report creation in this release.

By adding accounting support to the Faraday suite, we aim to decrease the operational overhead of running a mainnet Lightning node and make it easier to build businesses on Lightning. Please reach out in the Faraday channel in the lnd slack, or create an issue on Github with any questions or requests. We hope we’ve just made life easier for you, and your accountants to #tracksats!