Miners, Block time and Orphans, a trinity.

Aat de Kwaasteniet
Coinmonks
Published in
10 min readJan 5, 2020

--

(for Dutch version click here)
In this article, I want to make an attempt to explain the relationship between block time and the creation of orphan/stale blocks in a blockchain network. In fact, it is an extension of a paragraph in a previous article that I wrote “Which crypto becomes the new payment system” in the chapter on technical usability. But also in “The nonsense of…. TPS (transactions per second)” it is already somewhat discussed.
In this article, we will explore this phenomenon in more detail. Stale blocks and Orphan blocks are different from each other but are basically created by the same phenomenon and because they are all popularly called Orphan blocks, I will use this term as well.
I will try not to make it too technical so that the less technically skilled readers among us can understand it as well. But there must be some understanding of things within the crypto world.

How does a “Blockchain” actually work?

As most people know, a blockchain is a form of database that is used by Bitcoin and other crypto coins. But in a nutshell, I’ll explain what a blockchain is.
In the blockchain, the crypto transactions between users are stored in a very specific way. The data of different transactions are collected in a data package, a so-called block and the blocks are stored in a serial way where each block is linked to the previous block via a control number or digital fingerprint(“Hash” in the jargon) which is part of each package. The added digital fingerprint monitors the integrity of the data in the block. Because the blocks are linked together like a chain using that digital fingerprint, the whole is called a blockchain.

Every user of a full node of the Bitcoin network or another cryptocurrency has a copy of the relevant blockchain on his computer. And all these users are in contact with other users via a network. If the data in a block is mutated, intentionally or otherwise, the digital fingerprint will differ from that mutated block and so will all subsequent blocks. By simply comparing the last digital fingerprint of all users one can see if a user’s blockchain is good or corrupt. This also allows fresh users to receive the entire blockchain from other users in a way that they can be sure it has not been tampered with.
A good video explanation for beginners of what blockchain is can also be found here.

How to create Blocks

New transactions between users, that are not yet part of the blockchain are broadcast around the network and stored in the mempool. Miners assemble a portion (or even none if they want) of these transactions into a block, along with some random data that they insert. They repeatedly modify this random data and “hash” the new control number to see if the block is considered valid. As part of the transactions in the block miners get to create a special transaction that pays out a “reward”.
The miners, therefore, compete with each other to be the first to assemble a block that is valid so that they can be the ones to pay themselves a reward.

The block is then broadcast by the miner via the network to all other users. But broadcasting it to the rest of the network takes time. A user usually has contact with a few other users within the network and not with all of them at once. It is, therefore, possible that a message may have to go from A to B via several other users in between. This means that it takes some time before all users are aware of the new state of the blockchain. It is a decentralized network, all connected computers (nodes in network jargon) are equal and have the same rights and obligations. A node can be a normal user but it can also be a miner. A node is usually connected to only 8 other nodes. A simplified schematic presentation can look like this:

In the picture, the nodes are connected to their nearest neighbours, but in reality, this is not the case. A user doesn’t have to be connected to his geographical closest neighbour, but can just as easily be connected to someone in Japan, Argentina and Alaska and so on. But then the picture became too complicated to draw.

Distribution of Blocks over the network

What happens when Miner A finds a block and transmits it to all the other nodes? How long does it take for Node C to know about the new block? How much time it takes depends on many factors such as:

  • The average internet speed on the network
  • The speed of the used computer on which the blockchain runs.
  • The size of the block
  • The number of nodes in the network
  • The construction of the network.

Let’s give a calculation example. We use the following numbers as a starting point: The average internet speed is 10Mbits/sec (not everyone has fiber at the front door.) The block size is 100kbyte. The processing speed on the computer is 50 milliseconds for real processing and 50 milliseconds for internet access (Ping time).

The shortest connection from Miner A to Node C is via 5 Nodes and 6 internet connections. Then we can calculate that it takes 5 x (50mS+50mS) + 6 x 0.1 second = 1.1 second before Node C is told that a new block has been added to the blockchain. We call that time the propagation delay in the network. You would say: well, that’s not too bad, but if you change the block size to 1Megabyte, the propagation delay will be 6.5 seconds.

If a cryptocurrency has a large network of more than 1000 nodes, 50% of the nodes will be up to date within 6.5 seconds, but in unfavorable cases 5% may not be aware of the latest block after 40 seconds. All this has been calculated and thought up by research of Christian Decker and Roger Wattenhofer.

Propagation delay is not a “bug” that can be rectified, but it is a fact that the designers of the blockchain network have to take into account. Because what happens if two or more miners solve the puzzle simultaneously or almost simultaneously? Two different blocks that are fully validated to be the next block in the blockchain.
But only one block can be accepted and the other block has to be discarded.
It all depends on who is mining the next block.

Collision

Miner A and Miner B try to find the next block independently and they come up with a solution practically at the same time. Miner A and Miner B start broadcasting their block to the network. Miner X is reached first by the block of Miner A, while Node C is confronted with the Block of Miner B first. The Block of Miner B arrives at Miner X a little later but is no longer accepted there because the blockchain on Miner X has already added a block with the same number.
The blockchain then has two appearances in the network that are in principle both right:

At Node C: > N1,N2……..Block from Miner B
At Miner X:> N1,N2,…….Block from Miner A

The next block will be mined by Miner X and Miner X will link his new block to the blockchain he knows. The block looks like this:

N1,N2…….Block from Miner A, Block from Miner X

Miner X is going to send these around. At a certain moment, it arrives at Node C via the purple arrows in the picture and Node C sees that this blockchain order is different from his own and also that the other is longer. Now rule one of the blockchain laws goes into effect and that is that the longest chain wins, which represents the right value. So Node C will remove his last block (Block from miner B) and add the block from miner A and the block from miner X. The former Miner B block becomes an Orphan block.
This process happens for all Nodes so that the entire network will work with the same Blockchain again.

This is in short and simplified how things work. In reality it works more complicated with more communication between the nodes.

How big is the orphaning “problem”

Orphaning is inherent to a decentralized network with a blockchain technique and that is not a disaster. However, it shouldn’t be a scuppers’ job. If a network generates orphans very easily, it is also easy that unwanted forks are created in the chain. This can be accidental but can also be done by malicious express which can lead to fraud on the network by means of so-called “double spend”. It would take too long to go into this now, but there is plenty to find on the internet about this phenomenon.

I’ve been investigating different crypto coins and how many orphans they produce. The occurrence of orphans in the network, therefore, depends on the propagation delay, but to a greater extent on the block time that a particular cryptocoin uses. If the average propagation delay is 6 seconds and the block time is 600 seconds, as with bitcoin, orphans hardly occur and the network has enough time to detect and fix occurring double blocks.
But if the block time is very short and the propagation delay is high, due to a large number of transactions creating large blocks, the network can’t restore the double blocks in time and problems arise.
Individual miners will all end up mining on and broadcasting different forks of the blockchain, splitting the network into multiple competing portions, further slowing block propagation as nodes are overwhelmed with all the competing blocks, ultimately leading to a stuck or unstable blockchain.
So it is important to choose the block time and the maximum block size with care. Too long a block time has a negative effect on the confirmation time (the time that a transaction has become irrevocable) and too low a block time results in the above-mentioned effects.

In order to be able to claim as many transactions as possible per second, several crypto coins have drastically shortened their block time as compared to that of Bitcoin. In addition, some have also stretched the maximum block size to 4MB and sometimes much higher. A dangerous combination which cannot work in the event that users were to attempt to fully utilize the supposed extra transaction capacity.

Below is a list of block times as I could find them for the different crypto coins with their orphaning performance. You have a good chance that your favorite coin is missing from the list because by no means all coins show how much orphaning occurs in their network. However, it is possible to put together a good picture of the relationship between block time and orphaning of the remaining coins.

It’s worth noting that most coins don’t propagate orphans once they know they are orphaned. Not all orphans will reach the explorer, before the block that orphans them. So in most cases the number of actual orphans across the network will be quite a bit higher than what the explorer reports.
The larger the network and faster the block time the less % of actual orphans will be seen by the explorer.

We see that old friends like Bitcoin, Litecoin, Dash perform well with little Orphaning. But Groestlcoin is also performing well with their reasonably fast block time of 60 seconds and only 1 orphan per day on average. This is the exception to the rule. All crypto’s with a block time lower than 100 seconds do not perform well.

I have also put the values in a graph.

Digibyte has an average of 6 orphans per day and seems to get away with the very low block time of 15 seconds. That it ends well is in fact the question as the number of transactions, and therefore the block size, increases. At the moment there is only one transaction on average in each DGB block and that doesn’t take up a lot of space but the block size of DGB can now be up to 4MB and then a blocking of the network is irrevocably a fact. You could make a comparison with Ethereum because, with roughly the same block time as Digibyte, it scores very poorly because it handles a large number of transactions. This is also the forefront of Digibyte.
Ethereum balances on the edge of what is still possible. 11,26% of all blocks that are mined result in an orphan, although Ethereum calls this “Uncles” because they give a reward to the miners that produce Orphan/Uncles.

What strikes in the list is that only Ethereum, Bitcoin, Litecoin and Dash have more than one transaction per block. Crypto is still in its infancy.

Conclusion

Orphaning is not a “bug” but is inherent to the use of decentralized network and blockchain technology. It does not normally cause any problems unless it is likely to occur frequently. The frequency of opting depends on the block time and the size of the blocks. As a general rule it can be said that a block time greater than 100 seconds will not cause any significant problems. And that block times less than 60 seconds are in the danger zone.

This ends the explanation, I hope it will help you to understand some difficult things, and if so, i’m glad.

Other articles of this author are:

What is the real value of Bitcoin?
Ranking crypto’s by number of nodes
Bitcoin needs to change
The Recovery Phrase, Fail-Safe Or Not?
Which crypto becomes the future payment system?
The Good, the Bad and the Ugly, Classifying the crypto-coins.
The white hat ethical investor
The nonsense of…. TPS (transactions per second)
Crypto ranked by numbers of users

A donation is appreciated.
Gulden: GJHgkaE88n21d2TNUCvaxJRCXcGbR7MaLd
Bitcoin: 3QR1yvPr1vcM3dfyzrhFpjsLf4VggVZHsK

Get Best Software Deals Directly In Your Inbox

--

--