I'm trying to grasp all the various complexities of Lightning, and I have stupid convoluted questions every day. Today's is: SQ. So lots of wallets have both Lightning and Bitcoin, right, now are they 2 separate wallets or one single wallet? Like, if I have some bitcoin in my BlueWallet bitcoin wallet, and then add a BlueWallet lightning wallet and send some sats to it, then is there a combined bitcoin+lightning balance? Probably two separate wallets, as they display separate amounts, but why is that? Isn't Lightning just another window to the same counter at your bank? And if it is not, it should be, right?
Ok, different phrasing, suppose I have 1 BTC somewhere, and I want to save it on BlueWallet, I send it in chunks, some to the BlueWallet-Bitcoin and some to the BlueWallet-lightning. Why should I keep them separate, and not put them in one or the other? And if I had to keep all 1 BTC in either one of them, which one should it be, and why?
Sorry, this is how most brains work!
It's a little complicated technically it's all UTXOs attached to a public key, your lightning balance however, is a UTXO locked in the lightning network so it can interact with that environment
So your on-chain balance and your lightning balance are separate.
You would keep your lightning balance separate because you plan to do micropayments or use lightning apps like Stacker news, your on-chain balance would really be for hodling, large payments where Lightning doesn't have the liquidity to match it or you want a final settlement confirmation that the base chai offers
If you don't know how to create channels or don't want to bother, you can always use a submarine swap service, so you send BTC on LN and get onchain BTC in return and vice versa.
I don't use blue wallet so I can't speak directly to the UX and set up of that walelt.
I hope that helps
reply
Yeah, so on-chain is the smart option for large sums, because liquidity is not huge on lightning, so it's like the savings account, and to save transaction fees, a small spend-budget in the lightning option, like a current account, thank you.
reply
I use bluewallet daily.
Bluewallet supports two kinds of wallets: on-chain and custodial-lightning. Other lightning wallets support noncustodial lightning, but let's not go there for now.
In-geneal, BlueWallet isn't for HODLing multiple bitcoin because you're carrying it around with you all the time in your phone. For that you want something that supports offline wallets (like Sparrow). If you want to keep it simple, pull your sim card on an old phone, wipe it, install bluewallet and use it like a hardware wallet. Be sure to write down your keys and keep it in multiple safe places. Be advised, a multisig wallet isn't quite what you expect, you need to store a special file in addition to your key phrases.
Bluewallet on-chain wallet support is excellent. They support many important features and the interface is very good. You can also run your own electrum server and connect your bluewallet to to in order to keep your wallet addresses private.
A lightning node is built around two kinds of bitcoin wallets: a regular single-signature wallet, and several two-signature wallet with a contract called a HTLC. The two-signature wallets are also called payment channels, and this is how funds are exchanged between nodes.
Lightning on the backend is built on this idea, a shared wallet with a digital contract (HTLC) that has a "don't screw me" clause built-in. That clause needs to have enforcers on the network, and they have to know details about your private transactions in order to do so. The enforcer of your contract can be your node, or something called a watchtower. A watchtower is like having a backup-node on the internet to keep your wallet safe.
There are two ways to get funds into your lightning wallet: Either someone fills up available inbound liquidity on one of your lightning payment channels by paying your invoice, or you send on-chain funds to your node's single-signature wallet. At a later time you can assign these single-sig wallet funds to a new payment channel, but you can't move them to one of your existing payment channels without standing on your head (loop-in).
Bluewallet's lightning interface is very high-level. It does not expose these details about payment channels, on-chain wallets, or much of anything. You can do three things with it: pay or accept lightning payments, and add on-chain funds. All of the lightning backend stuff like opening and observing payment channels on your node are not accessible from bluewallet. Bluewallet is designed to keep these details hidden so all your grandma needs to know is how many sats she has in her wallet and how to scan a QR code to pay for your happy meal.
With bluewallet lightning YOU MAY be the custodian by running your own node and then create a lndhub wallet on it with your app. Alternately (and by default) the wallet will use bluewallet's managed lightning node and wallet service. Its called LNDHUB. Basically whoever's lndhub server you're using is where your lightning sats reside and its fundamentally a 100% reserve bank. You have to trust who ever is managing the lightning node, and that they won't operate at fractional reserve. They can if they want to and theres no way for you to know.
I really like bluewallet and lndhub because I run my own lightning node with my always-on server so I know where my bitcoin is at all times. Without running your own umbrel, start9 or raspibolt, you are trusting bluewallet to keep your sats safe. You may choose to do that, and that's fine, but as they say: "not your keys, not your bitcoin" so keep your funds there as low as practical.
reply
Thank you so much everyone! I will need to train my brain to take the pain of understanding the concepts in your posts. And I will! This is all very good information!
reply
Under the hood, lightning channels have their own addresses for funding. It is technically a Bitcoin address, but wrapped in a 2x2 multisig contract with another signer. That is what initiates the "channel" between both parties.
The sats in the channel are like a line of credit, backed by the Bitcoin that is locked in the channel. When you are sending sats, you are really updating the 2x2 contract of who gets what amount of the Bitcoin locked in the channel. When a channel closes, that contract is finalized and pushed to the blockchain, with the Bitcoin divided up and spent to the output addresses for each signer.
So the question you should ask is: Do you want to lock up all your Bitcoin in a lightning contract? These contracts can take two weeks to close if the other signer is unavailable, and there's still risks of losing your coins if the keys (managed by your lighting node) are lost in some catastrophic way.
I wouldn't lock up more coins than you really need to use for daily spending, there's no upside yet potential risks and downsides, however small.
Now if you are running a routing node and providing liquidity to the network, that is a different story.
reply
So on chain is the way the media says it long time to settle (10min) lightning is instnat settlement for micro payements i too am learning and so this i have gained as far as submarine swaps I usually use Muun wallet right now although I keep seeing how fees r crazy high to do so have been looking into running my own lightning node have btc node thru umbrel now just need to set up lightning and use that u would load up with lets say 2 million sats and use for spending and recieving payements where u urself control the fees also seeing comment earlier u can convert coins from on chain to ln it seems with the node ok ok ! Hope this helps!
reply
Is the bitcoin-BlueWallet supposed to be like the Savings Account (for long HODL) and the lightning-BlueWallet supposed to be like the Current Account (for daily spending and shopping and transfers?)
reply
On-chain bitcoin, the old regular kind of wallet, involves two steps to recieve a balance, and 5 steps to send.
To receive:
  1. Get a address from your wallet for your transaction
  2. Give the address to whoever you want to pay you.
Anyone with that address (public key) can see how many funds have gone into or out of that address and that information is public and available until the end if time.
To send:
  1. Get an address from someone you want to pay
  2. Put the address and the amount of bitcoin you want to send into your wallet with sufficient funds.
  3. Choose how much you want to spend for the transaction fee. When there is a large backlog (sometimes weeks) a cheap fee of 1sat/byte will stay at the end of the queue until the demand for transactions falls back to create smaller-than-maximum sized blocks every 10 minutes. The purpose of the fee is to get at the head of the mempool so you have a better chance at getting into the next block.
  4. Sign a transaction with your private key (unlocked with a password) transferring from your wallet addresses to the recipient's address. This is called the UXTO
  5. Most wallets do this behind the scenes, but others like sparrow you do it as a separate step. Transmit the UXTO to the "mempool", this is called 'broadcasting.' The mempool will hold your transaction for several block times (diffivulty is adjuster to achieve an average 10 minutes between blocks) until a miner grabs it and finds the sha256 hash of a nonce, timestamp, and combination of UXTOs that satisfy the present chain-difficulty level. You have a chance to make the next block every 10-or-so minutes. There is a memory limit to the mempool, so if your fee is low, your UXTO could get pruned after a time if the pool is full and most other transactions have a higher fee payout. If your transaction is pruned, you may need to perform some manual steps to rebroadcast it at a later time.
  6. After your UXTO is included in a block, you wait a few more blocks for that block to be included as an ancestor of a subsequent blocks. These descendants of the block your UXTO is in are called "confirmations". Since some recipients insist on 6 confirmations, your transaction time will require 6 block times after your block is accepted by the network. Each block time is 10 minutes, so 6 blocktimes is one hour.
With bluewallet, all of these backend details (step 4) are handled with an electrum server. Bluewallet by default randomly selects from the public electrum pool or you could configure it to use your own private electrum node.
In summary, under ideal conditions, it takes about an hour to get your bitcoin sent with several confirmations. Under worst conditions, it could take weeks to get out of the mempool and into a block. This is why we have lightning.
reply