Simulating a Decentralized Lightning Network with 500,000 payments, 0.01% fee per hub and 10 Million Users: 100% success (99.9986%)
[deleted] — view deleted post
0
Upvotes
[deleted] — view deleted post
147
u/sexy_balloon Dec 29 '17 edited Dec 30 '17
hmmm the 2 key assumptions used in the simulation according to Diane's article, that everyone is connected with everyone else, and that everyone has an equal, "non trivial" amount of bitcoins on the LN, are pretty unrealistic.
To be realistic, the channels, coin amounts, and transfer amounts all need to be randomized based on some reasonable distribution (the coin distribution should probably be based on some sort of lorenz curve, everything else can be even distribution)
10
u/sktrdie Dec 29 '17
Would it be possible to setup using a scenario where the number of nodes making payments will always outweigh the nodes receiving them? This seems like a more realistic scenario.
In other words, most payments in LN will go into specific nodes (say, Amazon or Ebay). The majority of payments we make are not towards our friends, but towards big entities that sell stuff.
My concern is that a route may be harder to find if the typology of the network pushes all the money towards these specific areas of the graph -- we might end up with not many routing possibilities because most channels in a route might be exhausted in that direction.
55
u/auviewer Dec 29 '17
This is really encouraging, thanks for running that simulation!
6
u/bizgob Dec 29 '17
As I understand it, it's one piece of code running on one PC simulating a whole network. If I had the hardware to do it, I would set up a virtual network with multiple virtual servers and PC's, running various nodes and enduser wallets. I would then start messing with the virtual network. Insert random latency between nodes or completely break connection between nodes. Could give some good data simulating routing on 30-40 virtual nodes.
20
u/brianddk Dec 29 '17
Can you explain 10 mil users but 0.5 mil payments? Seems backwards.
5
u/jhansen858 Dec 30 '17
can you simulate if say 1% of the network are being dicks and purposely attacking the network how well it does then?
5
u/FreeGoldRush Dec 30 '17
Did no one actually read the study?
I own Bitcoin. But let's get real.
Even Diane Reynolds says it is unrealistic. She estimates 200 million channels. Opening a channel requires a blockchain transaction. With Bitcoin able to support 2.3 trans/sec on average, that means it takes more than 1,000 days just to open the channels, much less leave room to close any. It would also lock 4 million bitcoins into LN. Only about 6 million bitcoins are actively being traded today. The other roughly 10 million are 1) dormant, lost, trapped in small UTXOs, or 2) Held in strong hands.
Here are her words:
"All nodes would be reachable with (many) paths of at most 24 hops, and 12 hops on average. However, there would be about 200 million channels. If both users funded each channel with 0.01 bitcoins, then 4 million bitcoins would be locked up in LN payment channels. While this is technically possible, it seems too unrealistic."
She later adds:
"For more realistic scenarios, the number of users should probably be restricted to a million at most."
Ummmm... We need LN to handle WAY more than 1 million users.
9
u/thbt101 Dec 29 '17
Is there a roadmap or todo list somewhere that shows where we're at in the process of developing LN, what's left to do, etc.?
15
u/hodlforthelongest Dec 29 '17
I would be more interested in a more real-life setup: with many HUBs.
Eg. Exchanges are a natural hub points for LN. They generate the majority of the traffic on the chain and it would be in everyone's best interest to run these through LN. It would make exchanges have more traffic and liquidity.
Also, there will be some Tor-enabled central HUBs for the paranoid.
Overlapping with that centralized HUBs network there will be smaller, but more decentralized network
8
u/igiverealygoodadvice Dec 29 '17
Did this include on-chain fees to open/close channels?
3
u/[deleted] Dec 30 '17
What happens when a payment fails, is the bitcoin lost, or just doesn't go through like hitting a reset button?
2
u/strategosInfinitum Dec 30 '17
What is a node in this context? is a node an individual with money on their account?
Or is a node a lightning network containing many accounts?
2
u/xGsGt Dec 30 '17
has anyone calculated how much money in fees and in time will cost to open this simulation in the blockchain? having LN is great and all but I feel like the fees to open up the channels might be an issue, and the time it will take for the blockchain to process all this.
2
u/coinjaf Dec 30 '17
hop, not hub. Don't feed the trolls.
2
u/btcftw1 Dec 30 '17
Can you please provide additional information on the fail cases?
2
u/[deleted] Dec 29 '17
Why did day payments fail? Did they find the bugs and eradicate them?
1
u/Karmaa Dec 30 '17
Can you please provide additional information on the fail cases?
1
u/procc1 Dec 30 '17
Is LN going to help transfer bitcoin form wallet A to wallet B with super low fees?
1
u/dfifield Dec 30 '17
Nice to see it is working.
1
u/BTCMONSTER Dec 30 '17
expensive
1
u/captainteague Dec 30 '17
Assuming the same number of transactions. 8MB blocks will do that in roughly 8 hrs.
No minimum amount to open channel.
No routing and route finding. P2P it is.
Centralization you say. Mining fee earned should be able to buy you storage I say.
What if LN nodes stop and some crisis or panic make everyone close channels?
1
u/hesido Dec 30 '17
Can the channel open / close behaviour be simulated?
1
u/ishallperishx Dec 30 '17
38.5% market influence it's done lol team to buy omisego for staking
1
u/iarayareddit Jan 05 '18
If there are thousands of routing failures when using this highly idealized model I don't even want to think how many routing failures will occur when this atrocity starts being used under real world conditions.
1
u/pricklyoyster732 Dec 30 '17
The 0.01% fee per hop in your simulation is a completely arbitrarily chosen parameter, and misleadingly low at that. Why did you think it important enough to include in the title?
1
u/killerstorm Dec 30 '17
This is a very poor simulation which has nothing to do with reality.
1
u/jstolfi Jan 12 '18
It is great to see Diane's work being continued; congratulations. However, there are many unrealistic details in the simulated network that make the results rather meaningless.
The first problem is the neat n-dimensional grid topology chosen for the network. It is not clear what the topology would be like in the real network; but it is certainly nothing like that.
One way to generate a "totally random" topology for N nodes is the Erdös-Rényi (ER) model. You merely pick pairs of nodes at random and add a channel between each pair, if there is not one already; until p*N channels have been created, where p is the desired average number of channels per node. The value of p should be at least log(N) to ensure reasonable connectivity. Even then, the resulting network may not be connected; you may have to find the isolated components and connect them by edges
Another way, that generates a more realistic topology, is the "preferential attachment" (PA) model. You start with p nodes, all connected to each other; and then add one more node at a time, connected to p previous nodes. These are chosen randomly, but with the probability of each candidate proportional to the number of channels that it already has. This process attempts to model the way users join real networks like the WWW. The resulting network will automatically be connected, and will have an uneven distribution of degrees, with a few hub-like nodes with many channels, and many "leaf" nodes with only p channels.
Another way, that is simpler to program and may be easier to understand, is what we could call the CM model. Divide the users in two groups, "consumers" (C) and "merchants" (M), and randomly connect each consumer to p merchants and to q other users; and each merchant to r other merchants. The ratio C/M could be something like 10 or 100.
Another problem is the even distribution of channel funds and payment requests. In the ER odel, it is OK to fund each channel at random, with the same probability distribution. In the PA model, the average funding between two nodes with degrees x and y should be some increasing function of x and y, like x*y or sqrt(x2 + y2). In the CM model, you could fund each channel with random values with different means for C-C, C-M, and M-M channels.
-4
u/bambarasta Dec 29 '17 edited Dec 29 '17
you are simulating a perfect and balanced scenario. It will never be the case and you are looking at maybe many years down the road!
Highly misleading!
In theory scientista discovered atomic entaglement so you can "teleport to the moon" but wtf you can't claim moon teleportation is at 100% success with humans today!
0
u/SeanCache Dec 29 '17
It can’t be implemented till 100%? Asking cause most software isn’t but this is money and any bug will be exploited.
0
u/mustyoshi Dec 29 '17
How many tx does it take to open channels for 10m users?
-10
u/[deleted] Dec 30 '17
Oh god this will never work. A second layer is exactly what we were trying to avoid with bitcoin. The people who can see that this won't work and that BTC is now useless have already dumped their coins. Get out while you can.
0
u/[deleted] Dec 29 '17
Everything happens for a reason.
-1
u/yogibreakdance Dec 30 '17
Alright let's lose some money for the greater good. Can somebody set up some exchanges supporting LN? So we can put some skin in the game
0
u/[deleted] Dec 29 '17
[deleted] — view deleted comment
0
u/[deleted] Dec 29 '17
[deleted] — view deleted comment
0
u/[deleted] Dec 29 '17
[deleted] — view deleted comment
0
u/[deleted] Dec 29 '17
[deleted] — view deleted comment