paint-brush
Hackable Blockchains Simulationsby@web3scout
1,056 reads
1,056 reads

Hackable Blockchains Simulations

by web3scoutAugust 22nd, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Distributed consensus/network simulation/visualization framework forcecons-sim. Network level and 51% attacks can be simulated/visualized. Fork on github change rules, see reluts. Challenge is open how to build unhackable distributed networks. DYOR!

Coin Mentioned

Mention Thumbnail
featured image - Hackable Blockchains Simulations
web3scout HackerNoon profile picture

https://web3scout.github.io/forcecons-sim/

How does distributed consensus aka blockchain protocol work? DYOR!


What’s consensus? An ability of a distributed network of nodes to achieve correct and equal result(s) under external/internal attacks and failures.


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.


Forcecons-sim is a distributed consensus/network simulation/visualization framework, 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

Each node: run, rm

Attacks: split, power

Settings: az - auto zoom, gX - views on row



Each node has a number (0) and id (1df3be82..)

Blockhain is a graph (DAG)

Each block is a vertix (color defines block producer): bk#Number[bk_hash->prev_bk_hash].producer


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 (OWASP). Each node must be protected.


Links

https://blog.trailofbits.com/2022/06/21/are-blockchains-decentralized/

https://bitcoin.org/bitcoin.pdf


Also Published Here