User:Filip Simulátor
Contents
- 1 Lightning Network Channel Dynamics Simulation
Lightning Network Channel Dynamics Simulation
The Lightning Network represents a promising solution to Bitcoin's scalability challenges, enabling fast and low-cost transactions. In the Czech Republic, it's gaining practical adoption with merchants like Alza.cz, Rohlik.cz and payment processors like Qerko and GoPay.
The network consists of payment channels, direct connections between two participants. Each channel has a fixed capacity, representing the total funds locked in for transactions. This capacity is shared between the two participants, with each holding a portion of the total on his side of the channel. Payments update the balance distribution within the channel. If two participants don't have a direct channel, the network routes payments through connected channels, relying on intermediary nodes with enough capacity to complete the transfer.
What will be simulated:
A NetLogo agent-based simulation of Lightning Network payment channels that models:
- Nodes (merchants, customers, routing nodes) as agents with defined balances and behaviors
- Payment channels as links between nodes with specific capacities
- Transaction routing through the network
- Channel balance changes and payment success/failure dynamics
Goal of the simulation:
To analyze how different network configurations affect payment success rates and channel efficiency, specifically:
- Identify optimal channel capacity distribution for maximizing successful payments
- Determine relationship between node connectivity and network reliability
- Find bottlenecks in payment routing that cause transaction failures
Who would use the simulation and how it helps them:
Primary users:
New merchants considering Lightning Network adoption:
- Understand required number of payment channels
- Plan initial channel capacity requirements
- Estimate liquidity needs
Lightning Network node operators:
- Optimize channel configurations
- Understand routing effectiveness
- Plan capital allocation
Method and simulation environment:
- Method: Agent-based modeling
- Environment: NetLogo
Variables incorporated:
Deterministic Variables:
Number of nodes (N):
- Initial setup: 100-200 nodes
- Based on small subset of real network for feasibility
- Can be adjusted via interface slider
Initial channel capacity (C):
- Range: 0.001 - 0.1 BTC per channel
- Based on average values from 1ML.com statistics
- Set at channel creation time
Node types:
- Merchant: 20% of nodes
- Customer: 70% of nodes
- Routing-node: 10% of nodes
- Proportions based on network analysis papers
Base fee per transaction:
- Default: 1 satoshi base + 0.001% of amount
- Based on common Lightning node configurations
Network topology structure:
- Average connections per node: 3-8
- Based on observed network patterns
- Follows power-law distribution
Random Variables:
Transaction amounts:
- Distribution: Log-normal
- Mean: 50,000 satoshis
- Standard deviation: 25,000 satoshis
- Based on public Lightning Network statistics
Transaction timing:
- Poisson distribution
- Mean arrival rate (λ): 0.1 transactions per node per minute
- Can be adjusted via interface slider
Channel balance fluctuations:
- Random walk within channel capacity
- Step size: Normal distribution (μ=0, σ=0.01 × capacity)
- Updates every simulation tick
Node connection preferences:
- Probability of connection decreases with distance
- Weighted by node type and existing connections
- Uses preferential attachment model
Payment success probability:
- Base probability: 0.95
- Modified by:
- Channel capacity utilization
- Path length
- Node type
Data sources for variable values:
Network structure and capacities:
Public Lightning Network explorer (1ML.com):
- Current number of nodes (~17,000)
- Average channel capacity (~0.03 BTC)
- Node distribution and connectivity patterns
Mempool.space statistics:
- Total network capacity
- Channel count
- Node count
Transaction patterns:
- Public Lightning Network statistics from Bitcoin Visuals (bitcoinvisuals.com)
- Academic research papers on Lightning Network analysis:
- "Lightning Network: a second path towards centralisation of the Bitcoin economy" (Lin et al., 2020)
- "A Quantitative Analysis of Security, Anonymity and Scalability for the Lightning Network" (Tikhomirov et al., 2020)
Simulation behavior formulas based on:
Payment routing:
- Lightning Network specifications (BOLTs) from lightning-rfc repository
- LND implementation documentation
- Published research on routing behavior
Channel balancing:
- Lightning Network whitepaper formulas
- Public node operation best practices
- Academic analysis of channel dynamic