Lightning RPC



Summary:

Christian, an iOS developer, has created a C library called lnsocket, which allows him to send messages from iOS to control his lightning node. He is now considering what format the RPC commands should be in. While JSON-RPC is commonly used, it can be problematic with binary data and doesn't have any concept of streaming. Christian suggests that something more compact and rpc-friendly like grpc would be better. Rusty also has a summer of bitcoin project attempting to expose a websocket directly to browsers in order to provide another way to communicate with your node, and of course there's Commando. Christian thinks the end goal of an RPC bolt would be super powerful, so that lnsocket could talk to any lightning node. Choosing the right data format seemed like an important step in that direction. He thinks either the JSON-RPC or grpc can serve as a basis for a common RPC definition that can have any number of bindings, since they generate conversion code to/from JSON-RPC and grpc they can transparently map them back and forth. Christian cc'd clightning/lightning-dev as well to see if anyone else is working on this or thinking about this stuff right now. He is open to suggestions, comments, and criticism. The cln-grpc crate is rather new but should be reviewable as is. The cln-plugin crate is less fleshed-out, but has the core functionality needed for cln-grpc-plugin, which was the goal of this first exploration. The cln-rpc crate is missing many RPC commands, but Christian plans to tackle that separately.


Updated on: 2023-06-03T07:22:34.381813+00:00