<p>Let me clarify some things here with the order</p>
<blockquote>
<p>Many c-lightning tutorials on YouTube walk their listeners through the process of setting up a c-lightning node followed by the installation of a wallet like Spark-wallet. I just don't get it why do I need such a lightning wallet.</p>
</blockquote>
<p>c-lightning accepts request only through the UNIX socket and this means that you can not use HTTPS to access it. This brings two problems:</p>
<ol>
<li>You can not have a remote node and control it from outside your local network.</li>
<li>If you expose the API through a Rest API you need to manage the authentication, many tools did it with a js server or a plugin like <a href="https://github.com/clightning4j/jrest" rel="nofollow noreferrer">jrest</a>.</li>
</ol>
<p>Spark Wallet is a web interface from c-lightning that exposes the API through rest protocol and gives you the possibility to manage the node with a mobile/web interface. So if you love the command line, c-lightning is enough</p>
<blockquote>
<p>Ubuntu Desktop LTS. Pruned Bitcoin Core with connections over Tor. To make transacting through my c-lightning node more convenient I wrote this script.</p>
</blockquote>
<p>Each run of your node is a lucky run because likely your lightning node asking for a block not yet removed by bitcoin core prune mode. There are plugins that implement safely the pruning mode like <a href="https://github.com/clightning4j/btcli4j" rel="nofollow noreferrer">btcli4j</a></p>
<blockquote>
<p>My routine looks like so: 1. cd ~/.lightning/bitcoin &amp;&amp; ~/CS/Bitcoin/c-lightning/lightning/tools/lightning-hsmtool generatehsm hsm_secret</p>
</blockquote>
<p>Super Safe I think so, you backup the node each run, but there is some corner case here. I will also assume that for now there is no &quot;good&quot; way to use a lightning network node, but also here there is another corner case, that I will explore below:</p>
<h3>What is a lightning node (November 13, 2021)</h3>
<p>There is no difference between lightning nodes right now, but we can make the following distinction:</p>
<ul>
<li>Node that wants to use the lightning network to pay (only!)</li>
<li>Node that wants to be part of the network, so it pays and helps the other person to make payment (forward payment)</li>
</ul>
<p>Now, you are in the first subset, so you use the node only to pay to throw a single private node, and it works because you are only one node and you pay directly to this node (A -&gt; B). You can use also a key send option.</p>
<p>But when you could have a problem?
A problem can be when you will add a new channel to your network (aka: C), in this case, your payment can fail because your c-lightning node applies a technique that is called multi-part payment aka MPP, where the basic idea is to split the payment across channels, but if one of your channel capacity it is not enough, and it has not another alternative, it can fail.</p>
<h3>Conclusion</h3>
<ul>
<li>Your procedure is it right? Depends on what you want to do, but yes for your use case. However, it will fail for the corner case described above.</li>
</ul>
<p>In addition, the lightning network node is more from your usage, but it is also true the usage depends on what you want to do with lightning.</p>
<p>P.S: Another corner case is if you are a public channel aka D with another node, but this time id D with a channel open to you (D-&gt;A) and you are offline all the time, the node could (or should) want close a channel, because you are locking some funds with your bad uptime.</p>

CC BY-SA 4.0
2021-11-13T10:54:40.620Z
2021-12-05T09:37:13.047Z
2021-12-05T09:37:13.047Z
vincenzopalazzo
<p>Many c-lightning tutorials on YouTube walk their listeners through
the process of setting up a c-lightning node followed by the installation of a wallet like <a href="https://github.com/shesek/spark-wallet" rel="nofollow noreferrer">Spark-wallet</a>. I just don't get it why do I need such a lightning wallet.</p>
<h2>My setup</h2>
<p>Ubuntu Desktop LTS. Pruned Bitcoin Core with connections over Tor.
To make transacting through my c-lightning node more convenient I wrote <a href="https://github.com/jerzybrzoska/wallet-like" rel="nofollow noreferrer">this script</a>.
I'm well aware that I could have written something even simpler were I to do it <a href="https://en.wikipedia.org/wiki/Bash_(Unix_shell)" rel="nofollow noreferrer">in Bash</a> instead of in C.
I aliased in my <code>.bashrc</code> the path to the script, i.e. to its binary,
like so <code>alias lcli='~/CS/SoftwareDevelopment/MySoftware/C/lcli/a.out'</code>
and  the command to start the lightning daemon: <code>alias ldaemon='lightningd --daemon'</code></p>
<p>My routine looks like so:
<strong>1.</strong> <code>cd ~/.lightning/bitcoin &amp;&amp; ~/CS/Bitcoin/c-lightning/lightning/tools/lightning-hsmtool generatehsm hsm_secret</code>
I introduce the seed phrase which generates an unencrypted hsm_secret(I use no passphrase to generate it, just the seed).
<code>lightningd.sqlite3</code> is already there and my pruned Bitcoin Core is running all the time.</p>
<p><strong>2.</strong> I type <code>lcli</code> in the terminal and then interact with my script.</p>
<p><strong>3.</strong> After transacting I shut down <code>lightningd</code> (through the same script).</p>
<p><strong>4.</strong> I backup my <code>lightningd.sqlite3</code> with another script and remove my <code>hsm_secret</code>.</p>
<p>Why would a user like myself want to use any wallet (other than that of their c-lightning node) at all? Can use of such a wallet offer any security advantages that I'm not aware of?
Is my routine of transacting insecure?</p>

CC BY-SA 4.0
2021-11-11T15:52:35.583Z
What do you mean with "a Lightning wallet"? Your c-lightning has a wallet already, and you're using it, so it appears you're talking about something else in addition - but I don't know what.
Pieter Wuille
CC BY-SA 4.0
2021-11-11T16:14:18.757Z
@Pieter I'm referring to software such as [fulmo](https://github.com/marzig76/fulmo) as well as to [spark-wallet](https://github.com/shesek/spark-wallet). I've not tried them yet, but they seem to be something one may use on top of their `c-lightning` node/wallet.
John Smith
CC BY-SA 4.0
2021-11-11T21:17:40.147Z
Just to be clear, is your routine to: start up your node -> transact -> shut down your node? If so, that is a somewhat insecure way to use the lightning network. If your node is not online, it cannot watch for peers attempting to rob you by publishing outdated channel states.
chytrik
CC BY-SA 4.0
2021-11-11T21:42:49.640Z
@chytrik Had I any public channels that would be very insecure. But I have only one private channel, so my node is not a routing node - there is only one peer on the opposite side of the channel and it is one of the top capacity nodes. You may think that I put too much trust in the node with whom I have a channel  .. but on the other hand the major advantage of my approach is that when I shut down the node and shred my hsm_secret the balance of the node cannot be confiscated (police raids, thieves, etc.).
John Smith
<wallet-security><core-lightning>
From a security standpoint, why might a desktop c-lightning user need an additional lightning wallet?
John Smith
# From a security standpoint, why might a desktop c-lightning user need an additional lightning wallet?

(Asked by: username_0 on 2021-11-11)

Many c-lightning tutorials on YouTube walk their listeners through
the process of setting up a c-lightning node followed by the installation of a wallet like [Spark-wallet](https://github.com/shesek/spark-wallet). I just don't get it why do I need such a lightning wallet.

## My setup

Ubuntu Desktop LTS. Pruned Bitcoin Core with connections over Tor.
To make transacting through my c-lightning node more convenient I wrote [this script](https://github.com/jerzybrzoska/wallet-like).
I'm well aware that I could have written something even simpler were I to do it [in Bash](https://en.wikipedia.org/wiki/Bash_(Unix_shell)) instead of in C.
I aliased in my `.bashrc` the path to the script, i.e. to its binary,
like so `alias lcli='~/CS/SoftwareDevelopment/MySoftware/C/lcli/a.out'`
and the command to start the lightning daemon: `alias ldaemon='lightningd --daemon'`

My routine looks like so:
**1.** `cd ~/.lightning/bitcoin && ~/CS/Bitcoin/c-lightning/lightning/tools/lightning-hsmtool generatehsm hsm_secret`
I introduce the seed phrase which generates an unencrypted hsm\_secret(I use no passphrase to generate it, just the seed).
`lightningd.sqlite3` is already there and my pruned Bitcoin Core is running all the time.

**2.** I type `lcli` in the terminal and then interact with my script.

**3.** After transacting I shut down `lightningd` (through the same script).

**4.** I backup my `lightningd.sqlite3` with another script and remove my `hsm_secret`.

Why would a user like myself want to use any wallet (other than that of their c-lightning node) at all? Can use of such a wallet offer any security advantages that I'm not aware of?
Is my routine of transacting insecure?

**Tags:** wallet-security, core-lightning

> **Comments:**
> **username_1**: What do you mean with "a Lightning wallet"? Your c-lightning has a wallet already, and you're using it, so it appears you're talking about something else in addition - but I don't know what.  
> **username_0**: @username_1 I'm referring to software such as [fulmo](https://github.com/marzig76/fulmo) as well as to [spark-wallet](https://github.com/shesek/spark-wallet). I've not tried them yet, but they seem to be something one may use on top of their `c-lightning` node/wallet.  
> **username_2**: Just to be clear, is your routine to: start up your node -> transact -> shut down your node? If so, that is a somewhat insecure way to use the lightning network. If your node is not online, it cannot watch for peers attempting to rob you by publishing outdated channel states.  
> **username_0**: @username_2 Had I any public channels that would be very insecure. But I have only one private channel, so my node is not a routing node - there is only one peer on the opposite side of the channel and it is one of the top capacity nodes. You may think that I put too much trust in the node with whom I have a channel  .. but on the other hand the major advantage of my approach is that when I shut down the node and shred my hsm_secret the balance of the node cannot be confiscated (police raids, thieves, etc.).  

---

## 1 answers

### Answer by username_3 on 2021-11-13. Score: 2 | Accepted answer

Let me clarify some things here with the order

> Many c-lightning tutorials on YouTube walk their listeners through the process of setting up a c-lightning node followed by the installation of a wallet like Spark-wallet. I just don't get it why do I need such a lightning wallet.

c-lightning accepts request only through the UNIX socket and this means that you can not use HTTPS to access it. This brings two problems:

1. You can not have a remote node and control it from outside your local network.
2. If you expose the API through a Rest API you need to manage the authentication, many tools did it with a js server or a plugin like [jrest](https://github.com/clightning4j/jrest).

Spark Wallet is a web interface from c-lightning that exposes the API through rest protocol and gives you the possibility to manage the node with a mobile/web interface. So if you love the command line, c-lightning is enough

> Ubuntu Desktop LTS. Pruned Bitcoin Core with connections over Tor. To make transacting through my c-lightning node more convenient I wrote this script.

Each run of your node is a lucky run because likely your lightning node asking for a block not yet removed by bitcoin core prune mode. There are plugins that implement safely the pruning mode like [btcli4j](https://github.com/clightning4j/btcli4j)

> My routine looks like so: 1. cd ~/.lightning/bitcoin && ~/CS/Bitcoin/c-lightning/lightning/tools/lightning-hsmtool generatehsm hsm\_secret

Super Safe I think so, you backup the node each run, but there is some corner case here. I will also assume that for now there is no "good" way to use a lightning network node, but also here there is another corner case, that I will explore below:

### What is a lightning node (November 13, 2021)

There is no difference between lightning nodes right now, but we can make the following distinction:

* Node that wants to use the lightning network to pay (only!)
* Node that wants to be part of the network, so it pays and helps the other person to make payment (forward payment)

Now, you are in the first subset, so you use the node only to pay to throw a single private node, and it works because you are only one node and you pay directly to this node (A -> B). You can use also a key send option.

But when you could have a problem?
A problem can be when you will add a new channel to your network (aka: C), in this case, your payment can fail because your c-lightning node applies a technique that is called multi-part payment aka MPP, where the basic idea is to split the payment across channels, but if one of your channel capacity it is not enough, and it has not another alternative, it can fail.

### Conclusion

* Your procedure is it right? Depends on what you want to do, but yes for your use case. However, it will fail for the corner case described above.

In addition, the lightning network node is more from your usage, but it is also true the usage depends on what you want to do with lightning.

P.S: Another corner case is if you are a public channel aka D with another node, but this time id D with a channel open to you (D->A) and you are offline all the time, the node could (or should) want close a channel, because you are locking some funds with your bad uptime.


---

