## Setting minimal amount of nodes to reach consensus

1

Is the minimal amount/percentage of nodes that need to agree configurable in a blockchain genesis file?

As far as I can find there is no setting for this, and I assume this is set somewhere in the sourcecode?

Are you asking about Bitcoin or some other blockchain? – David Schwartz – 2016-09-12T11:25:46.887

## Answers

1

That's not how consensus works in Bitcoin, as that would be highly vulnerable to a sybil attack.

First a full node validates all aspects of all blocks (incl. transactions) it receives. Anything invalid is discarded and not further considered.

Second the node picks the chain with the most total Proof of Work in it*. Usually there's only one, but sometimes two miners find a block at roughly the same time, so the blockchain temporarily forks until the next block increases the total PoW for one of the chains and all nodes will converge on that chain.

TL;DR The valid chain with the most total Proof of Work

*) Often referred to as the "longest chain" or better "longest valid chain", although strictly it's not about the length, but about the aggregate difficulty.

Could you explain how this (not) relates to a 51% percent attack? Is there any 51% coded anywhere? Or is this just a rule of hand? – BlockChange – 2016-09-12T09:42:21.857

51% stems from the fact that if you have enough hashing power, you can essentially outrun everybody else. So you might decide to ignore someone else's block and instead create your own competing block, knowing that (eventually, it might take a while) you will be able to create the most-work chain that everyone else will accept. So 51% (technically anything above 50%) is just a fact of nature, not a setting. – Jannes – 2016-09-12T10:40:19.090