Witnet Tech Pill 1: Transaction And Block Finality

The Witnet blockchain has a unique approach to finality; i.e. how long it takes for a transaction or a block to become irreversible or “confirmed”. Find out how it works.

Adán Sánchez de Pedro
The Witnet Oracle Blog

--

What’s Finality?

Finality is best described as how long it takes for a transaction or a block to be considered irreversible once published in a blockchain.

The concept of finality exists in the first place because for most public blockchain protocols, it is sometimes possible to “revert” or “reorganize” the most recent blocks. Only when some time has passed can you assume that transactions and blocks are final, and cannot be reverted.

How Does Finality Work In Other Public Blockchains?

When it comes to the Bitcoin blockchain, you need to wait 6 “confirmations” for a transaction to be considered final. In other words, 6 additional blocks need to exist after the block in which a transaction is published before that transaction is finalized, which will normally take ~1h.

This is the case for many other Proof-of-Work blockchains, too. For example, in Ethereum, 10 confirmations (~3 minutes) are required to achieve a similar degree of security to Bitcoin’s 6 confirmations according to Vitalik; although Gervais et. al. argue this equivalence to be around 37 confirmations (~8 minutes).

Finality In Witnet: Introducing Superblocks

In the Witnet protocol, finality is guaranteed using superblocks.

Every 10 blocks (specifically, those blocks with an epoch number/block height that’s a multiple of 10), the protocol samples a “committee” of 100 nodes from the Active Reputation Set, i.e. nodes with a proven record of reliability. A super-majority of 2/3rds of this committee is required* to digitally sign a message that gets derived from the hash of the last 10 blocks in the chain. In this way, the network can build a strong consensus on the chain state, without having to gather signatures (aka “votes”) for each individual block.

The existence of a single superblock committing to a block in which a transaction was published is enough to consider the transaction final and irreversible. Here’s a practical example:

Alice pays Bob 100 wits at some point around epoch (block height) #3456. Normally, a transaction will be included in the next block, in this case, #3457. The next superblock will take place just after #3460. Members of the superblock signing committee are given up to epoch #3469 for broadcasting their signed votes. At epoch #3470, the signatures are counted, and if a majority of the votes from the committee claimed that the block in which the transaction existed, the transaction can immediately be considered final.

Putting This Approach Into Context

In the example, the transaction takes 13 epochs (9 minutes and 45 seconds) from inclusion in a block to finalization. Under normal circumstances*, and depending on which point inside the 10-epoch period a transaction is sent, the finality delay will vary from 7.5 to 15 minutes. This delay is in line with what we see in other blockchains, and should be low enough for most use cases. It’s important to note that this is not “probabilistic finality” (a point in which a reorganization or reversal is highly unlikely); this is actually hard finality — it is technically impossible for superblocks to be reverted.

Despite the fact that this approach moves radically away from that of major Proof-of-Work blockchains, this design and its assumptions are not exotic. This mechanism is much alike to the finality gadgets of many Proof-of-Stake blockchains, like Casper FFG (Ethereum 2.0), GRANDPA (Polkadot) or PBFT/Tendermint (Cosmos).

Here’s a video of Witnet researcher and developer Claudia Bartoli Duncan explaining the differences between different finality gadgets at EthCC 2020:

The Witnet ecosystem is proudly among the early adopters of next-gen crypto technology, from VRFs (also used by Polkadot and Algorand) to BLS signatures (a key feature of the Ethereum 2.0 beacon chain). In this case, we can claim that the Witnet protocol beat some of those other projects in the race for implementing these technologies in production.

Mic drop 🎤 ⬇️.

Finality In Practice: How To Check If A Transaction Is Final / Confirmed

The easiest way to check whether a transaction is final and irreversible is to search for it in a block explorer. Transactions that are final are tagged as confirmed, and those that are awaiting confirmation are shown as pending or mined:

Dr. CPU’s Witnet block explorer shows confirmation status in the transaction details.

On the Sheikah Witnet Wallet (starting with version 1.7.3) you can click on any transaction to see the confirmation status:

Sheikah Witnet Wallet also shows confirmation status in the transaction details.

As for the WebSockets interface of the wallet component of witnet-rust , it already provides finality information as a boolean value in the confirmed field of the JSON response when querying the get_transactions method.

When operating a witnet-rust node, you cannot currently query for the confirmation status of a transaction easily, but the developers are already working on showing such information in the transaction method of the CLI.

*: in case of no supermajority, the size of the committee is reduced little by little in multiple rounds, but the 2/3rds requirement is kept. This allows for an exceptional recovery mechanism that trades off the minimal amount of security required for the network to self-heal. The spirit of this mechanism is “consistency above availability”: in the event that the network can not achieve the 2/3rds supermajority requirement, the chain state is rolled back to the last superblock that did achieve supermajority consensus. Under such circumstances, finality can be delayed until a new superblock with supermajority support arises.

--

--

Adán Sánchez de Pedro
The Witnet Oracle Blog

@Witnet_io board member, CTO at @StamperyCo, founder of @LoquiIM. Microelectronics aficionado. I write code, give talks, make music, brew beer and laugh a lot.