> Satoshi from the Bitcoin white-paper chapter 12 'Conclusion' : The network is robust in its unstructured simplicity. _Nodes_ work all at once with little coordination. They do not need to be identified, since messages are not routed to any particular place and only need to be delivered on a best effort basis. _Nodes_ can leave and rejoin the network at will, accepting the proof-of-work chain as proof of what happened while they were gone. They vote with their CPU power, expressing their acceptance of valid blocks by working on extending them and rejecting invalid blocks by refusing to work on them. Any needed rules and incentives can be enforced with this _consensus mechanism_.
First, you have to understand what 'consensus' actually means :
> A fundamental problem in distributed computing and multi-agent systems is to achieve overall system reliability in the presence of a number of faulty processes. This often requires processes to agree on some data value that is needed during computation. Examples of applications of consensus include whether to commit a transaction to a database (or, for example, committing blocks to a blockchain), agreeing on the identity of a leader, state machine replication, and atomic broadcasts. The real world applications include clock synchronization, PageRank, opinion formation, smart power grids, state estimation, control of UAVs, load balancing and others.
What does this mean if you are but an intrepid traveler amongst the erstwhile numpty-folk?
Nodes are agents in a multi-agent system with an agreed set of consensus rules (https://www.cryptocompare.com/coins/guides/how-does-a-bitcoi...), which they and they alone enforce, that ensure that the system functions. Transactions are propagated through the multi-agent network based upon the agreed consensus rules by nodes, which are agents in a multi-agent system. Miners retrieve valid transactions from any of these nodes, which are agents in a multi-agent system. They then order the transactions, and perform a hashing function on them until the hashing function returns a value that is suitable to the nodes, which are agents in a multi-agent system. They then pass the new block that they've created to the nodes, which are agents in a multi-agent system. The nodes, which are agents in a multi-agent system, then validate the block to ensure that each of the transactions within the block agree with the consensus rules. Then the node, which is an agent in a multi-agent system, extends the block-chain by attaching the new block to it. They then pass the new block, if it is valid, to other nodes, which are agents in a multi-agent system. Then each of these other nodes, which are agents in a multi-agent system, each do the same validation on every block.
Nodes accept incoming transactions and validate them. Miners don't. Nodes replicate transactions to other nodes. Miners don't. Miners take transactions from nodes, and order them in a block, and perform a hashing function on them (the only thing they do). Miners pass the new block to the node. The node validates the transactions in the block. Miners don't. The node validates the block. Miners don't. The node extends the blockchain. Miners don't. The node replicates the block to other nodes. Miners don't. It is the validation of the nodes, and their CPU's, that define and police consensus in bitcoin.
There is only one function that miners do. They take transactions, put them in a block, and hash them. As soon as a miner produces a block that nodes don't want, it is rejected. Miners work. Nodes validate. So nodes are the proof in proof-of-work.
Nodes accept the transactions, validate the transactions (using their CPU), replicate the transactions, maintain the mempools, validate the blocks (using their CPU), extend the blockchain (using their CPU), replicate the blocks, serve the blockchain, and store the blockchain. Nodes even define the PoW algorithm that miners have to employ. If you can't convince these node owners that are using their node on a day-to-day basis, to uninstall their node software and install your new node client, especially when that node client decreases their node security and decreases the network security, any change you have is going to go exactly nowhere.
So nodes maintain the protocol, not miners. It is thus. It has always been thus. If you can't convince all of those node owners running their node clients to uninstall one client and re-install another, any change you have to consensus is DOA.
See for yourself. Download it. (https://bitcoin.org/en/download) It's currently at 0.15.1
> A full node is a program that fully validates transactions and blocks. Almost all full nodes also help the network by accepting transactions and blocks from other full nodes, validating those transactions and blocks, and then relaying them to further full nodes.
Changing the PoW algorithm (your example) would require these powernodes to vote for their own abolishment, if their $100M worth of ASICs can't support the change. So it's very unlikely.
Such a miner could do a double-spend transaction by first spending on the short chain and then reverting his transaction on the longest chain. See https://en.bitcoin.it/wiki/Majority_attack
> Nodes even define the PoW algorithm that miners have to employ.
Nodes change PoW algorithm and the old miners have expensive loud space heaters. They know this, which is why they didn't follow through on 2x. They knew that threatening that attack leads to one outcome : ruin.
It's a complex subject, sure. But I can't force you to understand how bitcoin works dude.
Satoshi's brilliant solution to the Byzantine generals problem of consensus is proof of work, not "nodes decide what code to run" precisely because nodes are vulnerable to sybil attacks.
-How would these nodes know that the 51% attack history is bad?
-A proof of work change is a hard fork, and these take months to deploy properly according to core.