Given that Hive is a ‘blockchain’, a better understanding of blocks will probably help you understand how the chain works a bit better!
I’ll be using data from ‘Hiveblocks’ in this post, which is a very accessible block explorer.
This post also appears on the most excellent Leopedia - the guide to the Hive blockchain and other crypto related topics.
Blocks on the Hive Blockchain: the basics
The chain produces a new ‘block’ every 3 seconds, or:
- 20 blocks a minute
- 1200 blocks an hour
- 28, 800 blocks a day
- 10, 512, 000 blocks a year.
After four years of running (including all the old Steem data) the chain has produced forty four million blocks and counting, each containing several pieces of data, so it's worth spending a bit of time to reflect on what a 'block' on the chain consists of!
Stored within each block are ‘transaction data’, which users ‘write’ to the chain (posts and comments, votes, transfers and jsons) and ‘virtual operations’ – the ‘printing’ and distribution of HIVE and HBD based on transaction data.
If you use Hiveblocks to explore the chain, you can see the two types of operation separated out:
- Transaction data, with an ID, and
- Virtual Operations, with no ID but dependent on transaction data.
One of the functions of the witnesses is to bring these two types of transaction together – the witnesses take it turns to confirm the blocks every three seconds, linking the transactions users make to the virtual, economic operations, which are to do with rewards distribution.
The top 20 witnesses take it in turns to confirm a block (and get rewarded for it) every 3 seconds, with another witnesses from outside of the top 20 chosen every 21st block.
If you pause to reflect a moment, this is a nice reminder of the decentralised nature of Hive – the confirmations are distributed every three seconds across 21 witnesses, and there’s no personal connection between the witnesses signing the blocks and the preceding blockchain interactions which went into deciding the distribution of reward.
Transaction data and virtual data
You can see the separation of the two data types in your personal hive blocks feed: here’s mine, I’ve highlighted all the virtual opps and left all the transaction data blank…
And by Block
If you have a look at block number 44 171 317 (just to pick one recent example of many blocks) you’ll see transaction data first and virtual data second:
Transaction data (it goes on further!)
Virtual data (it goes on further!)
Don't limit yourself to this block, why not pick another and explore further!
Using the block explorer to dig deeper…
If you go to block 44 171 317 (or any block of your choice), you can scroll down to the bottom of the ‘transaction data section’ and click on ‘show raw transaction data’ and you’ll find that for every single transaction there is more data!
For example, there are 20 transactions within block 4 417 1317 and besides the block number ID they all have an additional EIGHT further pieces of data attached to them:
- This is a ‘post’ operation – note all the details of the post are included, even if you edit this on a frontend, the details remain unchanged here! Other types of operation will show you different data – Hive-engine transfers are recorded in Jsons for example.
- Note also the exact to the second time stamp at the top.
- And then not the further block identifiers and signatures at the bottom.
- In short, there’s no escaping your history on the blockchain!
It’s worth reflecting here just how ‘lodged’ this is on the ledger, and how much data there is – this is one piece of data out of 20 in one 3 second block!
Note that Virtual operations don’t have anything to allow you explore them further, these are just determined by certain types of transaction data!
How much data can fit in a block?
As of June 2020 Witnesses use a block size of 65 Kilobytes, which means there is enough room for 65 000 characters per block, equivalent to approximately 30 000 words, or one third of the average PhD thesis.
If blockchain use increases over time, Witnesses can choose a larger block size, and a few witnesses already produce blocks capable of storing 130 Kilobytes of data.
Resource Credits also limit what users can write to the chain. The busier the chain is, the more expensive it is in terms of Resource Credits to do anything.
Exploring a post and votes using Hiveblocks
As a blogger this is of particular interest to me…. I can type the URL of any of any post into Hiveblocks, ideally the ones that are over seven days old, so paid out, and reveal the most in-depth information about who commented, voted and when.
Here’s a Hiveblock link to a recent post by as an example. I’m including the whole link to show you what it looks like:
https://hiveblocks.com/hive-155862/@exodenews/comprehensive-guide-to-all-exode-alpha-edition-origins
Scroll down past the raw text data and you can either click on ‘post details’ or ‘vote details’, focussing on the later, you get some very detailed views of the order of votes, in Rshares, and by weight….
NB rshares are how the chain works out rewards – they are related to MVests, but the figures above factor in Voting Power at the time of voting, and vote weight, so here you can see the chain’s doing a lot of calculating work in the background, and it’s more nuanced than MVest, let alone Hive Power.
Also note that all of the text data here is hardwired into the blockchain, edits in a front end will not edit this. For example, here is the original Hiveblocks version of the infamous ‘Do you want to ---- Justin Sun post.
The Hive Inflation Rate
Inflation is also worked out in blocks...
Inflation (new supply of Hive) started at block 7 000 000, at 9%.
There were 250 000 000 Hive at block 7, 000, 000 and so an additional 23,750, 000 Hive were added in the first year.
The decreasing Hive inflation rate is determined by blocks. From block 7, 000, 000 the inflation rate reduces at the rate of 0.01% every 250 blocks, or approximately every 8.7 days, or 0.42% a year.
The Hive Developer Portal breaks this down into a yearly summary…
| Year | Total Hive | inflaction rate | Hive 'printed' |
|---|---|---|---|
| 2016 | 250,000,000 | 9.50% | 23,750,000 |
| 2017 | 273,750,000 | 9.08% | 24,854,398 |
| 2045 | 791,497,645 | 0.95% | 7,519,228 |
Thinking about rewards distribution in blocks…
If you work the above out per block, then that means 23, 750, 000/ 10, 512, 000 Hive, or about an additional 2.25 Hive per block, PER MINUTE, PER DAY. It’s this that makes up the rewards pool.
Now, if you look at the producer rewards received by witnesses, which is 10% of the ‘reward pool’ total, they get 10% of this, and lo and behold, the ‘rewards’ they receive do come out at 0.244, near enough 10% of that figure, then you get 10% going to the Dao, 15% inflation added on the Vested HP, and then the other 65% which makes up the ‘rewards pool’ – from which are drawn curation and post rewards.
You can see all the currents 'rewards fund' data posted on the front page of HiveBlocks… live feed to the left, general block data to the right…
Remember this is added to and distributed from every 3 seconds!
Headblock and last confirmed block
There’s a slight delay between the ‘head block’ of ‘transaction data’ and the ‘virtual operations’ data being added on, which happens when a witness signs a block, 51 seconds after the transactions have been written. If you go the ‘Hive Blocks’ homepage you can see the live data, unconfirmed, being churned out.
Final thoughts
There's probably a lot more to the blockchain which I haven't covered here, I just want to encourage people to 'think in blocks' a bit more, you can't really understand chain mechanics without thinking in blocks!
Key Terms According to the Hive Dev Portal Glossary
- Blockchain - Decentralized ledger and consensus protocol
- Block - Every three seconds, the Hive blockchain produces a new block. Each time a new block is produced, the distributed network is updated with all of the transactions that occurred within that block.
- Transactions - Operations/Activity/Write requests to the blockchain. A transaction is a submitted update to the Hive blockchain. This can include token transfers, posts/comments, votes, etc.
- Virtual operations - Operations that are derived from blockchain activity, but aren't actually stored as operations themselves (ex. curation and author rewards). They happen based on consensus from the blockchain based on other normal operations
Useful sources
The Hive Developer Portal has some useful FAQs
There’s a list of block explorers you can use to explore blockchain data here, at HiveProjects.io, my two favourites are