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

Allocate a total budget and use fake balance? #13

Open
Sjors opened this issue Jul 9, 2024 · 0 comments
Open

Allocate a total budget and use fake balance? #13

Sjors opened this issue Jul 9, 2024 · 0 comments

Comments

@Sjors
Copy link

Sjors commented Jul 9, 2024

In order to not accidentally leak your lightning node wallet when the nsec is compromised, I think the balance should be the minimum of the real balance and some fake value.

Ok(Response::ListFunds(funds)) => {
let balance: u64 = funds
.channels
.iter()
.map(|c| c.our_amount_msat.msat())
.sum();
let balance = Amount::from_msat(balance);

One approach would be to have a command like lightning-cli nostr-wallet-topup which allocates a specific budget. You'd then have to track receives and spends. This could be a nice additional safety above the hourly and daily limits.

The prevent fractional reserve shenanigans, you'd still want to take the minimum of this value and the real balance.

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

No branches or pull requests

1 participant