CLN Core Lightning: How can I backup the wallet seed on Star 9? I RTFM

Hey

Core-Lightning runs fine, however, before depositing funds, how can I backup my seed (and restore alter)? That is not an action on the container. So I tried to login over SSH and do what their manual suggests: Backup your wallet

Then from the Star9 Docs, I should do the following:

# Not literally this command but none of the commands work, not even "cd" is recognized
sudo podman exec -it c-lightning.embassy "cd $LIGHTNINGDIR"

But anyways, all of that sounds wrong. How are other people doing that? I doubt anyone is using this node without being able to do seed backups.

A question on top would be: How to backup channels?

Can I extract my seed over one of the 10 interfaces? Truly, I must be misguided by fiddling with SSH anyways, I guess.

Thanks!

What I noticed: The docs for LND says, that a “Star9 Backup” is enough for LND.

However… I’d prefer to write down the 12 words somewhere. And if that is not possible, well, maybe I’d consider just doing the backup, but I will be scared like crazy that some update would destroy that or whatever. If I knew the 12 words, I could restore that lightning wallet anywhere else. This would give me the peace of mind needed, to add some more serious funds.

Alright… I think I found a way… But I’m not sure if this will work and I didn’t test the restore. I just tested if the file re-generated will look the same as the original and from the command line, it seems like it.

ssh start9@yourserver-name.local
sudo podman exec -it c-lightning.embassy bash
cd /root/.lightning/bitcoin
xxd hsm_secret #copy output
# I have some weird extra characters at the end of both lines, not sure what these mean, cut them away here. Also not my key, just an example from the docs
cat > hsm_secret_hex.txt <<HEX
00000000: 30cc f221 94e1 7f01 cd54 d68c a1ba f124
00000010:  e1f3 1d45 d904 823c 77b7 1e18 fd93 1676
HEX
# Now you will have the "hsm_secret_hex.txt" file to backup.
# To reapply the textfile:
xxd -r hsm_secret_hex.txt > hsm_secret

But please, review what I did here or correct me where it is wrong. Also, if there are better approaches, pls tell me. This apparently only backups the onchain wallet, not the channels.

Lightning channels cannot be backed up using a seed; they don’t function that way. The prescribed method for backing up LND, and CLN, on StartOS is through the StartOS backup. This backup contains all the information necessary to close the channels and recover your funds in an emergency situation.

Keep in mind that Lightning is still in its early stages and is considered an “irresponsible” hot wallet. It’s not advisable to store “serious funds” in Lightning, as there is a potential risk of losing funds if mistakes are made. Start small and gradually increase your investment as you become more familiar and experienced with the system.

That’s fine, but the onchain wallet should be able being backed up, no? I mean, in the worst case, if channels close or whatever, funds will land back on my bitcoin onchain wallet. Better to have access to that.

Hi @tennis, the StartOS backup captures the entire state of the CLN service, including channel states as well as on-chain wallet information. This is because the on-chain wallet used by CLN is part of the service, and its data is managed alongside the channel data.

If the node were to fail or if you had to recover from the backup, CLN would use the backed-up information to close any open channels and send the funds to the on-chain wallet.

Since Lightning channels cannot rely on a seed phrase for recovery, and the on-chain wallet is integrated into CLN, StartOS uses its system-level backup to ensure the integrity of all related data.

Hope this helps.

1 Like

Thanks Jeremy, but in case of hardware failure and buying some completely different hardware and installing Start9 there, will I be able to just apply that backup? Or do I need the same apps and versions in order for it to work seamlessly?

There is a difference between restoring from backup and transferring a functioning StartOS drive to new hardware. Restoring from backup will close existing lightning channels and fund will be returned on chain. With a successful transfer your lightning channels are maintained (Just be sure and never turn the previous device on and run the previous lightning node) here are the links

https://docs.start9.com/0.3.4.x/user-manual/overview/backup-restore/backup-restore

https://docs.start9.com/0.3.4.x/guides/upgrade-hardware/drive-upgrade