What’s going on all? This is MakeAnAppLike, again a blockchain-focused website. Today we’re going to be taking a look at what is the difference between a block dag and a blockchain. I know this is a pretty common question. Block dag is kind of a concept that a lot of people aren’t familiar with. So I figured we would look at some information on the blockchain and BlockDag. And compare BlockDag and Blockchain to see which one has some advantages over the other. Or do they both kind of stand at the same level? Let’s go ahead and hop right into it without any further ado.
So we’re going to start off with the main question.
What is a blockdag?
Now, blockdags are something that are relatively on the newer side of things when it comes to crypto technology. It’s still something that people are working out, but there is a lot of questions around it, like how they differ from blockchain because it is a new concept.
Advantage or Disadvantage of Blockdag
What are we really looking at when it comes to blockdags? And this is what we’re going to find out. So we’re going to compare the two, but we’re going to start with blockchain and explain to you guys if you don’t fully understand what blockchain is. We’re going to go over it.
So if you can start here off by looking at this dot, you can see above that you have blocks inside.
These blocks are stored with data. These blocks refer back to the previous block that was created. And this goes all the way back to the Genesis block. And this creates a blockchain. As we can see in the above picture, it uses blockchain blocks to store transaction data. These blocks are verified by a consensus mechanism, like proof of work or proof of stake. Blocks are permanent once mined. So once they’re mine, there is no unlining it or getting rid of the block and replacing it with another. It is permanent.
Next, block refers to the previous block to ensure nothing was altered. So these blocks, which you can see here with these arrows, refer back to the previous block. And to be more technical, they’re referring to the block’s header, which basically has all the information of the previous block kind of in a hash. So it’s referring to that previous block header to ensure that all the blocks’ lineage is correct, going back to the Genesis block. So only one block at a time.
This means that only one block can be mined at once. And there’s a reason for this, and we’ll get into that in a second. But blockchains are secure, but they’re not always fast or scalable. So if you look in the terms of bitcoin, bitcoin is very secure. The network has expanded all over the entire world, so it is very hard to perform an attack on bitcoin. But at the end of the day, bitcoin is not very fast, it’s not very scalable, just the basic blockchain itself.
That doesn’t mean that there aren’t some layer two or the lightning network or something that might alter it, but the base blockchain itself is pretty slow, and it’s pretty much nonscalable on layer one. So using the longest chain rule. Now, I’m not going to go super in-depth on the longest chain rule, but it’s to give a summary when it’s picking which block will be added to the blockchain.
So say there are two blocks mined at the same time. It’s going to pick the block with the heaviest weight or the most amount of work that was put into it. So if the difficulty was higher, say. On this block, then it was on this block. So say the difficulty was three for this block and only one for this block because there was more work put into the block that had a difficulty of three.
There’s an article that kind of explains how the longest chain rule works. I would definitely suggest you guys check that out. And lastly, no orphan blocks. And we’re talking in Bitcoin’s case, absolutely none. So the reason behind this we will get into, but you guys might be wondering what an orphan block is? So an orphan block are blocks that are created at the same time as another block but is not accepted as part of the blockchain. So you can see here in this little diagram that you have your genesis and future blocks.
Remember that this is going, the arrows are pointing back but the chain is really going left to right. So this is the newest block, and this is the genesis block. And you can see here that these two blocks right here remind at the exact same time. So it caused this one to be an orphan, and this one was accepted into the blockchain. And then you can see that the rest of the chain continued on that block’s end. So orphan blocks, these blocks are still valid but they’re just not part of the blockchain. So all the transactions and everything that is in it is real transactions. But those transactions will be moved from that orphan block to the next block that gets added to the blockchain. And like we said previously. This orphan block was not accepted into the blockchain because it required less work, and that is following the longest chain rule.
Accelerating the creation or increasing block size will also increase the orphan block rate. This orphan block rate is the rate at that these orphan blocks are being created. So if we take an example like Bitcoin, you have a block created every ten minutes. Or you take something like Caspa where a block is being created every second. Obviously, Caspa will have way more orphan blocks because there’s a block being made every single second, and there will be way more blocks being mine simultaneously.
Whereas on the Bitcoin side, there’s only one block for ten minutes. Now, a high orphan rate actually does equal less security. I’m not going to go in super in-depth on exactly why, but I do suggest you guys to do your own research on that if you are interested in these topics.
Now we’re going to go back into the blockchain. So most blockchains limit the block size or the creation rate to minimize the number of orphan blocks. As we said, more orphan blocks mean less security. So fewer amount of orphan blocks means a higher amount of security. And this is why these blockchains will limit these block sizes and the creation rate.
So again, for using Bitcoin as an example, it has a block size of 1, and creates a new block every ten minutes. So this leads to issues with throughput and scalability. Even though on the security side, it’s a good thing because you don’t have as many blocks being created, your transaction speeds and throughput are not as high and lead to scalability issues.
So for bitcoin’s example, you have a ten-minute confirmation time and about three to seven transactions per second, which is not very fast if we’re being honest. So now we’re going to go ahead and get into to a little detail on what a Dag is. Before you understand a block tag, you will need to know what a Dag is.
What is Dag
Dag is a directed acyclic graph, a mathematical concept in graph theory and computer science. Now again. There’s a ton of research you guys can do into Dags if you would like to. And there will be some links in the works cited at the end of the presentation. So be sure to check that out if you want to look more in-depth into it. But we’re going to take a look at Dags in crypto. So a Dag is a data structure. A lot of people might get it confused with this, but it is not a consensus mechanism.
It is just a framework that is used and contains absolutely no blocks. So these circles that you see here are represented as transactions. These are the vertices that represent transactions. And mining is not required because there are no blocks. You’re basically just putting down these transactions as fast as they come, and then they are referring to the previous transaction that was seen or visible.
And one of the advantages of this Dag structure is that it is very fast, and there are no wait times for transactions because they’re just put down as they come. So one of the main takeaways from Dags is that they are very fast, which is one of their strong suits. So I did put an example for some Dags: Iota and nano.
If you guys remember back in the day when Elon Musk had his issue with Bitcoin not being energy efficient, nano actually started running up because it was a tag and because they’re very energy efficient as well, because they don’t require any mining. That means it is a very energy efficient thing. But we will get into some of the issues these Dags can lead into. So let’s go ahead and move on. So now we are going to take a look, and we took a look at blockchain, we took a look at Dags. We’re going to kind of add the two together, and now we get a block Dag structure.
So now you can see here blocks are referencing multiple predecessors using this Blockdag framework. As you can see in the above diagram, we’re going from left to right here. So the block on the right is the new block. And these are going back to the Genesis block, which is the block on the left.
But you can see the similarities here. You’re. You have a similar structure with the blocks in a blockchain, but then you have it all kind of added in the framework of a blockdag.
So BlockDags refer to all blocks that are visible to it. You can see here that this block right here in the middle refers to this block, this block, and this block.
Take a second to look at this diagram here, and you can see how it works. Now, they’re not referring to blocks 7 miles away, right? So this block isn’t referring all the way to this one or anything like that. It has to be within a visibility range of the minor, right? So it also allows for a high orphan block rate. And this is obviously why we have so many blocks being put down in parallel. You have like one block here, but then you have two, then you have three that were kind of mine at the same time and another three that were mine at the same time. So many of these would be considered orphan blocks, but this leads to a higher throughput because these blocks are being put down as they’re created or at a very lower rate, like something like one block per second or whatever. So it can’t contain very many conflicting transactions.
And this is the real issue with block Dags is that it’s not really verifying that this transaction may be right and this 1 may be wrong. It’s just saying, all right, take these transactions we’re getting, throw them down as fast as possible and add them in. And that is how you end up with many conflicting transactions and issues with double-spending.
I do have one example of a blockdag here, and that is Caspa. I’m not sure if there are any other block Dags that are even very popular right now. We’re going to move on to our last panel here, which is blockchain versus block Dag.
Blockchain vs BlockDag
So this is going to be kind of where we summarize everything and go a little bit more into the reasoning why you might want to pick blockdag over the blockchain. So blockchain is time tested and this is one of the biggest things for blockchain that blockdag does not have. We don’t have years and years of experience of watching these BlockDag projects. Make sure that they do what they’re supposed to and that there are a lot of issues ironed out. We don’t know as many of these projects are still very new because the idea of block Dags is still very new technology.
But again, blockchains are very secure but still slow and not very scalable. Now, if we take Cadena and kind of add it into the mix here, this is where we see an idea of a blockchain that actually is scalable, but that’s not using the basic longest chain structure that’s used.
The main takeaway from BlockDags is that they allow very fast transactions. This BlockDag framework used with blocks can create a very fast scalable block dag. But again, remember, you need a proper ordering protocol to order the transactions and everything in the way that they need to or else the block Dags will be pretty much useless.
So Block Dags with a proper ordering protocol could appear in the Blockchain race. So if you guys are wondering what I’m referring to when I’m talking about the Blockchain 3.0 race.