eclair icon indicating copy to clipboard operation
eclair copied to clipboard

Remove `InputInfo` from `LocalCommit` and compute `localFundingPubKey` from `ChannelKeys`

Open pm47 opened this issue 6 months ago • 0 comments

This is a work-in-progress (InteractiveTxBuilder could be improved, and tests aren't even compiling), but I'd like to get an early feedback before finishing.

My starting point was to move InputInfo out of LocalCommit and into Commitment. It seemed more logical because this is not exclusive to the local commit (indeed we use it to build remote txs).

I actually didn't move InputInfo itself, but only the localFundingPubKey and funding outpoint. It saves a little bit of space, as we get rid of the pubkeyScript). To be able to compute the InputInfo, I had to also bring the CommitmentFormat, which I guess will be needed for taproot channels.

Then I got rid of localFundingPubKey entirely by recomputing it from ChannelKeys. Since those are cached, I think performance shouldn't suffer, and it saves an additional 33B in persisted data.

pm47 avatar Jun 06 '25 16:06 pm47