-
Notifications
You must be signed in to change notification settings - Fork 376
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
Future ChannelKeys API #606
Comments
Okay I spend a bit of time on this, I finally agree with you we should store LocalOnchainCommitment and RemoteCommitment in ChannelMonitor, and just have OnchainRequest exchanged between ChannelMonitor and OnchainTxHandler
I think middle-term OnchainTxHandler should be its own trait to serve other component like splicing/dual-funding. And so with watchtower integration I've something like this in mind
And ConfidentialWatcher would be trait to implement a privacy-preserving watchtower
|
Wow, yea, I think at a high level that's the right design, thanks for putting it together! Refactoring the OnchainTxHandler/ConfidentialWatchtower design a bit to share common code for the actual transaction generation I think will also need to happen, but most of those can probably be static functions (though maybe long-term functions on the ChanSigner or some other struct - I think moderately long-term we need to also be thinking about how to let users change the scripts that appear in the transactions themselves). |
Yes of course getting helpers as we have in
Yes, I exactly made the point for in #605 for PTLC experimentation it should be doable to swap scripts in ChanSigner, that way avoid any state machine disruption. We would have to abstract verification too, but that's few lines of changes |
Figured I should document the goal I had in my head for ChannelKeys. I think we should:
a) cache the local keys currently fetched via ChannelKeys::pubkeys() in Channel and ChannelMonitor,
b) only ever have one instance of a ChannelKeys per channel - fetching it during Channel init, shoving it into the created ChannelMonitor (this implies finally removing the channel_monitor from Channel, but we're really close to that), and then moving it into the OnchainTxHandler.
c) Drop the Clone requirement from ChannelKeys (though maybe implementing Clone for ChannelMonitor only if ChannelKeys has it, and documenting this).
The text was updated successfully, but these errors were encountered: