The Witnet blockchain explorer

drcpu
The Witnet Oracle Blog
8 min readNov 10, 2021

--

After working on the Witnet blockchain explorer for more than a year, I’m finally releasing version 1.0 and open-sourcing both the frontend and backend on Github. Time to write an introductory article about all the different components.

Explorer backend

The explorer backend is comprised of three main components which are all written in Python.
1) A node pool process which starts and maintains several Witnet nodes. Other processes can communicate and resolve requests using sockets.
2) A blockchain scanning process which continously queries the blockchain for new blocks and collects data for all blocks, transactions and addresses. It writes all this data to a PostgreSQL database.
3) The Flask-based API which serves frontend requests through Nginx.

I will probably write a deep-dive article about the backend at some point.

Explorer frontend

The explorer frontend is written in ReactJS. It comunicates with the backend through the Flask-based API and serves a couple of different pages which I’ll introduce below.

Home

The home page shows a snapshot of the current network state.

In the first panel on the left a couple of network statistics plus the supply info are shown. The network statistics are, from top to bottom, number of epochs elapsed since the genesis time stamp, and number of blocks minted (note that the difference from the number of epochs due to rollbacks). It also shows the total number of data requests and value transfers which have been executed on the blockchain. Furthermore, it’ll also show the current ARS statistics which are the total number of active nodes and the number of nodes with a non-zero reputation. Lastly, it summarizes the number of pending transactions in the network.
The supply info is divided into different categories. First of all, there is the total number of WIT minted by miners whom proposed blocks. Secondly, we have the number of WIT burned due to blocks being rolled back. Since Witnet has a fixed supply which will be distributed over a fixed number of epochs, every epoch in which no block is appended to the chain (e.g., due to rollbacks) effectively results in burning of Witnet coins reducing the total supply. The third and fourth statistic summarize the total number of WIT which can be freely transfered and the number of WIT that are currently non-transferable due to timelocks. The last statistic is the total supply. This is equal to 2.5B minus the burned Witnet coins due to missing blocks.

The other panels show, from left to right, the most recently appended blocks, the data requests launched, and the value transfers which were processed by the network.
In the panel with most recent block hashes, the number of data requests and of value transfers included in the block are also show combined with a timestamp.
The most recent data requests and value transfers panel show the hash of the transaction together with a timestamp and a lock icon indicating whether the transaction has been finalized (or confirmed).

Search
This page is simply a simple search bar where a user can search for a block hash, transaction hash or address. Note that this search bar is also present on the home page.

When looking up a block, the following page will be shown.

The top panel shows the hash, timestamp, miner, and status of the block. The status can either be recently “mined”, “confirmed” by a superblock or “reverted” because the network nodes are not in consensus about the tip of the chain.

In the bottom panel, a list of all transactions included in the block are shown. These are the mint transaction (also know as coinbase), the value transfers, data requests, commits, reveals and tally transactions. For each of these transactions a summary of useful data is shown.

As an example, the commit transactions tab looks like this.

This tab will show the data request(s) for which commit transactions are included and the required collateral. It will also the commit transaction hashes and node identities that committed to solving the data requests.

The search bar also allows a user to look up any transaction.

If you look up a data request, commit, reveal or tally transaction, you will receive a full data request report. In the data requests tab, the top left panel will show the block and timestamp when it was included and whether it was confirmed. It will also show the deployer of the data request. Note that most of the time, this will be a bridge address “wit1etherz…3qtevy7s4z”. The top right panel will show transaction rewards and the panel at the bottom will detail which sources were queried and how they were combined.
The commit tab will show all transactions that were created to solve this data request and which nodes are participating in solving the request.
The reveal tab will show the result committed by a participating node and whether or not it was marked as a liar (in which case it is shown in bold).
Finally, the tally tab will show a summary of this data request, indicating liar and error committers as well as the final result.

Last but not least, when you look up an address, it will show the balance of that address and its reputation in the top tab. It will also details all value transfers, blocks and data requests the address was involved in together with lots of useful details about them. Note that the “Transactions” tab is shown and loaded by default, but the other non-shown tabs are only loaded upon request.

Blockchain
The next page is the blockchain page. This page shows a live and updating overview of the most recent blocks with some additional details. It also acts as an “infinite” scrolling container so you can scroll down to see past blocks.

Each block will show, from left to right, the block timestamp, the epoch, the block hash, and the miner. It will also show the sum of all transaction fees. The fees are shown as a natural number with a suffix appended. This suffix is either WIT, mWIT, uWIT or nWIT. The m, u or n stand for milli, micro and nano respectively. Next, the number of value transfers, data requests, commits, reveals, and tallies included in the block are also shown. Lastly it will also indicate whether the block has been confirmed by showing a locked or unlocked icon.

Transactions
The transactions page is essentially a visualization of the memory pool in the past 24 hours.

It shows, through time, how many transactions were waiting to be resolved and their priority. Priority is defined as the total transaction fee divided by the weight of a transaction. This indicates how likely a transaction is to be included in a block by a miner since they will always prioritize processing the transactions based on the weighted transaction fee. This page can serve as an estimator ofwhat your transaction fee should be to allow it to be processed by the miners as soon as possible.

Network

The network page shows some useful statistics about the network. From left to right, top to bottom, it shows the most recent rollbacks, how many unique identities mined at least one block or solved at least one data request, and the top mining nodes (both for mining blocks and solving data requests).

Reputation

The reputation list shows all identities that are currently in the ARS and their reputation. Next to reputation it also shows each identities’ data request solving eligibility.

Richlist

The richlist details all wallet balances in the complete network. It shows a paginated, sorted view of the identities and their associated balance. It also shows the percentage of the total current supply this wallet controls. For certain known wallets, a label is added to clarify who controls this wallet.

TAPI

The Witnet network employs TAPI (Treshold Activation Protocol Improvements) signaling to upgrade the capabilities of nodes if and only if enough miners (>80%) support it by upgrading their nodes.

The TAPI page monitors the blockchain and will collect signaling information to build a couple of visualizations of the TAPI progress. In the top left panel, all TAPI details are summarized. It shows the title, description, when the signaling period takes place, and the URL’s to the different improvements included in the proposal. It will also show the current relative and global acceptance rate. The relative acceptance rate is defined as the number of blocks accepting since the start of the signaling period divided by the elapsed blocks until now. The global acceptance rate is the number of blocks signaling acceptance divided by the total number of blocks that will be added to the blockchain over the complete signaling period. This latter statistics needs to be >80% for the blockchain to enable the listed WIPs. The right panel shows a bar graph breaking down the acceptance rate per 1000 epochs. The bottom panel shows all blocks accepting the improvements in green and the blocks not accepting them in dark blue.

Info

This is the last and most basic page of the explorer showing some info such as the official Witnet website and how to contact me or find the explorer source code.

--

--