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

Enable export of Lightning Network transactions history #8521

Open
BTCAlchemist opened this issue Jul 4, 2023 · 7 comments
Open

Enable export of Lightning Network transactions history #8521

BTCAlchemist opened this issue Jul 4, 2023 · 7 comments

Comments

@BTCAlchemist
Copy link

Currently, a user may export the transaction history from the 'History' tab by clicking the tool button and clicking 'Export' (screenshot below). This is helpful for accounting. However, this export does not include details of Lightning Network transactions. Exporting LN txs is needed to account for those transactions while a channel is open. Could you make an option to export the Lightning Network transactions? This would support accurate accounting and crypto tax recording. Thank you for the consideration.
image

@ecdsa
Copy link
Member

ecdsa commented Jul 28, 2023

At the moment you can use the command line to export lightning transactions:
./run_electrum -o lightning_history

This is just a workaround. I agree that lightning history should be exportable from the GUI.

@ecdsa
Copy link
Member

ecdsa commented Jul 28, 2023

Note: it would also be good to merge lightning_history and onchain_history.

Some operations (channel opening, channel closing, submarine swaps) affect both onchain and lightning balances, but they are not treated homogeneously: while a channel opening is seen as a single transaction, a submarine swap is represented as a compound of two transactions. We should probably represent submarine swaps a single operation first (and make the expandable item go away). Once this is done, we can have a single export history command in the CLI, and expose it in the GUI.

@BTCAlchemist
Copy link
Author

@ecdsa Thank you for the reply. I entered /run_electrum -o lightning_history into the cli in the Applications directory and in the Electrum wallet directory, but the macOS terminal said, zsh: no such file or directory: /run_electrum. What should I do differently?

@ecdsa
Copy link
Member

ecdsa commented Aug 6, 2023

sorry, my bad: ./run_electrum -o lightning_history

@BTCAlchemist
Copy link
Author

@ecdsa I ran the command but got the error zsh: no such file or directory: ./run_electrum. I tried it in the Electrum wallet directory and in the Applications directory. In which directory do I need to run this?

@PanosChtz
Copy link

@ecdsa I have the same question. How to do this using the pre-compiled binaries? (e.g. using the .exe file in windows?)
Is it doable using the console?

@PanosChtz
Copy link

Ok Windows didn't work even with python (was getting the secp256k1 library import error even though I had in installed with pip), so I had to move to ubuntu.
The complete command to do this is ./run_electrum -o lightning_history -w wallet-file > txs-lightning.json
However, it outputs in JSON format and not it csv. Even if json is converted to csv, the data fields are different that those in the csv generated by the GUI. Therefore it requires a lot of work for this to be usable and importable by existing accounting software.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants
@ecdsa @PanosChtz @BTCAlchemist and others