Add APIs to classify channel-related transaction types
It would be great if we could add APIs that would allow the user to determine which 'type' of transaction any given transaction would be related to channel operation.
Especially when it comes to splicing it would be helpful if a user could check whether a particular Txid is 'known' to LDK and retrieve whether its a channel funding/channel close/splice in/splice out transaction.
Hmm, I don't really think we can do this generically as a query - LDK doesn't keep around all the information that would be required to do this (and I don't think we want to change that). I'm curious what is missing from the current API to be able to handle this on the client end, though? Presumably the only transactions you care about will come back via SpendableOutput events, which can be tracked on the client end, though we'll have to figure out what this looks like with splicing indeed.
I'm not sure we'll be producing SpendableOutput events for splices, they might not even have an output that pays back to the user. We will have two splicing-related events though: one for once it's negotiated and another once it's locked. Those could help the user label transactions in their wallet on their own.
Right, I was thinking we'd have a new event for splicing confirmations which could be used by clients, as you note.
Discussed this offline: we'll add additional arguments for channel ID and 'transaction label' to broadcaster interface that allows the implementer to intercept what the 'type' (funding, closing, splice in/out, bump) a particular transaction is and what channel context it is for. This would allow LDK Node to track an intermediary, persisted list of such labels that it can lookup while syncing the BDK onchain wallet.