Distributed consensus/networks simulation framework: forcecons-sim
What’s consensus? An ability of a distributed network/system to achieve correct result(s) under external/internal attacks and failures.
All of us participated in a voting, hands rising and counting. Perfect conditions, everyone can see everyone, no middleman, no cheating. Majority of votes 1/2+1 to make a decision.
Remote voting is different, distributed cryptographic protocol is needed to prevent attacks and tolerate failures.
Forcecons-sim is a distributed consensus/network simulation/visualization framework, github repo.
Network level attacks/failures. Network split/combine simulation.
1st group (4 nodes)
2nd group (3 nodes)
Orphan chain ( at the bottom, 2nd group nodes) data is lost, final chain after split recovery (at the top) is the same for all nodes.
After split recovery (chain is the same for all nodes).
Individual links between nodes can be removed/recovered, if connectivity is kept (indirect), consensus is achievable.
Most simple but working consensus mechanism is analyzed, rules:
- Genesis block is the same for all nodes.
- Nodes can produce new blocks and broadcast to network.
- Nodes can accept new valid blocks from network.
- Node can get blocks from any node (sync).
Block confirmations are next blocks (simple rule). Last block is selected on longest chain rule. Uncertain finality (history can be rewritten).
Cryptography. All messages are digitally signed/verified (not in simulation), each block contains hash of previous one, except genesis block #0.
Power attack (>1/2), block production power at a higher speed is concentrated in one hand (red node).
If somebody produces blocks faster than rest of network that means any history can be rewritten.
1/2 attack or 51% attack is impossible to resist without a game changing hack (know how). Don’t forget one hand can control as many nodes as needed (sybil attack).
Links
Are blockchains decentralized?
Fact Check: DARPA Funded Report on Blockchain Centralization