0

Let's consider a blockchain. They mining nodes are listening to transactions and every one is building is own block. Due to latency and other issues, every miner is probably building a different block, at a different speed. At this point, i have some questions:

1) When the consensus algorithm will start? There is like a timer? (For example: "every 10 minutes the consensus algorithm starts, with the purpose of putting a new block in the blockchain")

2) Can a miner create more than one block before the consensus algorithm start ? For example, it finishes a block and before this block goes under the consensus algorithm, it creates another one.

2) When the consensus algorithm start do it consider the blocks builded by all the miners ? And if some miner haven't finished building one's?

3) Is the order of transaction in a block important ? Must the transactions in the blocks respect the chronological order of the correnspondent "real" transaction (A sends 9 bitcoins to B) ?

Thanks

1

There is no "consensus algorithm" that starts and stops as you are asking. There isn't a timer and there isn't anything that nodes communicate other than blocks.

The process of updating the blockchain (i.e. the consensus algorithm) is always running and "wakes up" whenever a new block is received. It is run by nodes by themselves as there is no need to communicate with other nodes except to receive new blocks. Updating the blockchain only works on complete and valid blocks.

The process of every node receiving a new block and updating their own view of the blockchain is the consensus algorithm.

Due to latency and other issues, every miner is probably building a different block, at a different speed.

They are building different bllocks because they are different miners. Each miner is working on their own unique block. They probably are not working on blocks at different heights.

1) When the consensus algorithm will start? There is like a timer? (For example: "every 10 minutes the consensus algorithm starts, with the purpose of putting a new block in the blockchain")

It "starts" within a node when it receives a new block. There is no timer, and it is not a networkwide algorithm.

2) Can a miner create more than one block before the consensus algorithm start ? For example, it finishes a block and before this block goes under the consensus algorithm, it creates another one.

Sure. When a node receives a new block before it has validated previous ones, the new block is partially validated (the parts that don't rely on previous blocks are checked) and then it goes into a queue.

2) When the consensus algorithm start do it consider the blocks builded by all the miners ? And if some miner haven't finished building one's?

Then those miners lose the race and get nothing. Consensus only cares about complete and valid blocks. Whatever other miners are doing does not matter unless they too broadcast a valid block for that height.

3) Is the order of transaction in a block important ? Must the transactions in the blocks respect the chronological order of the correnspondent "real" transaction (A sends 9 bitcoins to B) ?

Yes, kind of. The order for two independent transactions does not matter. If transaction A came first and transaction B (which has no relation to transaction A) is second, a block can have B then A and that does not matter. The point of blocks is to establish the chronological order anyways.

But if transaction B relies on A (so it spends an output of A), then yes, the order matters. In that case, B must come after A. Otherwise the block is invalid and nodes will reject it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.