TLDR;
View this gist. It's a python program that runs through various TXN simulations to compare fees of various coins and wallets. Rates are based on late June pricing. Jump to Results section below.
Lighting network simulator
This is a very simple python program that will simulate a few conditions. For the ground work lets set up an Alice and Bob story.
Bob's friend Alice sets up a coffee shop. She is going to start taking cryptocurrency at the coffee shop, so she is set up to accept Bitcoin Cash (BCH) and Bitcoin Core via Lightning (BTCLN). Bob has a substantial holding in both BTC and BCH, though it is all in cold storage in a HW wallet. He does have a Coinbase account but is always very careful to calculate trading fees. So now Bob wants to determine what would be the best way to get ready to move his daily coffee patronage to Alice's shop.
Looking over his past expenses on morning coffee, he decides that 20,000 satoshis (BTC) should be a nice round number for lattes and perhaps 19,000 for coffee. Since BTC is trading at $10,600, his budget in terms of fiat comes out to just about $2 a day. With his budget in hand, he goes about reviewing the BCH and BTCLN payment options. He suspects BTC (mainnet) is too costly since he doesn't want to leave Alice with low priority economical transactions to chase.
Bitcoin Cash
His simplest solution of course is just to move BCH from his HW wallet (cold) to his mobile wallet (hot), but he wants to keep his BTC and BCH accounts fairly balanced and doesn't want to deplete his BCH funds entirely. He also wants to pay Alice in both BCH and BTCLN since she seemed excited about her new Point Of Sale system. He had thought about converting some of his BCH to BTC, though he realizes that there is always a cost for this on Coinbase (usually 0.15%).
Eclair LN Wallet
The next wallet Bob looked at was the Eclair mobile LN wallet. This would be simplest to fund with BTC which of course would have costs in moving funds from his HW wallet to Eclair, and then even more costs opening and closing a channel. He also noted on the github for the project that many LN wallets do not allow fees to be set on channel close operations. This might get costly as market fee rates rise.
Wallet of Satoshi, funded by a BTCLN exchange.
Another popular LN solution is Wallet of Satoshi (WoS). WoS seems like a simple solution since it doesn't have the same constraints on incoming and outgoing capacity like Eclair does. There is also no need to do any complicated channel setup since it is custodial and that is all just handled. Bob does realize that WoS funding options might be costly. He researches to ways to load and unload WoS using the FixedFloat exchange as well as the bitrefill Thor channel services.
FixedFloat for BCH funding and withdrawals from WoS
As noted before with WoS, LN transactions are seamless enough, but WoS has no way to convert funds back to BTC. For this we have to use a LN exchange. FixedFloat is a fairly reasonable exchange offering competitive exchange rates and a 0.5% fee. To convert funds from BTC, WoS has offers a comptitive rate of 0.3%, so obviously this is the simplest way to fund the wallet.
Bitrefill for BTC funding
Although not a verify competitive option, the Bitrefill funding option is included here just to see how it stacks up to the others.
Results
I've included two runs of the simluator in LibreOffice format. They should be viewable in Google Sheets, Excel or LibreOffice
Latte (without bugfix)
This simulated buying lattes (20k sat) and compared the cost of using various wallets. Important inflection points that were found:
- 17 cups / 3.6 mBTC - If spending less than 3.6 mBTC, it is cheaper to convert the BTC to BCH and just use a BCH wallet. At 17 cups however, using the WoS LN wallet is the cheapest way to spend BTC.
- 39 cups / 8.0 mBTC - If spending less than 8.0 mBTC, it is cheaper to fund your WoS LN using BCH. At 39 cups it becomes less expensive to use BTC to fund your WoS LN wallet.
Coffee (with bugfix)
This simulated buying coffees (19k sat) and compared the cost of using various wallets. Important inflection points that were found. This simulation did assume that the expensive channel close bug in Eclair was fixed:
- 4 cups / 1.9 mBTC - If spending less than 1.9 mBTC, it is cheaper to convert the BTC to BCH and just use a BCH wallet. At 4 cups however, using the WoS LN wallet is the cheapest way to spend BTC.
- 41 cups / 8.0 mBTC - If spending less than 8.0 mBTC, it is cheaper to fund your WoS LN using BCH. At 41 cups it becomes less expensive to use BTC to fund your WoS LN wallet.
- 853 cups / 163 mBTC - If spending less than 163 mBTC, the average TXN cost of using BCH is cheaper than using BTCLN. At 853 cups however (yikes), it is cheaper to use BTCLN for coffee than to use BCH.
Files
+README.md
- This file (named for sorting)lnsim.py
- The python file to run the sims, produces CSV to stdoutlatte.ods
- LibreOffice file of sim run for latte prices (no bugfix applied). Selectview-raw
to download.coffee-bugfix.ods
- LibreOffice file of sim run for coffee prices (w/bugfix). Selectview-raw
to download..gitignore
- A git artifact, as it suggests... please ignore.
Usage
To run this, do the following:
git clone https://gist.github.com/brianddk/1f339832a677aa941c7c16a7aeac8735 lnsim
to get files.- Edit
lnsim.py
and update the defines at the top of the file to your liking python3 lnsim.py > results.csv
orpython.exe
in windows- Open
results.csv
in LibreOffice, Excel, or Google Sheets
[link] [comments]
source https://www.reddit.com/r/btc/comments/c8hvke/btc_lightning_network_vs_bch_coffee_shop/
No comments:
Post a Comment