August 29, 2023 5:30 AM
Announcing Tezos entrypoints analysis
>>
In this article we announce Tezos entrypoint dashboards, a new set of views on Tezos transaction data, created by segmenting solely on name of entrypoint in transactions. Providing a high-level overview on activity within the Tezos network. Segmentation via this more "linguistic" approach, gives insight on how the network functions overall, as opposed to looking at user-facing constructs such as accounts or dApps.
The initial audience kept in mind in creating these views are developers and analysts with an interest in the Tezos ecosystem and smart contract blockchain platforms. For developers, these views provide visual and interactive ways to explore the current functionalities expressed via entrypoints in networks of smart contracts. For analysts, these views provide statistics on various categories of on-chain Tezos activity more as a whole instead of per individual smart contract or dApp.
Basis for this set of views is a lexicon of entrypoint names in use by smart contracts. For each entrypoint name a dashboard with charts, supported by pre-calculated datasets are available. Creating a unique way to navigate and visualize blockchain data, showcasing how a smart contract blockchain network such as Tezos operates as platform providing permissionless interoperability. Enabling decentralized applications to be built out of a composable ecosystem of building blocks, designed to work together by developers to deliver end-user functionalities.
To skip ahead and go straight to the data & dashboards, go here:
Read on for further details on the construction of the datasets, dashboards and potential for analysis.
To get into it, let's start with some examples of the new charts visualizing this entrypoint name-based view on Tezos data. Highlighting the opportunities & limitations with this method of slicing transaction data.
Let's say, we want to get an idea of how many tokens have been minted on the Tezos chain. A number that's possibly useful as rough upper bound to calculate supply share of various minting platforms or smart contracts. The purpose of this article is not to answer this question exactly (there are other methods that will get you to that question actually quite quickly*), but we use this as an example to illustrate both the opportunities but also crucially, the limitations. Skipping over a lot of details and nuances if we want to answer this specific question in full.
Not all tokens are created equally, but we would like to get to a rough order of magnitude. One way to approach it is to look at the mint
entrypoint on various token contracts. Which is used, not by all, but by many smart contracts to populate the smart contract state with token data.
The above chart shows the amount of times per day, entrypoints with the name mint
have been called across the full Tezos blockchain. Giving already some indication of how many times per day tokens have been minted on the Tezos chain. (For most recent data, see the mint dashboard.)
Some of the top contracts on the Tezos chain which have implemented a mint
entrypoint are the FXHASH Generative Tokens v2, hic et nunc NFTs and Tezotopia Resources contracts. These three together already account for over ~2 million mint
transactions. But there are actually on the time of this announcement, over ~70.000 smart contracts with a mint
entrypoint that has been targeted at some point by a transaction on the Tezos chain. Instead of looking at each of those 70k smart contracts individually, the above chart aggregates all the mint
calls together for the full picture.
In the below table we can see the top contracts by mint
transaction count:
Note already how the top two contracts have the exact same transaction count.
In the next chart we can see the same data but now the cumulative value is shown. So we can already start to get to a rough order of magnitude of tokens. (However there is a lot of nuance here because nr of calls does not necessarily equate to amount of assets, entities etc, but we'll get to that after.)
There are already some nuances to note here. The above chart shows the amount of times the mint
entrypoint has been called. It doesn't show the amount of tokens that have been minted. Some smart contracts might mint 1 token in a transaction, others might mint thousands of tokens per transaction. So the above chart doesn't show the full picture of how many tokens have been minted on the Tezos chain. Furthermore, the Tezos FA1.2 and FA2 token standards do not actually specify a mint
entrypoint as part of their standard interface. The above chart shows the amount of times the mint
entrypoint has been called. Other smart contracts such as the McLaren F1 23 collectibles contracts have used a mint_tokens
entrypoint. (We are also not going to unravel the thread of fungible vs non-fungible minting here.)
Actually by searching for mint
on the Entrypoints index page, we get a whole range of over a hundred entrypoints that include the term mint
in their name.
Search results here: mint entrypoints
We highlight these nuances to convey that this analysis has its restrictions and does ask of the reader to be careful in drawing conclusions.
In these views, transactions are grouped purely by entrypoint name
targeted, independent of the smart contract being targeted. The below chart makes that explicit by showing the accounts involved per day in transactions targeting the mint
entrypoint.
This chart, again shows data related to the mint
entrypoint. Instead of transaction count, what is visualized above is the number of accounts involved on either side of the mint
transactions. With the light blue line we can see that from 2022 onwards, in the range of 500 to a thousand unique smart contracts were targeted in a transaction towards their mint
entrypoint. While the amount of accounts sending transactions targeted towards mint
entrypoints fluctuated much more, peaking up to ~3,500 accounts on some days early 2022, but currently dropping into the low hundreds of accounts per day.
Further nuance is that in quite some dApps, a controller contract is used to manage the minting of tokens. In such cases, the controller contract will be the target of the mint
transaction, but then will create one or multiple other mint
transactions targeting other entrypoints, and will be counted twice if both the controller contract and the token contract use mint
as entrypoint name. This kind of transaction forwarding, is usually not done with any bad intentions to e.g. inflate data, but facilitates developers to create more modular configurable smart-contract based applications. Such a mechanism is used by the FXHash contracts which already appeared above.
Another network of smart contracts generating a steady number mint
transactions is for example the Youves platform, where the Youves Synthetic Asset contract has a mint
entrypoint itself, but also generates new mint
transactions targeting a number of their other smart contracts for synthetic asset creation. Next to the line charts shown above, the Entrypoint Dashboards include interactive network visualizations. These facilitate you to explore the networks of accounts and smart contracts involved with specific entrypoints. The below picture for example shows that Youves network of smart contracts with mint
entrypoints:
Dashboard: mint
So far we have looked at mint
entrypoints to introduce the data and the graphs that have been produced. We have not gotten much closer to answering the question of how many tokens have been minted on the Tezos chain (At minimum, millions). However by taking an entrypoint name such as mint
as starting point, we can start to quickly explore how minting functionality is implemented and performed in various ways on the Tezos chain.
On the Tezos blockchain there are actually over ~3.000 unique entrypoint names in use already by smart contracts. The Entrypoint Dashboards page, provides a searchable index of all entrypoint names in use on the Tezos blockchain. From there you can navigate to dashboards for any specific entrypoint name with the same charts as shown above.
In the rest of the article we go into a bit more detail on what entrypoints are, how they are used and how the data is processed to produce the dashboards.
Where do entrypoint names come from?
Within the Tezos tech stack, developers can expose functions in their smart contract, which then become so-called 'entrypoints'. This is part of the functionally of Michelson. After the developer has published a smart contract on the chain, these entrypoints can be the target of a transaction. Upon being targeted, the smart contract will take input data coming with the transaction and use these to attempt to execute the code of the contract. Potentially, the code generates further transactions, targeting other smart contract entrypoints. In the current protocol implementation, smart contracts do not have to follow any specific naming scheme rules** for the entrypoints, however developers can choose to follow standards. As such, any kind of entrypoint name can potentially be used. Multiple smart contracts on the Tezos chain can also have the same entrypoint name, even though the code behind it might be completely different.
To repeat: The charts from this analysis show statistics that potentially relate to many different smart contracts. The analysis only looks to the naming of the entrypoint within the transaction without consideration to the code behind the entrypoint per contract.
Data processing pipeline
By looking at all available transaction data on the Tezos chain, we can figure out which entrypoints were targeted. So the starting point for this analysis is a lexicon of entrypoint names in use on Tezos. Simplifying the blockchain as a smiple table of transaction, we get this via the following query:
SELECT DISTINCT entrypoint FROM transactions;
Giving us a list of all unique entrypoint names targeted in a transaction on the Tezos chain.
The vast majority of the ~3.000 entrypoints do not have a huge number of transactions. But for some entrypoints such as mint
or transfer
the number of transactions is in the millions. To deliver responsive dashboards that can quickly display statistics for the various entrypoints, this data is processed on a regular interval and cached into datasets with aggregated statistics. For each distinct entrypoint name the following datasets are produced:
- {entrypoint_name} daily stats time series
- {entrypoint_name} smart contracts
- {entrypoint_name} smart contracts top 100
- {entrypoint_name} accounts calling
- {entrypoint_name} accounts calling top 100
- {entrypoint_name} network
- {entrypoint_name} network reduced
- {entrypoint_name} statistics summary
Each of the datasets is based on the set of all transactions targeting entrypoints on any contract that match with the specified entrypoint name.
{entrypointName}-daily-stats-time-series
This dataset is produced as a CSV file with daily statistics for the date range from the first to the latest transaction targeting any entrypoint for the specified name. Statistics include daily transaction count, contracts targeted, accounts calling, wallets calling, smart contracts calling.
{entrypointName}-smart-contracts
This dataset is produced as a table of accounts stored in a CSV files. The accounts table includes all smart contracts that have implemented and had the entrypoint targeted in a transaction. Per account aggregated values are included for number of transactions, first and most recent transaction date, unique nr of accounts that have targeted this contract. Depending on the entrypoint name, this list can grow into the thousands or more. Therefore a top 100 variant is also generated for faster preview.
{entrypointName}-accounts-calling
This dataset is produced as a table of accounts stored in a CSV files. The accounts table includes all accounts which were the source of a transaction towards an entrypoint with the specific name. For some common entrypoints such as transfer
, collect
] or ask
this list can grow into the tens of thousands. Therefore a top 100 variant is also generated for faster preview.
{entrypointName}-network
This dataset is produced as a JSON file that captures as nodes in the network all contracts being targeted and accounts calling, while the edges in the network capture the transactions between them for calls towards any entrypoint with the specified name. As extra attribute on both the nodes and edges the number of transactions is included.
The full network will by definition include all contracts and accounts involved in transactions targeting entrypoints by specific name. So for the network data as well a reduced version of the dataset is generated, which only includes the top accounts and smart contracts by nr of transactions involved in transactions with entrypoints with the specific name.
{entrypointName}-statistics-summary
This dataset is a simple JSON file with high level statistics for the entrypoint name. Including the number of transactions, number of smart contracts, number of accounts, number of wallets, number of unique smart contracts, number of unique accounts, number of unique wallets.
These datasets are published in our data catalog and refreshed with the latest data regularly. From there these datasets become the basis for the dashboards as described in the next section.
Dashboards
Dashboards are accessible for each distinct entrypoint name on the Tezos chain. The mint
graphs as included in the introduction are a preview of the charts included in the dashboard as well. The initial version of the dashboard contains four charts. Starting with a network visualisation that shows the top accounts involved with entrypoints by the specified name.
Network visualisation
Click on nodes to highlight the specific sub-network for that account.
Dragging nodes will fix them into position, by playing around with different positions, you can for example see the cluster of accounts that are interacting with two different smart contracts.
The following charts are further included in the launch version of these dashboards:
{entrypoint_name} transactions per day chart
Shows the transactions from the daily stats time series dataset.
{entrypoint_name} transactions over time sum chart
Shows the transactions from the daily stats time series dataset.
{entrypoint_name} accounts involved per day chart
Shows the number of accounts involved on either side of the transaction per day from the daily stats time series dataset.
{entrypoint_name }accounts involved tables
Two tables that show the accounts on either side of the transactions towards entrypoints by the specified name.
To see them in action, go to the Entrypoints Dashboards page and click on any of the entrypoint names. Or quicly go to any of the following interesting entrypoint names to take a look at first:
Conclusion
Smart contracts provide a unique new building block for developers to craft and adopt in the tech stack of their applications. Their functionalities are exposed in the form of entrypoints. Which can be called by end users directly or by other smart contract code, providing composable levels of functionality and state to end users.
Code and system composability has long been part of the software tech stack. In the form of libraries, code packaging, SDKs developers can include code from others in their own applications. Via APIs, RPCs, web hooks, etc. applications can communicate with each other and leverage data and logic between systems. Smart Contract blockchain networks provide a unique new deployment target where both the code and the data get published and distributed together. Where these become permissionlessly available for others to integrate with (insofar as the rules in the code of the smart contract allow for it).
It is of course up to the developers of smart contracts to extend the permissionless design philosophy and express it in the design of the smart contract functionality. But if they do, then the smart contracts and entrypoints become an ecosystem that can be used by others to build on top of.
The above-described data views and dashboards with visualizations showcase the emergence of such an ecosystem on the Tezos blockchain. Serving as proof point that developers do adopt such technologies and that interopable applications do emerge. Over 20 million transfer
transactions and over 10 million update_operators
transactions confirm that developers and users do adopt the permissionless design concepts as expressed in the current FA1.2 and FA2 tezos TZIP standards**. Beyond that, over three thousand uniquely named entrypoints in use can further serve as fertile ground to inspire future standards development.
Start exploring here: Tezos entrypoints search
Links & further reading
- Tezos Smart Contract Dashboards
- xtz statistics for Tezos smart contracts
- Block space & baker fee stats for Tezos smart contracts
- TZIP 12 | FA2 - Multi-Asset Interface
- 2019 Announcement of entrypoints implementation in Michelson
- Michelson entrypoints documentation
Footnotes
*How to get to the number of tokens minted on the Tezos chain quickly?
Indexers such as TzKT also capture tokens in a table. Tokens (except for the native tez token for Tezos) are however not a native construct on the platform, but it emerges out of various smart contract implementations. For each implementation style, specific code might need to be written to extract the correct token data. It's therefore very hard to fully capture it a 100%. It depends on the indexer software which of these smart contract implementations are included within the token table. By relying on the token standard contracts such as fa12 or fa2 you can however capture a large part of the tokens currently published on Tezos.
**Smart contract entrypoint naming rules
The Michelson documentation specifies entrypoints as a stsring match between an input parameter and constructor annotation. Further, entrypoint names can be no longer than 31 characters as defined in the Edo protocol code. https://gitlab.com/tezos/tezos/-/blob/master/src/proto_008_PtEdo2Zk/lib_protocol/script_ir_translator.ml#L2778
***Selection of entrypoint names as defined by Tezos TZIP standards
- transfer - Defined in: TZIP-5, TZIP-7, TZIP-12
- getBalance - Defined in: TZIP-5
- balance_of - Defined in: TZIP-12
- getTotalSupply - Defined in: TZIP-5
- approve - Defined in: TZIP-7
- getAllowance - Defined in: TZIP-7
- update_operators - Defined in: TZIP-12