Open AndySchroder opened 3 years ago
With all this being said, why can't the grpc certificate be tied somehow to the node's public key and not fuss with the methods above?
Totally can be, we have a new project coming out soon that implements this. The idea is just to use the node public key, and then use the same crypto handshake as we use for the LN p2p protocol over gRPC. So then this way, all you need is a new fresh public key, and everything works as normal.
Is your new gRPC protocol going to use https. or will you run http and then wrap everything in your own encryption? Just wondering how this might be compatible with existing gRPC libraries that are more general than for use with lnd.
The problem with using the node's public key as the TLS/HTTPS key is that you need to unlock the wallet to be able to use the private key to sign stuff. But the unlocking mechanism works through gRPC and you certainly don't want to submit your wallet password through unauthenticated/unencrypted gRPC. So this would only work with the auto-unlocking feature enabled that reads the wallet password from a file on startup.
With all this being said, why can't the grpc certificate be tied somehow to the node's public key and not fuss with the methods above?
Totally can be, we have a new project coming out soon that implements this. The idea is just to use the node public key, and then use the same crypto handshake as we use for the LN p2p protocol over gRPC. So then this way, all you need is a new fresh public key, and everything works as normal.
@Roasbeef , are you talking about https://lightning.engineering/posts/2021-11-30-lightning-node-connect-deep-dive/ ? Curious if you are going to release any other client implementations for Lightning Node Connect? Seems like a really cool alternative, but I have no way of using it in my applications without python libraries being available and the documentation that you've published (in non-code form) is fairly high level, so I don't know where to start to make my own Lightning Node Connect client library.
lnd creates a certificate for the grpc. We also have a node pubkey that is used for securing peer to peer transport. At a high level, this seems a bit redundant to me to have two types of public keys for one node.
There are a few things that can be done to get the grpc client to work.
With all this being said, why can't the grpc certificate be tied somehow to the node's public key and not fuss with the methods above? The node's public key has it's open channels affiliated with it, and those channels are sort of a way to build a weighted web of trust that may one day be able to eliminate the desire for certificate authorities. I realize that the peer to peer transport may be a widely different protocol than the grpc interface, but I'm just thinking that there could be some way to sign the grpc certificate using the peer to peer transport's public key. We also have the
<pubkey>@host
format that is typically used to connect to a peer. This is easy to copy and paste, put in QR codes, etc.. Seems like this approach may be better than needing to copy certificate files over if we can use it to bootstrap the security of the grpc certificate.