Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secure keystore of lightning nodes / wallets #136

Closed
renepickhardt opened this issue Feb 8, 2020 · 2 comments
Closed

Secure keystore of lightning nodes / wallets #136

renepickhardt opened this issue Feb 8, 2020 · 2 comments

Comments

@renepickhardt
Copy link
Contributor

In chapter two / getting started we currently write: The most common components of lightning wallet software include: A keystore that securely holds secrets, such as private keys.

I am not sure how secure the keystore currently is on LN nodes.

I believe in early days there was no way to encrypt wallet.dat and wallet.dat has been stolen leaked. in a same way for example in c-lightning we have hsm_secret that stores the private master key in plain binary format and the entire state is stored in plain text in a sql database. For state information it will be even more tricky to encrypt this as the state will / should change without user interaction. while hsm_secret could be encrypted the decrypted version would have to be in main memory and could be found with a full memory dump. there are not too many variables to check in a full mem copy.

I am not sure how comfortable I feel suggesting that lighting implementations have a secure keystore.

@renepickhardt
Copy link
Contributor Author

c-lightning has at least https://github.com/ElementsProject/lightning/blob/master/tools/hsmtool.c that can be used to somewhat secure hsm_secret

@darosior
Copy link

c-lightning has at least https://github.com/ElementsProject/lightning/blob/master/tools/hsmtool.c that can be used to somewhat secure hsm_secret

C-lightning also support hsm_secret encryption, just start lightningd with --encrypted-hsm.

while hsm_secret could be encrypted the decrypted version would have to be in main memory and could be found with a full memory dump. there are not too many variables to check in a full mem copy.

The specific content of hsm_secret is read in non-swapable (mlocked) memory. However, most of the secrets are still stored in swapable memory as of today.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants