How multichain achieve mining consensus?

+2 votes
I read about the whitepaper.  The mining procedures are as follows

1. Apply all the permissions changes defined by transactions in the block in order. 2. Count the number of permitted miners who are defined after applying those changes. 3. Multiply miners by mining diversity, rounding up to get spacing. 4. If the miner of this block mined one of the previous spacingĀ­1 blocks, the block is invalid.

My question is: suppose we have 4 nodes (1,2,3,4), diversity= 3/4, then spacing-1=2

The first two blocks are created by 1,2. Then, in next step, 3, 4 are eligible to create the next block. Then, who will make the next block in practice? Does it depend on who react faster by broadcasting its block to others? Thanks a lot
asked Aug 8, 2016 by qileuchine

1 Answer

+1 vote
It is stochastic, either can generate the next block. If you're unlucky they'll do it at the same time, I.e. before they've seen each other's blocks, and this is called a fork. It is a temporary situation and will resolve itself automatically the next time a block is generated.
answered Aug 8, 2016 by MultiChain
Thanks for your clear reply. Could I ask if the fork case happens, in a node, how to decide which chain is the main chain. Bitcoin uses the rules here. https://en.bitcoin.it/wiki/Protocol_rules. I am not sure how Multichain achieves this? For example, there are two chains with same length (1,2,3) (1,2,4). How to decide which one to choose as main chain. It is by who arrives faster? Thanks a lot
Simply by virtue of chance, one of those 3-block chains will be extended before the other one, and then it will become the main one used by all nodes. If you're really unlucky and both are extended at the same time, it will resolve at the next block, and so on.
...