How does distributed consensus aka blockchain protocol work? DYOR! An ability of a distributed network of nodes to achieve correct and equal result(s) under external/internal attacks and failures. What’s consensus? All of us participated in voting, hands rising and counting. Perfect conditions, everyone can see everyone (all-to-all data exhange), 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. is a distributed consensus/network simulation/visualization framework, . Forcecons-sim github repo Simulation controls and settings Nodes: run // run all nodes stop // stop all nodes add // add new node rm // remove node Links: add // add new link rm // remove link run, rm Each node: split, power Attacks: : az - auto zoom, gX - views on row Settings Each node has a number (0) and id (1df3be82..) Blockhain is a graph (DAG) Most simple for simulations consensus mechanism is analyzed, rules: Genesis block is the same for all nodes. Nodes can produce new blocks and broadcast them to the network. Nodes can accept new valid blocks from the network (and get all previous blocks if necessary to build a chain). Nodes can get blocks from any node. Longest chain rule. Block confirmations are the next blocks (simple rule). The last block is selected on the longest chain rule. Uncertain finality (history can be rewritten). These rules are for simulation/visualization purposes only, in production systems they are a lot of more complex including proofs (PoX). Attacks simulations Red node attack. Red node has the computing power to produce blocks faster than the rest of the network. All history can be rewritten by the red node. It can be done by sending one-by-one blocks, or an alternative chain can be precomputed and send only the last block. According to the rules, all other nodes must accept the new chain. Distributed consensus can be successfully attacked by network manipulations and (51% power attack). Classical cybersecurity attack vectors are here as well ( ). Each node must be protected. OWASP Links https://blog.trailofbits.com/2022/06/21/are-blockchains-decentralized/ https://bitcoin.org/bitcoin.pdf Also Published Here