TLDR
Long time buyer, holder, and user of Bitcoin (since 2015). Absolutely zero experience with Lightning Network. I've read some entry-level tutorials but still have basic conceptual questions regarding funding, capacity, revocations, etc.
Hypothetical Situation
Let's say I run a gambling site. All business is conducted in BTC. More and more customers are asking that Lightning Network be made available to facilitate quick and cheap deposit and withdrawal of funds.
Where do I connect for maximum reach?
The tutorials always seem show to show two parties, Bob and Alice. They open a "channel" using a funding transaction. The example then typically adds in a third party (e.g. Festus) and says something along the lines of "and look, Bob can pay Festus through Alice."
The implication seems to be that the network size could become enormous, to the point where anyone can pay anyone because hey, every Bitcoin user is inevitably connected by only a few degrees of separation on the network.
But this doesn't really answer the question of to whom I, as a brand new user, should connect? I could connect to you, I guess. But maybe you're a new user too and have zero other connections. Do I connect to some sort of hub? Guess that would work but doesn't that make things overly centralized?
As a site owner (see hypothetical above), is it best for me to act as a hub and open a channel with each of my users, which means I'd have thousands of channels open? Or is it better to make a single connection to one really popular, well-connected dude? Seems like the latter, but which dude? How do I find him?
Do I always have to be online looking for cheats?
Ok, so I get that my LN peer can try to cheat me by broadcasting a settlement transaction of a prior balance state that's more advantageous to him. And I also know that his cheat TX settlement won't clear for twenty-four hours, giving me time to broadcast a "revocation" TX that settles everything in my favor instead. This is what dissuades my peer from cheating.
But this also implies that my Lightning node needs to be up 24/7, or at least never offline for more than 24 hours and, furthermore, I have to be ever vigilant to make sure no one is cheating, and execute revocations if they are. Are these assumptions correct? Does the Lightning software automate the cheat-detection process for me?
How do I Add Funds to an existing channel?
It's still not clear how to add funds to a preexisting channel. I've seen some material online indicating that a third party service needs to be paid for this? I can't imagine that's correct is it? That doesn't seem compatible with the whole ethos of LN.
Using my hypothetical example. Let's say a client opens a channel with me and sends me 1 BTC. He bets on an upcoming UFC fight (Ronda Rousey vs. Oprah Winfrey). A successful bet on Winfrey pays 15x. That means in the unlikely even that he wins, I need to have at least 15 BTC available on that channel to pay him out.
How do I add funds to the channel if he wins? Or does that 15 BTC have to be placed in the channel via the initial funding transaction?
Now, if I'm servicing all users over a single channel, that's fine. But if each user has his own channel, I'd have to fund each one with an enormous amount of BTC -- despite the fact that 99.99% of my users will never even bet on that particular event at all. That would be an inefficient use of funds. I assume there's a way to add funds to a channel after initial funding, but how?
Wallet Recommendations
I'm running on Win 2019 Server and need to be able to create channels, send funds, be notified of incoming funds, etc. using an API. Which wallet should I use for this?
With Bitcoin's first layer, I have the option of either running a full blown node or leveraging a centralized service like Electrum? Does LN have an analogous situation with two different styles of wallet?
No comments:
Post a Comment