<p>I think you refer to those wallets (which some people refer to as remote controls) which run a lightning node somewhere in the cloud (it could be your own raspiblitz server at home) and provide an app that remotely controls the node. I think it is clear why this would be non custodial (at least if the software is open source and not messing around with your login credentials)</p>

<p>Stepan snigirev with the crypto advance team is currently working on a hardware wallet for lightning. Some code snippets can be found on Stephans gitrepos. The idea is to extract all signing and derivation from the lightning node to a hardware security module. In c Lightning this seems particularly easy as the hsmdaemon already exists as a standalone daemon.</p>

<p>Other than that Mark H is right when stating that private keys are needed almost all the time. </p>

CC BY-SA 4.0
2019-04-12T19:55:58.213Z
The ones I've seen control the VPC themselves, which means that at least those are custodial. HW for lightning sounds like a great idea!
Enrique Alcazar
CC BY-SA 4.0
2019-04-12T17:04:56.833Z
2019-04-12T17:04:56.833Z
Rene Pickhardt
<blockquote>
  <p>Unlike layer 1, keys are not needed in order to perform transactions, which means that you are not only trusting the information the node is providing, also they could perform transactions without your knowledge.</p>
</blockquote>

<p>Keys are required in lightning. Multiple, in fact.</p>

<p>The lightning node itself is identified by its public key. You need the private key to perform the secure handshake so that you can have encrypted and authenticated communication with peers. You also need the node's private key to sign any gossip information about your node or channels.</p>

<p>On forming channels, you need the private key for an unspent transaction output on the bitcoin network in order to fund the channel.</p>

<p>On operating channels, each channel has a unique funding key which is used to spend the 2-of-2 P2WSH output. You must have the corresponding private key to sign each commitment transaction and also the closing transaction - this must be done once per commitment.</p>

CC BY-SA 4.0
2019-04-12T16:05:54.980Z
That makes sense. Then if the private key stays in the app controlling the lightning node, it would be safe. But that's not how it's done right? right now, to access the RPC and send transactions you only need the macaroon which leads me to believe that the keys are stored and managed in the lightning node not on the app which controls the node.
Enrique Alcazar
CC BY-SA 4.0
2019-04-12T16:09:58.723Z
It doesn't matter which application controls the keys. If you're running the node on a machine which you don't control, you can forego any hope of those keys being private. The private keys must be on your own machine only, and even then, should ideally be on a hardware security module where the private keys can not be exposed through side-channels if any other software on the machine is exploited. We're not at the point where these HSMs are ready yet, but they will be coming.
Mark H
CC BY-SA 4.0
2019-04-12T19:59:24.943Z
Then all services that configure the node or control the VPC in which is installed are custodial because right now all the signing is done at the node level, but there are people working on abstracting the signing logic so it can be ran separately and store keys on an HSM. Thanks for the explanation
Enrique Alcazar
CC BY-SA 4.0
2019-04-12T15:58:19.807Z
2019-04-12T15:58:19.807Z
Mark H
<p>In Bitcoin we can have a light wallet where we are connected to a full node, by doing this, we have to trust that the full node is feeding correct information, but at least we can store our keys in the light wallet itself.</p>

<p>I've been looking around for a similar solution in lightning and the closest I found are some <strong>lightning wallets which host a node in their clouds and an app which controls the node</strong>.</p>

<p>Unlike layer 1, keys are not needed in order to perform transactions, which means that you are not only trusting the information the node is providing, also <strong>they could perform transactions without your knowledge</strong>.</p>

<p><strong>Am I missing something here? Why are those wallets called non-custodial?</strong></p>

<p>I know you can run a full lightning node on you phone like acinq does, but a safe cloud-based solution would lower the barrier of entry for some users</p>

<lightning-network><custody>
Hosting lightning node and non-custodial
Enrique Alcazar
# Hosting lightning node and non-custodial

(Asked by: username_0 on 2019-04-12)

In Bitcoin we can have a light wallet where we are connected to a full node, by doing this, we have to trust that the full node is feeding correct information, but at least we can store our keys in the light wallet itself.

I've been looking around for a similar solution in lightning and the closest I found are some **lightning wallets which host a node in their clouds and an app which controls the node**.

Unlike layer 1, keys are not needed in order to perform transactions, which means that you are not only trusting the information the node is providing, also **they could perform transactions without your knowledge**.

**Am I missing something here? Why are those wallets called non-custodial?**

I know you can run a full lightning node on you phone like acinq does, but a safe cloud-based solution would lower the barrier of entry for some users

**Tags:** lightning-network, custody


---

## 2 answers

### Answer by username_2 on 2019-04-12. Score: 3 | Accepted answer

> Unlike layer 1, keys are not needed in order to perform transactions, which means that you are not only trusting the information the node is providing, also they could perform transactions without your knowledge.

Keys are required in lightning. Multiple, in fact.

The lightning node itself is identified by its public key. You need the private key to perform the secure handshake so that you can have encrypted and authenticated communication with peers. You also need the node's private key to sign any gossip information about your node or channels.

On forming channels, you need the private key for an unspent transaction output on the bitcoin network in order to fund the channel.

On operating channels, each channel has a unique funding key which is used to spend the 2-of-2 P2WSH output. You must have the corresponding private key to sign each commitment transaction and also the closing transaction - this must be done once per commitment.

> **Comments:**
> **username_0**: That makes sense. Then if the private key stays in the app controlling the lightning node, it would be safe. But that's not how it's done right? right now, to access the RPC and send transactions you only need the macaroon which leads me to believe that the keys are stored and managed in the lightning node not on the app which controls the node.  
> **username_2**: It doesn't matter which application controls the keys. If you're running the node on a machine which you don't control, you can forego any hope of those keys being private. The private keys must be on your own machine only, and even then, should ideally be on a hardware security module where the private keys can not be exposed through side-channels if any other software on the machine is exploited. We're not at the point where these HSMs are ready yet, but they will be coming.  
> **username_0**: Then all services that configure the node or control the VPC in which is installed are custodial because right now all the signing is done at the node level, but there are people working on abstracting the signing logic so it can be ran separately and store keys on an HSM. Thanks for the explanation  

---

### Answer by username_1 on 2019-04-12. Score: 1

I think you refer to those wallets (which some people refer to as remote controls) which run a lightning node somewhere in the cloud (it could be your own raspiblitz server at home) and provide an app that remotely controls the node. I think it is clear why this would be non custodial (at least if the software is open source and not messing around with your login credentials)

Stepan snigirev with the crypto advance team is currently working on a hardware wallet for lightning. Some code snippets can be found on Stephans gitrepos. The idea is to extract all signing and derivation from the lightning node to a hardware security module. In c Lightning this seems particularly easy as the hsmdaemon already exists as a standalone daemon.

Other than that username_2 is right when stating that private keys are needed almost all the time.

> **Comments:**
> **username_0**: The ones I've seen control the VPC themselves, which means that at least those are custodial. HW for lightning sounds like a great idea!  

---

