Blocks and mining
Last updated
Last updated
When you send out your transaction across the network it will be included in a future block, but you won’t know which block until miners have had a chance to include the transaction within the blocks they create. A more technical understanding of blocks and transactions is provided in the Libplanet page.
Once a miner creates a block, they broadcast it to all other computers within the network. If the block is valid then the other computer will accept this block as part of the chain. All players who run the game client have the option to partake in mining and help to secure the chain. The mining algorithm adopted by Nine Chronicles is the same as Bitcoin.
Due to the nature of the global scale of the Internet, these blocks cannot be transmitted instantly from one computer to another. There is always a chance that another miner will produce a competing block. As blocks within the chain must be sequential, there can’t ever be 2 blocks at the same position. This means that there is some period of time when a block is at risk of being removed from the chain, and the transactions inside being held until a new block is created. This is known as block reorganization, or “reorg” for short.
How to be sure that your combat result is completely lost? If your transaction is not included in a winning block then it is cached by miners to be included in another block. At some point your transaction will be inside a winning block such that you won’t have to fear a reorg. The point at which we can be sure is when enough blocks have been added on top of the block containing your transaction. In Bitcoin, it is suggested that users wait for 6 blocks to follow on. In Nine Chronicles, the game has a 3 block confirmation time.
Anti-Rollback protection
While 3 block confirmation times should be good enough, there is still a risk of a deep reorganization where multiple blocks become invalidated at once. This is a problem for a game as players don’t want to wait a long time in order to progress. Our solution to this problem is to use authorized miners. These are special mining nodes that were set at Genesis and provide a checkpoint of correctness every 50 blocks.
While this may not be the perfect, it does provide a practical solution to the problem. This is only a temporary solution until we rebuild our consensus engine to use Proof-of-Stake.
Our network is peer-to-peer such that it should not be dependent on Planetarium and should run 24/7. In this early access phase of the game, we have faced a number of challenges such that we haven’t quite met this ideal. A number of improvements are constantly being made in order to improve the network’s stability and the player’s gaming experience.
The biggest advantage of decentralization is that no player can cheat the game rules. All players help to prevent cheating by running a Nine Chronicles blockchain node. This means all players check the actions of every other player.