Bitcoin Forum
November 17, 2024, 07:53:15 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Which exacts conditions are required for a block to be validated ?  (Read 728 times)
lentzaj (OP)
Sr. Member
****
Offline Offline

Activity: 474
Merit: 501



View Profile
September 11, 2017, 07:23:25 PM
Merited by ABCbits (1)
 #1

OK, I understand globally the blockchain consensus principle. But some parts remain unclear to me. For example

All the miners of the network need to validate a block of transactions to definitely store these transactions in the distributed ledger (aka blockchain). Why question is : how is the network of miners "aware" that all the miners have validated the transaction ? This might be a silly question but know I try to understand blockchain technology more deeply. I know I can find videos about it and so on, but I would prefer to get words from someone of the forum and start an interactive discussion about it.

Thanks for your answers !


           ▄▄███▀ ▀█▄▄▄
       ▄▄▀▀████ ███▄▄▀▀█▀▄
     ▄▀▄███▄▄▀ ▀▀▀▀▀▀▀▀ ▀▄█▄
   ▄█▀▄███▀▀▄█ ▀███████▀▄▀▄▀▀▄
  ▀█▀▄▀▀▄▄███ ██▄▀████▀▄██ ██▄▀▄
 ██▄▀█████ ████▄▀██▀▄████ ██▀▄
 █▀▄ ██▄▀██ ███████▄▀▄▀▀▀▀▀▀ ▀▄█
▄▀▄█ ████▄ ▀▄▄▄▄▄▄▄▄ ▄▀█████▀▄▀█▄
▀▄██ ███▀▄█▄▀█████▀▄██▄▀███▀▄█▄▀█
█▄▀██ █▀▄███▄▀███▀▄████▄▀█▀▄███▄▀
 ██▄ ▄██████▄▀█▀▄██████▄▀▄█▀▀▄▄▄
  ██ ▄▄▄▄▄▄▀▀▄▀▄▀▀▀▀▀▀▀▀▀ ▄█████
  ▀ ███ ██████▀▄▀███████▀▄▀████▀
   ▀████ ███▀▄███ ████▀▄██ ██▀
     ▀███ █▀▄█████▄▀▀▄█████
       ▀█▀▄▄▄▄▄▄▄▄ ▄▄▄▄

           ▀▀ ▀███▀▀▀
SPHERIS█████
▄▄▄▄▄
█████
█████
▀▀▀▀▀
█████
█████
█████
▀▀▀▀▀
█████
█████
█████
█████
█████
▄▄▄▄▄
█████
█████
▀▀▀▀▀
█████
█████
█████
▀▀▀▀▀
█████
█████
█████
█████
█████
▄▄▄▄▄
█████
█████
▀▀▀▀▀
█████
█████
█████
▀▀▀▀▀
█████
█████
█████
█████
DannyHamilton
Legendary
*
Offline Offline

Activity: 3486
Merit: 4851



View Profile
September 11, 2017, 07:28:50 PM
 #2

OK, I understand globally the blockchain consensus principle. But some parts remain unclear to me. For example

All the miners of the network need to validate a block of transactions to definitely store these transactions in the distributed ledger (aka blockchain).

That is not correct.

Each miner (or mining pool) maintains their own blockchain.  They validate the transactions and the blocks for themselves.  They do not trust what any other miner has done or said about the blocks or transactions.

Why question is : how is the network of miners "aware" that all the miners have validated the transaction?

They don't need to be "aware" of what the other miners have done.  If they are building a block, then they only include transactions that they have validated.  If they receive a block from someone else, then they validate that block before they add it to their own blockchain.

This might be a silly question but know I try to understand blockchain technology more deeply. I know I can find videos about it and so on, but I would prefer to get words from someone of the forum and start an interactive discussion about it.

Thanks for your answers !

You are welcome.
Kogs
Member
**
Offline Offline

Activity: 86
Merit: 26


View Profile
September 12, 2017, 09:18:37 AM
Merited by ABCbits (2)
 #3


I think you are talking about newly mined blocks by miners which are sent to the network.

Quote
All the miners of the network need to validate a block of transactions to definitely store these transactions in the distributed ledger (aka blockchain).

Replace "All the miners of the network" with "All the full nodes of the network".

Each full node stores the complete blockchain. Whenever a full node receives a new block (mined by any miner and send the newly found block to the network), the full node validates this block and if it is OK, the block will be added to it's own version of it's blockchain and also broadcast the block to all the connected peers. If it is not valid, the block will be rejected, not added to the blockchain and not broadcasted to it's peers.

Quote
how is the network of miners "aware" that all the miners have validated the transaction ?

There is no need to be aware if all the other full nodes have already validated the block or not. If your full node follows the exact same rules than all the other full nodes, and the block is valid for you, it is also valid for all the other full nodes. Except two blocks are found nearly simultanious. Only the first block the full node received will be valid for him. The second block will be invalid, at least for a while (see below).

A miner itself is nothing more than a full node. Whenever the miner is searching for a new block and receives a new block from the network before he found a new block himself, he also need to validate the received block. If it is valid for him, he also add it to his local blockchain and start mining a new block on top of the just received block with the remaining transactions in the mempool.

Whenever a node receives two valid blocks with the same height, the rule of the longest chain will solve this issue.
Lets assume, miner 1 and miner 2 find booth a block at the same time and broadcast their block to the network.

In this case about half of the network will accept the block from miner 1, the other half will accept the block from miner 2. Some miners therefor will try to find a new block on top of block of miner 1 and some miners will try to find a new block on top of block of miner 2. The first one who find a new block, either on top of block of miner 1 or miner 2, will become the longest chain, which is the chain which is the valid chain.

The miners who did mine on top of the "orphaned" block will see they are on the wrong side of the chain when they receive a new block on top of the other chain. Then they stop mining on their current block and continue mining on the other longer side.
lentzaj (OP)
Sr. Member
****
Offline Offline

Activity: 474
Merit: 501



View Profile
September 13, 2017, 04:32:03 PM
 #4

Ok thanks for your answers ! But these arise new questions.

Quote
Each full node stores the complete blockchain. Whenever a full node receives a new block (mined by any miner and send the newly found block to the network), the full node validates this block and if it is OK, the block will be added to it's own version of it's blockchain and also broadcast the block to all the connected peers. If it is not valid, the block will be rejected, not added to the blockchain and not broadcasted to it's

So how is the validity of a block checked ? I really can't get the consensus stuff here. I mean, to globally agree on a transactions block, it must be accepted on every copy of the blockchain. Does that make sense to you ?

Could you also provide me an explanation of the difference between miners and nodes ? Could a miner also run a node ?

Thanks for the precisions you could bring !


           ▄▄███▀ ▀█▄▄▄
       ▄▄▀▀████ ███▄▄▀▀█▀▄
     ▄▀▄███▄▄▀ ▀▀▀▀▀▀▀▀ ▀▄█▄
   ▄█▀▄███▀▀▄█ ▀███████▀▄▀▄▀▀▄
  ▀█▀▄▀▀▄▄███ ██▄▀████▀▄██ ██▄▀▄
 ██▄▀█████ ████▄▀██▀▄████ ██▀▄
 █▀▄ ██▄▀██ ███████▄▀▄▀▀▀▀▀▀ ▀▄█
▄▀▄█ ████▄ ▀▄▄▄▄▄▄▄▄ ▄▀█████▀▄▀█▄
▀▄██ ███▀▄█▄▀█████▀▄██▄▀███▀▄█▄▀█
█▄▀██ █▀▄███▄▀███▀▄████▄▀█▀▄███▄▀
 ██▄ ▄██████▄▀█▀▄██████▄▀▄█▀▀▄▄▄
  ██ ▄▄▄▄▄▄▀▀▄▀▄▀▀▀▀▀▀▀▀▀ ▄█████
  ▀ ███ ██████▀▄▀███████▀▄▀████▀
   ▀████ ███▀▄███ ████▀▄██ ██▀
     ▀███ █▀▄█████▄▀▀▄█████
       ▀█▀▄▄▄▄▄▄▄▄ ▄▄▄▄

           ▀▀ ▀███▀▀▀
SPHERIS█████
▄▄▄▄▄
█████
█████
▀▀▀▀▀
█████
█████
█████
▀▀▀▀▀
█████
█████
█████
█████
█████
▄▄▄▄▄
█████
█████
▀▀▀▀▀
█████
█████
█████
▀▀▀▀▀
█████
█████
█████
█████
█████
▄▄▄▄▄
█████
█████
▀▀▀▀▀
█████
█████
█████
▀▀▀▀▀
█████
█████
█████
█████
Syke
Legendary
*
Offline Offline

Activity: 3878
Merit: 1193


View Profile
September 13, 2017, 04:46:00 PM
 #5

So how is the validity of a block checked ? I really can't get the consensus stuff here. I mean, to globally agree on a transactions block, it must be accepted on every copy of the blockchain. Does that make sense to you ?

All the nodes that follow the same rules have the same blockchain. If different nodes follow different rules, they will have a different blockchain. Rules are things like "no double spend", "size of block", etc.


Could you also provide me an explanation of the difference between miners and nodes ? Could a miner also run a node ?

A miner is just a node that, along with validating blocks, the miner attempts to create new blocks.

Buy & Hold
lentzaj (OP)
Sr. Member
****
Offline Offline

Activity: 474
Merit: 501



View Profile
September 13, 2017, 04:55:28 PM
 #6

Quote
All the nodes that follow the same rules have the same blockchain. If different nodes follow different rules, they will have a different blockchain. Rules are things like "no double spend", "size of block", etc.

I've got this. But how is new information sent to these nodes ? By the miners ?


           ▄▄███▀ ▀█▄▄▄
       ▄▄▀▀████ ███▄▄▀▀█▀▄
     ▄▀▄███▄▄▀ ▀▀▀▀▀▀▀▀ ▀▄█▄
   ▄█▀▄███▀▀▄█ ▀███████▀▄▀▄▀▀▄
  ▀█▀▄▀▀▄▄███ ██▄▀████▀▄██ ██▄▀▄
 ██▄▀█████ ████▄▀██▀▄████ ██▀▄
 █▀▄ ██▄▀██ ███████▄▀▄▀▀▀▀▀▀ ▀▄█
▄▀▄█ ████▄ ▀▄▄▄▄▄▄▄▄ ▄▀█████▀▄▀█▄
▀▄██ ███▀▄█▄▀█████▀▄██▄▀███▀▄█▄▀█
█▄▀██ █▀▄███▄▀███▀▄████▄▀█▀▄███▄▀
 ██▄ ▄██████▄▀█▀▄██████▄▀▄█▀▀▄▄▄
  ██ ▄▄▄▄▄▄▀▀▄▀▄▀▀▀▀▀▀▀▀▀ ▄█████
  ▀ ███ ██████▀▄▀███████▀▄▀████▀
   ▀████ ███▀▄███ ████▀▄██ ██▀
     ▀███ █▀▄█████▄▀▀▄█████
       ▀█▀▄▄▄▄▄▄▄▄ ▄▄▄▄

           ▀▀ ▀███▀▀▀
SPHERIS█████
▄▄▄▄▄
█████
█████
▀▀▀▀▀
█████
█████
█████
▀▀▀▀▀
█████
█████
█████
█████
█████
▄▄▄▄▄
█████
█████
▀▀▀▀▀
█████
█████
█████
▀▀▀▀▀
█████
█████
█████
█████
█████
▄▄▄▄▄
█████
█████
▀▀▀▀▀
█████
█████
█████
▀▀▀▀▀
█████
█████
█████
█████
Kogs
Member
**
Offline Offline

Activity: 86
Merit: 26


View Profile
September 13, 2017, 05:40:06 PM
Merited by ABCbits (2)
 #7

Quote
All the nodes that follow the same rules have the same blockchain. If different nodes follow different rules, they will have a different blockchain. Rules are things like "no double spend", "size of block", etc.

I've got this. But how is new information sent to these nodes ? By the miners ?

Transactions and new found blocks are broadcast by all the nodes to all the other connected nodes.

The bitcoin network is a network with lot of peers (full nodes and some other types of light nodes). Each node is connected to a punch of other nodes, which are connected again to a punch of other nodes and so on. This mean that all nodes are somehow connected with each other.

Whenever one miner finds a new block, he will use his own full node (each miner will run a full node, or at least use somebodys full node) to store the block in his one blockchain and send the new block to all peers which are connected to his full node. The job for the miner is done (fire and forget).
All the nodes which received the block from the miner will validate the received block. If it fullfill all the requirements, they add the block also to their blockchain and send it again to all their connected peers. They again will validate the received block, add to blockchain and send further.
After a short amount of time all the full nodes received the new block, each of them validateed it and added to their local blockchain.

The result is, that the whole network (all full nodes) received the block from the miner, validated it, and stored into their own blockchain. The whole network of nodes then have the same locally stored blockchain.

The game starts again whenever a miner find the next block.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3486
Merit: 4851



View Profile
September 13, 2017, 06:40:45 PM
 #8

So how is the validity of a block checked?

Everyone checks it for themselves.  They check that all the transactions in the block are valid, and that the block includes a valid 80 byte header.

I really can't get the consensus stuff here.

Consensus is reached because everyone is using the same rules for checking validity and everyone is agreeing to work with the longest chain (most proof-of-work).

I mean, to globally agree on a transactions block, it must be accepted on every copy of the blockchain. Does that make sense to you?

There is no global agreement.  Everyone maintains their own blockchain, and doesn't know (or care) what the other copies of the blockchain look like.  Since everyone is using the same rules, the end result is that all the blockchains are identical.

Could you also provide me an explanation of the difference between miners and nodes?

Solo miners and mining pool operators run their own full nodes to communicate with the network, and to validate transactions and blocks.
Mining pool participants trust the pool to manage the transactions, blocks, and blockchain for them.

Solo miners and mining pool operators create blocks and use their node to:
  • Broadcast their blocks to connected peer nodes
  • Receive and validate blocks and transactions from connected peer nodes
  • Maintain their copy of the blockchain

Could a miner also run a node ?

Yes.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!