Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Transaction Reports #23

Closed
carlaKC opened this issue Apr 23, 2020 · 1 comment
Closed

Transaction Reports #23

carlaKC opened this issue Apr 23, 2020 · 1 comment

Comments

@carlaKC
Copy link
Contributor

carlaKC commented Apr 23, 2020

Create reports for on-chain and off-chain activity of a node, similar to those produced by ln-accounting. For every off and on chain transaction that occurs within the period specified, generate an accounting entry. Transactions that pay fees will have a separate entry added for the fees paid.

Entry Format

  • Timestamp: unix timestamp
  • OnChain: whether the transaction was on or off chain
  • Amount: expressed in msat for the sake of a consistent unit across on/off chain
  • Type: type of transaction, see below
  • TxID: transaction id on chain,
  • FromID: source of funds, when available
  • ToID: destination of funds, when available
  • Fiat: fiat equivalent
  • ID: unique identifier, if available
  • Note: additional note to provide context

Entry Types

Each transaction added to the report should have a type which describes to the reader what lightning related operation the transaction was a part of. The first iteration of these reports will have the following types:

  • ChannelOpen: channel opening transaction
  • ChannelClose: channel closing transaction
  • HtlcForward: fees earned from forwarding off chain
  • Receipt: receipt on chain, invoice settle off chain
  • Payment: balance spend from wallet on chain, settled payment off chain
  • CircularRebalance: special case of off chain send, where destination is our own node, only record fees
  • ChannelOpenFee: fees paid to open a channel
  • ChannelCloseFee: fees paid to close a channel
  • RoutingFee: fees paid off chain for our own payments
  • ChainFee: fees pain on chain for our own payments

This classification falls short for on chain transactions, because we cannot distinguish between sends the user initiated on chain and sweeps produced by lnd on chain. This distinction is out of scope for this task. Follow up tasks will work on splitting these categories out further.

Export

These reports should be queryable via rpc, or cli interface. The ability to export directly as a CSV should also be supported, as this is a common use case for this kind of report.

Example output:

Timestamp On Chain Amount Asset Type Transaction ID Fiat From To ID Note
2020-04-21 14:21:34 false -5000013120000 mSAT BTC Channel Open ee0a8f81693c59f56a5f9302bfac777033e5eacaa7c11a5f005ac0c4ee340d06 0 2N7bEvke4SAfPriYTorpPua6vMkYKWfiQiN bcrt1qe3mg2cueysfsxy5480vadklj356dlr2s2spqqa Initiated by 02d9c99961003f1ce0a082146faba32ec28afaccb8d2eae362cef4130ec3baaeb9
2020-04-21 14:21:34 false -1000 mSAT BTC Fee ee0a8f81693c59f56a5f9302bfac777033e5eacaa7c11a5f005ac0c4ee340d06e2b 0 2N7bEvke4SAfPriYTorpPua6vMkYKWfiQiN bcrt1qe3mg2cueysfsxy5480vadklj356dlr2s2spqqa Channel Open Fee ee0a8f81693c59f56a5f9302bfac777033e5eacaa7c11a5f005ac0c4ee340d06
2020-04-21 14:21:34 false 5000000000000 mSAT BTC Receipt 4638a3ced6bea9b64e5b6aad33209aea6a9da643ac6a92ac87290a2c025d047c 0 2N7bEvke4SAfPriYTorpPua6vMkYKWfiQiN bcrt1qe3mg2cueysfsxy5480vadklj356dlr2s2spqqa
@carlaKC
Copy link
Contributor Author

carlaKC commented Jul 20, 2020

Resolved by multiple PRs, the nodereport endpoint produces this report.

@carlaKC carlaKC closed this as completed Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant