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

Blue Wallet funds when connected to Umbrel #285

Open
BenGWeeks opened this issue Aug 27, 2021 · 10 comments
Open

Blue Wallet funds when connected to Umbrel #285

BenGWeeks opened this issue Aug 27, 2021 · 10 comments

Comments

@BenGWeeks
Copy link

Hi all,

I am trying to work out how Blue Wallet works when you are connected to your own node. As I understand, it uses LNDHub on your Umbrel node to provide custody of the funds.

To verify this, I did the following transactions:

Before spending on Blue Wallet:

Blue Wallet Lightning Balance: x sats
Umbrel Lightning Balance: y Sats

Invoice:

Invoice amount: 2762 sats
Estimated Fee:8 - 28 sat

After:

Blue Wallet Lightning Balance: x - 2770 sats (2770 sats less, i.e. 8 sat fee)
Umbrel Lightning Balance: y - 2762 Sats (2762 sats less, i.e. 0 fees)

NB Does not appear as a forward. I previously assumed that the Blue Wallet was a node and connected to my Umbrel lightning node to get further connections in/out but that's not evident how it works. The Umbrel node is acting as a custodian of my Blue Wallet lightning funds. Hence why I don't see a forward transaction. Therefore, if I add funds to my Blue Wallet, they should also be added to the Umbrel lightning balance I assume as well.

Before purchasing Sats for the lightning wallet:

Blue Wallet Lightning Balance: w sats
Umbrel Lightning Balance: z Sats

Purchase:

Amount: £100 (~ 0.00265 BTC)
Total incl. fees: £105.38

After:

Blue Wallet Lightning Balance: w + 265,000 sats (265,000 sats added)
Umbrel Lightning Balance: z Sats (no increase in sats?)

Questions:

NB I recently noticed a channel open to lnd2.bluewallet.io (I did open a channel to LndHub - BlueWallet Lightning that looks to be the same, but this looks larger than other channels I normally open). The channel size is greater than the funds I have in my Blue Wallet lightning wallet.

  1. Are the lightning wallet funds somehow associated in this channel and rebalanced (closed/reopened) accordingly by Blue Wallet?
  2. Where do I see these other "sub-wallets" if a family or friend were to start using my node instead of say the default Blue Lightning node? How can I see the "wallets" when presumably are separated somehow in LNDHub?
  3. Why did the increase in Sats not appear in Umbrel when purchasing in Blue Wallet?
  4. Why doesn't ThunderHub show the Alias for LndHub - BlueWallet Lightning (currently showing only the public key)?
@ncoelho
Copy link
Member

ncoelho commented Aug 27, 2021

Lndhub just does user accounts. All the funds are in your umbrel node.

https://community.getumbrel.com/t/guide-umbrel-bluewallet-lndhub/497

@BenGWeeks
Copy link
Author

Great link thanks. But when I open "BlueWallet Lightning" on Umbrel, it takes me to http://umbrel.local:3008/ and shows me my channels, but not a list of wallets I am a custodian for? And why don't funds I purchase in BW, add to my lightning funds shown in Umbrel (spending them reduces the funds though).

@BenGWeeks
Copy link
Author

NB I don't see any wallets listed in "LNBits" either.

@ncoelho
Copy link
Member

ncoelho commented Aug 27, 2021

Funds go to your onchain addresses on your node. Yes you cannot see the wallets. They are on the database only.

@BenGWeeks
Copy link
Author

Thanks for your feedback @ncoelho. But if I buy Lightning wallet funds I was presuming that BlueWallet (org) open a channel to my node, pass the funds, then somehow assign the funds to that wallet. So I should see funds increase in off-chain rather than on-chain? Certainly the funds appear in my lightning wallet on the mobile device so must be off-chain "somewhere"?

I would be keen to submit a feature request to allow node operators to know what wallets they are custodians for. Should this be another page in the LNDHub app? I notice that some people seem to run this site as a publicly available site (not sure how they do that), such as http://lndhub.io/, so we wouldn't want the wallets exposed there.

With regards to the wallets, if we did have a new feature, what metadata on the wallets could we surface to the new page on LNDHub, and what functions are available to call (if any) on the wallet from LNDHub?

@BenGWeeks
Copy link
Author

I also ask, as unclear if closing any channels to say lnd2.bluewallet.io, may affect the wallets balance?

@Overtorment
Copy link
Member

lndhub is just an accounting layer on top of your LND, its not opening channels, not even fully aware of channels, and has nothing to do with LND's onchain balance.
when you bought some btc, they landed directly on your LND internal onchain wallet. you own them, but you need to do something with them yourself, say, open a channel.
lndhub acknowledged the purchase and credited the same amount via its internal accounting system. so user who deposited btc onchain can spend them on lightning. but in order to do that node operator has to maintain healthy lightning channels.

node operator can do all sorts of things with LND's channels, accounting layer won't be aware of them, so no balance will go missing or smth.

@BenGWeeks
Copy link
Author

BenGWeeks commented Aug 27, 2021

OK, I am trying to reverse engineer how this works under the hood so I appreciate the info/assistance.

Maybe it isn't for LnDHub to show the wallets that are within the custody on the node, but they don't appear in LNbits either. What is the logical app on Umbrel that I should see what wallets (not necessarily balances) are on my node?

I am still perplexed why the Lightning funds on the node go down when a BW user spends Sats from their device, but the node Lightning balance doesn't seemingly increase when they purchase Sats. NB When I spend from the BW App (Lighting wallet) I see the spend transaction also go out from the node lightning wallet (so expect the reverse when receiving sats through an in-app purchase in BW). The outgoing transaction is actually listed twice in ThunderHub > Transactions with exactly the same details.

@BenGWeeks
Copy link
Author

They are on the database only.

What is this database we speak of? Is this part of the LndHub application presumably?

@jblachly
Copy link

They are on the database only.

What is this database we speak of? Is this part of the LndHub application presumably?

Redis k/v store to which lndhub connects

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

4 participants