-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Support CLN (Core Lightning / c-lightning)? #67
Comments
If CLN has a PSBT API reasonably similar to that of LND it should be possible. But also there would be need of having a Rust library for RPC and some abstraction to have a single node interface. Same for Eclair. |
Not familiar with LND API, but for CLN there is fundchannel_start and fundchannel_complete. I think they were first at both implementng such API for creating channels and also PSBTs. |
From quick look the API looks usable (and much simpler than LNDs!), although it's not entirely clear to me whether it can be used for funding multiple channels in the same transaction (probably it can). Also IDK how CLN handles reserve for anchors. So something like this should work: trait LnNode {
// async is just me being lazy, I'm not suggesting to use nightly. We would need to return boxed pinned future.
// If there's not enough reserved sats for anchors returns a `TxOut` that needs to be funded. Amount may be raised.
async fn get_anchor_reserve(&mut self, num_new_channels: usize) -> Result<Option<TxOut>>;
// box makes it object-safe so that we can run-time select the impl without blowing up code size or even support multiple nodes
// allocation cost should be dwarfed by communication overhead (including with peers)
async fn init_open(&mut self, peer: NodeId, amount: Amount) -> Result<(TxOut, Box<dyn UnfundedChannel>)>;
}
trait UnfundedChannel {
async fn submit_funding_psbt(self: Box<Self>, psbt: Psbt) -> Result<()>;
} Then we call |
Haven't looked into details of architecture of nolooking, how easy it would be to add support for other Lightning Network node implementations, mainly CLN?
The text was updated successfully, but these errors were encountered: