thesimplekid / cln-nostr-wallet-connect

Core lighting plugin for NIP47 nostr connect support
BSD 3-Clause "New" or "Revised" License
14 stars 1 forks source link

Allocate a total budget and use fake balance? #13

Open Sjors opened 4 months ago

Sjors commented 4 months ago

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.

https://github.com/thesimplekid/cln-nostr-wallet-connect/blob/6450ad99c3ae3eabd2870c0805ff7ef8369702a3/src/main.rs#L354-L361

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.