ElementsProject / ElementsProject/lightning

Missing wallet features: get_transaction and coin_movement

Open
#8,840 0 comments 0 reactions 0 assignees View on GitHub
QA
Dominant language
C
Stars
3.1k
Forks
1k
Avg merge
4d 10h
Merged PRs (30d)
13

Description

Hi everyone,

We are currently trying to implement account segregation at the app level leveraging an underlying Bitcoin Wallet. Users can generate addresses tied to their account. If the app is connected to LND, we can use the LND wallet, if connected to CLN, the CLN wallet, etc. I know that is not ideal since the lightning node BTC wallet us used to support Lightning operations and should probably not be used as some generic wallet API, yet, that is very convenient and the capabilities of Lightning node wallets are advanced.

Sadly, while implementing this, I noticed CLN lacks crucial features that I wasn't able to find in the API reference.

### Missing data in `coin_movement`

The only way to sync the chain movements at runtime seems to be using the `coin_movement` events where `type = chain_mvt`. I appreciate the way this was implemented as it's a bit better than LND because the `primary_tag` allows us to differentiate between withdrawals and deposits such that we can skip unrelated events.
Yet, the movements do not return the `address` or `scriptPubkey` of the output, which is annoying.

Also the documentation is outdated and does not reflect the current returned fields: https://docs.corelightning.org/docs/event-notifications#coin_movement

### No `get_transaction` or `get_output`

There are `listfunds` and `listtransactions` but these do no include any filter so we are forced to get all objects, there is no pagination either. Related to the `coin_movement` issue, we could query the node and get the transaction or the output since we have the outpoint in order to get the `address`, but currently we have to get all data.

### No easy way to sync

_Edit: My bad, just found out about `listchainmoves`. Disregard this section._

## Versions
CLN: `v25.09` and `v25.12`

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.