19 - Visualizing a blockchain
The Island of Yap is a great analogy for understanding how blockchains work because it’s relatable. When we move from that south pacific island into the world of blockchains, a person’s ability to visualize what’s happening can start to break down. Luckily, the blockchain industry has created tools that allow anyone to visualize the entire system. We discussed a few weeks ago how open software development has a massive impact on the security of an application. Open source development also means that blockchain visualization tools can be made by anyone. Let’s discuss blockchain visualization tools and how you can use them.
Making the blockchain tangible
When we talk about blockchain activity, we are talking about the transactions between individuals, the blocks, and all their related information. On the Bitcoin blockchain, this activity is between wallet holders. On other types of blockchains, activity can include interactions between wallets and smart contracts and between smart contracts themselves. We will get more into the latter two next week. For this week we are going to talk about something called a ‘’block explorer” which is a facade for the whole network. Block explorers help technical and non-technical people alike understand what is happening on a blockchain.
Block explorers show you what is happening on a blockchain network. They are the interfaces that make the activity on any given network tangible. Each chain has its own block explorer(s) that allow anyone to see different information on that particular chain. Some companies like blockchain.com will provide users with the ability to access multiple blockchain explorers. In their case, you are able to see the activity on the Bitcoin, Ethereum, and Bitcoin Cash blockchains. Other well known block explorers include blockstream.info for BTC and Etherscan.io for ETH. Unlike Facebook, which only has one interface (facebook.com), blockchains can have many interfaces showing you the same information in different ways. In a financial system, this is a good thing because you are able to compare the information from multiple sources to make sure what each block explorer you are using is accurately reflecting the blockchain.
Unpacking a BTC block explorer
Block explorers are extremely powerful; but like any tool, a user's understanding serves as the boundary of their use. Let’s walk through a bitcoin block explorer to really understand how to use one. What is great about an activity like this is not only will we learn how to use the tool, but in the process we will inadvertently learn more about how a blockchain is structured and actually works.
When you first land on the blockchain.com’s bitcoin block explorer, your eyes are immediately drawn to the two large graphs in the middle of the screen. These graphs have some high level information related to the asset you are reviewing. The first graph tells you the price of the asset over a given period of time in this case BTC over a day. The price is not a blockchain specific piece of information. Price of an asset depends on buyers and sellers in a market not on any network specific information. Blockchain.com is sourcing price information from an exchange or some other type of data source often referred to as an oracle.
The second graph depicts the Mempool size over a given period of time; and unlike price data, this information is blockchain sourced. Mempools are where transactions waiting to be added to blocks will sit. The graph above depicts how many transactions are waiting to be processed. Information about mempools is valuable because it can give a user an indication of how long a transaction will take to process and whether or not that transaction is going to be expensive.
After you examine the graphs, you realize there is some information listed above the graphs including the static price of BTC at any given time, estimated hash rate, number of transactions in the past 24 hrs, historical transaction volume, and forward looking estimated transaction volume. Most of this information is self explanatory and is focused on the amount of BTC passing between wallets on the network. The one piece of information that might not be self explanatory is the estimated hash rate.
We learned in Coming to consensus & proof of work that hashes are similar to page numbers and that they provide security over the information in that block. Hashes are discovered by miners, and the hash rate is the rate at which a miners are “hashing” or attempting to find a valid hash. In the screenshot above, the estimated hash rate is 208.898 EH/s. What this means is that all the miners on the Bitcoin network combined are finding about 208.898 qadrillion (208,898,000,000,000,000,000) hashes per second. Considering that it takes ~10 minutes to find a valid hash and create a block, you can understand why so many computers are used in the process.
If you scroll down on the block explorer, you begin to get more granular information about a blockchain. On the left you have the information about the latest blocks. Block height is the number of blocks that has been created from the start of the blockchain. The first block known as the “genesis block” has a block height of 0 and the second block has a block height of 1. You can also see the last time a block was mined, who the miner is, and the total size of the block denominated in bytes. Blockchain.com knows the identity of some miners because they have identified themselves. At the metadata level of a blockchain, the network does not know the identity of any particular miner.
On the right side of the screen you can see details about the latest transactions entering bitcoin mempools. In addition to blocks’ having hashes, each transaction is hashed in order to provide it with a unique identifier. The block explorer also shows you the time that the transaction occurred, the total amount of BTC transacted, and the dollar value of that transaction at the current market price. All of this information is helpful for a digital asset user to get an understanding of the traffic going through the network. It also helps us to get the framing for the different layers that exist on a blockchain.
Once you have examined the dashboard, you can explore more granular detail in blocks by clicking into their block height or by clicking a transaction’s hash. If you click the block height, then you will first see the high level statistics of a block. The summary up top tells you when the block was mined, who mined it, how much BTC they earned, the dollar value, the block reward and fee breakdown, and average transaction size.
If you scroll down, you’ll get more detailed information about the block. Below is a list of all the information you see above and what it means. Not every category is outlined because some is self explanatory and others I have already explained in the sections above.
Hash - Unique block identifier discovered by the miner.
Confirmations - How many blocks have been mined on top of/after this one. Most people believe that 5-6 block confirmations make a block totally sound, meaning that the transactions within it will not be contested by the network or overturned.
Difficulty - How hard is it to find a block hash and mine a block. Difficulty will change based on the number of miners trying to find hashes on the network. The more miners, the harder it is to find a hash and create a block which helps to keep block creation at around 10 minutes.
Merkle root - Is a hash of all the transaction hashes. We learned a second ago that on top of every block’s being hashed every transaction is also hashed. The hash of all the transaction hashes is the “merkle root,” which is used by miners to validate a transaction quickly. The best way to understand this is to think about where a bitcoin transaction came from. Every bitcoin was once mined, and in most cases the bitcoin was spent. The next time the bitcoin is spent the new transaction must be validated which means the miner needs to confirm its origin of that bitcoin. Instead of having to go back and review the whole blockchain’s history up to the block, the miner can check the merkle root which tells them if the new transaction was part of the block that merkle root is linked to. It's a quick and dirty check on information validity.
Bits - Are a sub denomination of bitcoin, and one bit = 0.000001 BTC. Another sub denomination which is popular is called a “Sat” which is 0.00000001 BTC.
Weight - Total amount of data included in a block denominated in weight units (wu). Each part of a bitcoin transaction is given a weight: the total data size multiplied by the determined weight set by the network. Each block has a max weight of 4M wu.
Size - Total amount of data included in a block denominated in a traditional measurement (bytes).
Nonce - The variable that miners change in their hash equation to find a new hash. We discussed the concept of hashing in Consensus and proof of work. Every time a miner fails to find a hash and tries again, they must change something about the data they are inputting into the hash function. The variable they change is known as the “nonce”.
Block reward - Amount of new bitcoin created in each block that is given as a reward to the miner who created it. When people discuss “the halvening,” they are talking about this amount being cut in half.
Fee reward- Total amount of fees paid by people sending transactions. Fee rewards are given to the miner to further compensate them.
Finally, at the bottom of the block, you can see the transaction detail which is a list of all the transactions in that block. The first is going to be the transaction that creates the new BTC to reward miners. The next transactions will be those conducted by individuals and the information related to them. Each transaction has a hash, the wallet address conducting the transaction and the individual transactions that make up the total amount of BTC being sent from the wallet. If we were to click into the transaction hash; then we could get even more specific information about that one transaction, but we are going to leave our conversation there for today.
As you can see a block explorer is an extremely powerful tool. It gives anyone insight into what is happening and has happened on a blockchain network. Next week we will discuss other fun ways in which you can use block explorers to examine the activity happening within a specific wallet.