Tezos Explorer TzKT #1 — Reflections on an ideal block explorer

What is a Tezos block explorer for ordinary users and developers. TzKT - a lightweight, API-first, account-oriented, based on own indexer for the Tezos blockchain

Max
Max   Follow

Welcome to the Baking Bad (opens new window) podcast dedicated to the development process of TzKT (opens new window) — a lightweight, API-first, account-oriented block explorer based on its own indexer for the Tezos blockchain.

First of all, we want to thank Tezos Foundation, TQ and Tezos Commons for supporting us and also all our colleagues, friends and fans from the amazing Tezos community for emotional charging! Zed 💗

While TzKT is in the process of painstaking development, we want to share our thoughts on the main goals of block explorers and our vision of an ideal block explorer. Let’s rock!

# What is a block explorer for ordinary users?

As strange as it may sound, 99.9% of users never used block explorers in the literal sense for exploring blocks. Nevertheless, each explorer developer considers it his duty or a tribute to place a list of recent blocks on the front page ¯\(ツ)
Generally, most common use cases are the following:

  • Check for a transaction confirmation
    What do you do when someone sends you coins and gives you a tx hash? Yes, you search it in the block explorer and then spam “F5” until the transaction is confirmed.
  • Monitor own accounts
    What if you have a paranoia attack and you need to check your balance or recent activity immediately? Yes, you open the block explorer.
  • Inspect other accounts
    Have you ever wanted to know someone’s balance? Or where did someone get these coins from? Tracking money flows, finding related accounts, etc — all this is also done through block explorers.

There are also several additional Tezos-specific use cases of block explorers:

  • **Inspect (own) bakers
    **Check baker’s status, capacity, baking rights, baking stats, rewards, etc.
  • Audit delegations
    Match the gained rewards with the received payouts.
  • **Inspect smart contracts
    **View source code, current storage state, etc.
  • On-chain governance
    Check the current vote period, ballots, quorum, etc.

As you can see, block explorers are more like account explorers!🙀

Thus, a block explorer (or, to be precise, an account explorer) is a kind of trusted party that gives people confidence that everything’s fine with their accounts, or helps them inspect other people’s accounts.

# What is a block explorer for developers?

Obviously, developers are looking for stable, fast, feature-rich, and most importantly — free APIs for accessing blockchain data, so they can build cool services on top of it. Bright examples are baking-bad.org (opens new window) and better-call.dev (opens new window).

In fact, such APIs have a big impact on the entire blockchain ecosystem, since the easier it is to access the data, the more projects are developed and the more developers are involved, the more activity in general. This is just what one needs for a persistent network growth

Equally important is the variety of data provided through the API, since the more data, the more projects can be built on top of it. For example, why do we still use TzScan API at baking-bad.org (opens new window) despite the fact that it often runs out of service and is rather slow lately? This is just because there are no block explorers in Tezos which provide the same (or at least similar) data via API — baking rewards split, rewards per delegator, etc.

So for developers, a block explorer is mostly an API provider.

# What is a block explorer for growing projects?

While your project is small and doesn’t operate with sensitive data it’s fine to use a third-party public API. But when there are high loads or it’s critical to have 99.9% uptime, third-party services are a bottleneck. Imagine if you need to get 1000 records, but the service allows a maximum of 50 records per request and 5 requests per second. It takes 4 seconds to load only 1K records. Or imagine that in the middle of the atomic swap procedure the explorer you use in your application suddenly stops to respond. Nothing good.

Therefore, such projects are interested in using self-hosted solutions that can be run as a stand-alone service and even better if it doesn’t cost a lot of time and resources.

In other words, the best way to access blockchain data for large projects is to use public APIs in the early stages and be able to build and run their own when the throughput is insufficient or reliability and scalability requirements are not met.

# What can we learn from all this

Let’s summarize all mentioned above and highlight the key features an ideal block explorer must have:

  • First of all, a block explorer has to be an account explorer to meet most user needs. This also means a different account “processing” for different accounts types;
  • Block explorer has to provide a stable, reliable and flexible API with a variety of data;
  • Block explorer has to have its own indexer that not just indexes entities from the blockchain as is, but processes them to enrich the data;
  • Block explorer has to be open-source so anyone can fork and customize it.

# So what?

We’ve described the main principles we follow in the TzKT explorer development. In the next articles, we will talk about TzKT design and implementation details.

Follow us on Twitter (opens new window) and join our Telegram (opens new window) chat where you can ask any question about our products and services.