Featured Post
Friday, September 29, 2023
Hash Time-Lock Contracts (HTLCs)
Lightning Network Channel Strategies
As I await my Raspberry Pi and other components, I am preparing for opening channels. Sounds like there are a lot of strategical considerations here. I'll put the questions roughly in the order I thought about them.
- "How many Satoshis should I put in each channel?" The range that most podcasts, sites, and videos mention is 500,000 to 1,000,000 Sats (0.005 to 0.01 Bitcoin). I believe that the idea is to make the on-chain transfer (and its fee) relatively small compared to the funds sent to the channel. If I open a channel with a size of just 10,000 Sats and the fee to create it is an additional 5,000 Sats, that channel has to earn 50% before it has paid for itself. Remember, also, that the channel's closing will create an on-chain transfer with another fee. So, a smaller channel may make no income once you account for the cost of its opening and closure.
- "How many channels should I open?" There seems to be good return on the first 20 channels. By that, I mean that each new channel brings your node closer to the center. After that, the returns--the movement toward the center, toward being a key node--diminish. It seems that 20 to 40 is a good number to help your node be more central and connected while being enough that a person could still manage them (see bullet point below or a later post).
- "What makes a quality node (yours and one with which to open a channel)?" There are several factors. It seems that the two big ones are up time (time the node is running, connected to the network, and ready to do work) and centrality. Also consider what their fees are, to whom they are connected, channel age, node funding, and channel balance.
- Centrality: There are different measures of centrality, but it seems to be whether your node is more likely to be chosen to complete transfers. If I'm only connected to Frank and Sue, and none of us are connected to anyone else, we are entirely useless to the network as a whole. And, so, I expect our centrality score would be bad. If I am a potential path between people that want to buy merchandise from a retailer, and I can keep that channel funded well, that may cause my node to have a better centrality score.
- Up time: A key here is to have your node running and connected as much as you can. Once the blockchain is downloaded, I am considering getting a mobile hotspot and a back-up power supply (something like this). The hotspot and the node should not take much energy, so even a smaller backup should keep them both running for many hours during an outage.
- Fees: You can see the fees that other nodes are charging for their traffic. Is it very out-of-whack compared to peers? That might be a red flag.
- A node's connections: The node that you are considering, to whom is it connected? I'm still learning the importance of this, but I believe that you are looking for a node that will give you access to areas of the network that are not very connected to you yet.
- A node's channel's ages: Channels that are lucrative or otherwise helpful (gives one access to new areas or other nodes) are less likely to be closed by the nodes on either side of the channel. You can find the age of channels that have been opened by the node you are considering.
- Node funding/balance and channel balance: These are related somewhat. First, if a node as a whole is funded with only 10,000 Sats, it isn't going to be able to do much on the network. If you connect to it, it can only route through you transaction(s) less than or equal to 10,000 Sats before it has run out of funds in that direction. If a node only has a few channels and they're all funded in only one direction, it may not be as helpful as one that has the same number of channels that are better funded in both directions.
- "Are there different 'kinds' of nodes?" All nodes are basically doing the same thing: routing Bitcoin through their channels. However, I read about different channels:
- Heavy outbound new channel: This can be a "fee-farm." It could be a channel you open to an online merchandiser who accepts lightning payments. You'll have to monitor such a channel, for it may be drained of outgoing funds. If you fund it with 1 million Sats, for example, and that much Bitcoin is routed through you for purchases at that store, then your outgoing funds are empty; that 1 million Sats will be on the merchandiser's side because they received them as payments. A way to balance this is to increase the fees that your node will take for that channel's traffic. Increase it a bit to balance income versus traffic. I have to read more about what to do when the channel is empty on your side. Some sort of rebalancing?
- Heavy inbound new channel: This may mean that others think that you have a quality node. This did not cost you anything to open (the other node opened the channel to you and funded it). There is really no need to close this, even if it is inactive. It is just sitting there, for free, waiting to be used. Speaking of balancing/rebalancing, such a node can be used to rebalance in a way I don't yet fully understand.
- 2-way channel: This is a great thing to have. You and the other node are earning Sats through this node, and it is good to keep it going. A node only earns Sats on outbound traffic, so a 2-way channel is benefitting each of you about half the time.
Learning More about Lightning Network
Making a Node with Raspberry Pi
The first video I found was by Red Beard Engineered. It is brief, less than 9 minutes, but nicely shows how a person can simply set up a Bitcoin (BTC) Lightning Network (LN) node.
The kit that he bought was a package deal still available on Amazon. I bought that this week. The only thing that the package lacks is the hard drive. It seems cheaper to get an internal drive and a case in which to put it compared to the cost of getting an external drive.
He recommended the 8 GB Raspberry Pi 4 (that package linked above). He also recommended getting at least a 2 TB drive. The node will download its own copy of the BTC blockchain (about 500 GB in August of 2023). Also, the OS and other apps will take up some space. I decided to get a 4 TB drive so that I would have plenty of space for other apps and for growth of the blockchain.
The OS that he used on his Raspberry Pi was Umbrel. The process for installing it on the Raspberry Pi looked simple, and he goes over that in the video above, too. This seemed to be something that I could easily do.
I ordered this drive and this case. Except for maybe needing a USB cord if it doesn't come with those items, I should have all necessary parts by early next week. In the meantime, I started listening to podcasts and watching videos about LN.
Lightning Network Discussions
Tour of Just for Krypto's Mine
Last week, I attended a tour of Just for Krypo's mining facility with the MN Crypto Council. They have 4,300+ miners (almost all BTC miners) in their facilities. They have a whole wall of air-cooled miners with a "cold" and a "hot" side. Video below is our group on the hot side.
Like part of a Borg ship |
Close-up of the bath |
Outflow was about 120 - 130 degrees F |
An outdoor mining container |
Before entering the container |