Author

Topic: Difference Between Miners and Nodes (Read 6604 times)

newbie
Activity: 51
Merit: 0
January 04, 2017, 04:09:42 AM
#10
Thank you, DannyHamilton.  A very well-written explanation that someone simple like me can understand.  That helped a lot :-)
legendary
Activity: 3472
Merit: 4801
January 01, 2017, 12:14:18 PM
#9
nodes send transactions to the miners

Miners are nodes.

Nodes verify transactions that they receive and then relay them to other nodes.  Those nodes verify the transactions they receive and then relay the transactions to more nodes. Those nodes verify the transactions they receive and then relay transactions to even more nodes, and so on.

Some of the nodes are also solo miners (or mining pools).  You can be a node without being a miner, but you can't effectively solo-mine or operate a mining pool unless you are also a node.  So, miners, or mining pools, are just special nodes that perform additional work.

who add them in a block to the blockchain, then send the block back to the nodes to validate them?

The nodes that are miners (or pools) choose which transactions to include in a block, and in doing so they set the order of the transactions (which transactions happen earlier, and which happen later).

The nodes that are miners (or pools) MUST follow the consensus rules when they build their block. If they don't then ALL of the other nodes will refuse to relay their block and the block will simply be ignored by everyone as if it never existed.  After they build the block with the transactions they wish to include, they begin the proof-of-work (hashing).  A solo miner does the proof-of-work (hashing) all by themselves.  A mining pool sends out the completed block to all the pool participants and asks them to do the proof-of-work (hashing) for them.  You do not have to be a node if you are just doing the proof-of-work (hashing) for a mining pool. If the proof-of-work (hashing) is completed before the solo-miner (or pool) receives a valid block from someone else, then you have a successful block.  The block is then sent to all connected nodes.

Nodes verify the block and all the transactions in the block, and then relay it to other nodes. Those nodes verify the block they receive and all transactions in the block and then relay the block to more nodes. Those nodes verify the block they receive and all transactions in the block and then relay the block to even more nodes, and so on.



So...

Every node verifies every transaction that it receives AND every block it receives before relaying that block to any other node.  If the transaction (or block) is invalid, then it is ignored.  It is not shared with anyone else and it is just discarded.  If the transaction (or block) is valid, then it is stored by the node AND relayed to all other nodes that are connected to that node.  In this way, every node enforces ALL of the consensus rules and prevents and node, user, wallet, or miner from sending anything on the network that breaks the consensus rules.

Miners (or mining pools) get to choose which VALID transactions get to be in the next block.  The perform a proof-of-work to build a valid block.  They will not create a block that breaks the consensus rules (since it will be rejected by all nodes), but they can enforce any additional non-consensus rules if they all agree to do so.

For example, the current consensus rules state that a block cannot be LARGER THAN 1 megabyte.  This means that miners will not create a block that is 2 megabytes unless almost all the nodes agree to the change in consensus rules (otherwise their block would be discarded by all nodes and wouldn't get relayed at all).  But, if enough of the miners (more than 50% of the global hashpower) wanted to agree to never make blocks that are bigger than 750 kilobytes, they could enforce that rule. All nodes would accept and relay the blocks (since blocks that are less then 750 kilobytes don't break the consensus rule of 1 megabyte maximum size), but the miners could enforce the non-consensus rule of 750 kilobytes.  As long as enough miners agree to enforce the rule, no miner would be able to create a larger block.  Most nodes might still relay blocks that were more than 750 kilobytes, but the miners would ignore those blocks so the blocks would get discarded as soon as the rest of the miners created 2 blocks that were less than 750 kilobytes (since the chain with the 2 new blocks would be longer than the chain with the 1 new block).

In this way, the nodes enforce the consensus rules. The miners refuse to break the consensus rules. If enough miners agree to do so, then they can enforce additional restrictions that are not part of the consensus as long as those additional restrictions don't break any existing consensus rules.


full member
Activity: 224
Merit: 117
▲ Portable backup power source for mining.
December 31, 2016, 08:52:42 PM
#8
Thanks everyone for your replies, that helps a bit.  So, nodes send transactions to the miners who add them in a block to the blockchain, then send the block back to the nodes to validate them?

Ganjamancer
Pretty much, when you broadcast a transaction, you send it to the nearest nodes. Nodes use the "gossip protocol" to relay it all over the network (each node sends it to all nodes it is connected to as soon as it receives it, unless it received it already, in which case the transaction is ignored). Seconds after you broadcast it, the transaction reaches all the mining nodes, it also reaches nodes controlled by block explorers and wallets which is why you see it on blockchain.info so quickly.
After this, the transaction waits in the mempool until a miner decides to include it in a block, the transaction is then considered confirmed (set in stone) when enough new blocks are created on top of it.
newbie
Activity: 51
Merit: 0
December 31, 2016, 08:39:47 PM
#7
Thanks everyone for your replies, that helps a bit.  So, nodes send transactions to the miners who add them in a block to the blockchain, then send the block back to the nodes to validate them?

Ganjamancer
full member
Activity: 224
Merit: 117
▲ Portable backup power source for mining.
December 31, 2016, 02:17:36 PM
#6
Miners determine the block chain consensus. If nodes determined the blockchain, an attacker could hack bitcoin by running thousands of nodes and pushing a fake blockchain.
When a new node or wallet connects to the blockchain, it connects to as many nodes as possible and requests the block headers, the one with the most PoW is accepted as the true chain, even if only one node pushes it, and 500 nodes push one with less PoW.
As Satoshi stated in the Paper, "one CPU, one vote".
When BIPs are suggested, it is miners who vote on them.
The reason for miner rule is simple, you can't pretend to have more hashes than you actually have.
legendary
Activity: 4466
Merit: 3391
December 31, 2016, 12:59:08 PM
#5
A full node validates transactions and blocks, and relays them to other nodes.

A miner is a full node that also extends the block chain by creating new blocks with the new transactions relayed from other nodes.

Since both miners and non-miners do validation, all participate in the consensus process.

Each node decides for itself which block chain is "the block chain". If nodes disagree, then there is a fork.
staff
Activity: 3458
Merit: 6793
Just writing some code
December 31, 2016, 11:28:56 AM
#4
Miners make consensus of blockchain. Full nodes are needed to spread this info about consensus to all that want to use bitcoin.
Miners do not determine consensus. They can add all the blocks that they want to the blockchain that don't follow consensus and no one has to go with those new rules. That miner will be forked off of the network by all of the full nodes who follow different consensus rules and reject that miner's blocks.

Two separate things, miners get fee for their job, full nodes are volunteers.
Miners are still full nodes. They are full nodes that do something extra and get paid for that something extra.
legendary
Activity: 2296
Merit: 1014
December 31, 2016, 03:56:33 AM
#3
Miners are a subset of nodes as all miners must be running a full node in order to mine
Miners make consensus of blockchain. Full nodes are needed to spread this info about consensus to all that want to use bitcoin.
Two separate things, miners get fee for their job, full nodes are volunteers.
staff
Activity: 3458
Merit: 6793
Just writing some code
December 30, 2016, 09:38:57 PM
#2
Miners are a subset of nodes as all miners must be running a full node in order to mine (at least to mine properly). The nodes are what determine consensus as all nodes must agree to the same rules otherwise the nodes will fork off of the network.

Miners can add blocks to the blockchain so long as every other node on the network agrees that their block fits the consensus rules and accepts it.
newbie
Activity: 51
Merit: 0
December 30, 2016, 09:15:14 PM
#1
Hi all,

  So, there is one thing that seems to have escaped me through my studies of Bitcoin.  I know the layman definition of "miner" and "node," but what confuses me is which of the two determines consensus.  I seem to recall hearing that the nodes themselves are the actual ones that determine what is in the blockchain, but then I was also told that miners do that in verifying transactions. 

In short, it sounds like it is either

A: The majority of agreeing nodes ultimately make the consensus of the blockchain, or

B: The miners up to 51% of the hashing power have consensus and determine the blockchain.

Could someone please clarify this for me in a bit further detail?  I am not the most technically oriented, but I would like to know more about how the process works.  I have attempted to check the bitcoin.org website, bit it went a bit over my head.  Embarrassed

Thanks for reading,

Ganjamancer
Jump to: