Polkaholic.io's Multi-Chain Substrate Block Explorer
- Team Name: Colorful Notion
- Payment Address: Polkadot 13rTinCWgc38a2wZzme28dFbViQraCowTRjQqFLEWwdMTvFW
- Level: 2
- Status: Terminated
Project Overview 📄​
Polkaholic.io is a Substrate block explorer with high parachain coverage (45+ chains) and is developing multi-chain functionality for the next generation of Polkadot users. Key new multi-chain features (see Why Polkaholic?) not widely available in other block explorers:
- monitoring accounts across chains with asset valuations in real-time
- performing historical analysis across chains
- monitoring XCM transfers across chains
The Polkaholic.io team would like to seek Web3F Level 2 funding for high availability APIs powering the Polkaholic.io UI. These APIs will support Polkadot parachain and dapp developers, and will be used in the Polkaholic.io UI to support useful multi-chain block explorer features for the next generation of Polkadot users:
- Support Polkadot defi users doing multi-chain transfers in and out of any chain
- Support Polkadot dapp and parachain developers doing real-time multi-chain analysis with standardized asset types
- Support Polkadot wallet developers with multi-chain APIs
It is essential for a public block explorer to be trusted, and while Polkaholic.io code is released under a GPLv3 license at:
- https://github.com/colorfulnotion/polkaholic/ it is difficult to trust that the indexing is 100% correct by simply auditing the above code and spot checking a few representative results. The approach Polkaholic.io has taken is an "indexing" approach, where all chain activity is analyzed and stored with additional information (e.g. asset values in USD) in Google Cloud's BigTable/BigQuery/mysql. This is complementary to the approach taken by polkadot.js.org's reference app, where a single endpoint is probed in real-time.
However, for Polkadot users to trust Polkaholic.io's index, all indexed data must be verifiable to the fullest extent possible, which we propose to do by augmenting every Polkaholic.io page with:
- (a) browser-based JS that verifies the results shown in any page as being the same as the indexed data using one or more WS endpoints
- (b) server-side JS that continuously (randomly) verifies any key object ( account, block, tx, chain etc. ) returned in any API call against one or more WS Endpoints
Currently, every page on Polkaholic.io shows how to use the Polkaholic.io API to derive the data shown on the page, which we have taken as a design principle.
We propose to take this further, by publishing the code of (a)+(b) alongside these same API calls. If any verification fails, the failure can be automatically logged and used to improve the index (rather than, say, waiting for users to report data issues, or for developers to point out bugs with the indexer code). All chain's random checks can be published as metadata with the chain. As verifications pass and Polkaholic.io approaches 100% verifiability, users should increase trust in the Polkaholic.io index.
Project Details​
To illustrate Polkaholic.io's fully working multi-chain UI + APIs, we tabulate 5 representative UI / API calls here:
Chains​
curl -H "Authorization: YOUR-API-KEY" "https://api.polkaholic.io/chains"
Account​
curl -H "Authorization: YOUR-API-KEY" "https://api.polkaholic.io/account/extrinsics/0x2c8feeab5bd9a317375e01adb6cb959f1fea78c751936d556fa2e36ede425a47"
Account XCM Transfers​
curl -H "Authorization: YOUR-API-KEY" "https://api.polkaholic.io/account/xcmtransfers/0x2c8feeab5bd9a317375e01adb6cb959f1fea78c751936d556fa2e36ede425a47"
Search XCM Transfers​
- Search XCM Transfers UI URL
- Search XCM Transfers API Sample Call:
curl -H "Authorization: YOUR-API-KEY" -X POST -H "Content-Type: application/json" -d '{"startDate":"2022-07-03","endDate":"2022-07-06","chainID":"0"}' "https://api.polkaholic.io/search/xcmtransfers"
Search XCM Messages (under development)​
- Search XCM Messages UI URL
- Search XCM Messages API Sample Call:
curl -H "Authorization: YOUR-API-KEY" -X POST -H "Content-Type: application/json" -d '{"startDate":"2022-07-03","endDate":"2022-07-06","chainID":"0"}' "https://api.polkaholic.io/search/xcmmessages"
Polkaholic.io Backend​
Briefly, the backend is organized as follows:
- A Google Cloud stack (BigTable, BigQuery, mysql) is used in 3 regions (US/EU/AS) to store blocks, txs, accounts, XCM transfers, and XCM Messages
- Blocks, traces, EVM logs for all chains are crawled/indexed from WS Endpoints in realtime with followup hourly analysis and backfill processes. A BigTable and mysql table support each chain, 5 BigQuery tables support each major type of object (extrinsics, transfers, xcmtransfers, xcmmessages, evmtxs)
- XCM Transfers are matched in real time, currently based on asset + address matching
Ecosystem Fit​
The Polkadot ecosystem benefits from users being able to transact with their assets on multiple chains easily, through teleporting and the new XCM Messaging system enabling "remote control" over asset states on other parachains. There are many block explorers in the ecosystem (eg subscan.io) but these were architected for users using interacting with a single parachain rather than the dozens of parachains that exist today which are rapidly adding XCM transfers. As users use their wallets to manage their assets on a greater number of parachains, users will need a block explorer, dapps, wallets that takes multi-chain account views and multi-chain transfers as central to their UI. Polkaholic.io aims to provide the UI and APIs for the ecosystem to support these multi-chain views.
Currently, there's no easy way to track XCM transfers, messages and do XCM analytics between chains for individual accounts and with parachains in aggregate. Polkaholic.io proposes to change this, by providing a set of APIs to help Polkadot developers. We believe a suite of verifiable APIs + UI (concerning XCM Messages, XCM Transfers, XCM Analytics) can be used by:
- parachain devs + dapp devs and wallet devs (XCM Messages, XCM Analytics) -- API, used in polkaholic.io
- defi/NFT chain users (XCM Transfers) -- UI
Having a open-source reference implementation can also aid other ecosystem participants in their own development and analytics.
Furthermore, we believe that supplying the concrete verifiable browser-based and server-based code will serve as educationally instructive to the Polkadot ecosystem, and be representative of how multi-chain block explorers should work.