Developing Analog's Timechain: Why we chose Polkadot SDK

Discover why Analog chose Polkadot SDK to power its Timechain, leveraging modularity, security, and forkless upgrades to create a seamless interoperability hub for multichain and cross-chain dapp ecosystems.

By Eric WangDecember 30, 2024

Analog is a one-stop interoperability hub, offering a suite of protocols that address native dapp developments in multi-chain and cross-chain environments. Analog’s foundational component is the Timechain, a custom-built blockchain utilizing Polkadot SDK. The Timechain serves as a fundamental accountability layer for all network operations.

In this post, we explain why we used Polkadot SDK instead of other development frameworks.

Background and context

Exactly two years ago, Analog proposed the Timechain, an interoperability-focused blockchain network designed to meet the native dapp development requirements in multi-chain and cross-chain ecosystems. Victor Young, Co-Founder and CEO of Analog, shared his belief that no single blockchain can solve everything. Instead, to unlock opportunities for a wide range of solutions in Web3, multiple siloed blockchains must be able to interact meaningfully with one another through interoperability.

Focusing on security, chain-agnosticism, and an all-in-one interoperability network, the Timechain would serve as a ledger for all the ecosystem activities—essentially acting as an accountability layer. Timechain is designed as a sovereign blockchain enabling dapps to connect to any other dapp or blockchain seamlessly and securely.

Obviously, selecting an appropriate technology framework for building the Timechain was our top priority. We understood that even slight differences in the problem we were solving could significantly impact the efficiency of the solution we intended to build, with the Timechain serving as an all-in-one interoperability hub being one key consideration.

Blockchain SDK considerations

Graphic comparing Polkadot and Cosmos blockchain ecosystems with categories such as future compatibility, customization, agile governance, and programming language, highlighting Polkadot's advantages in these areas.

From the start, we didn’t choose to build the Timechain from scratch because it would have been too complex and time-consuming. Instead, we considered using a pre-built open-source SDK. After carefully evaluating the available blockchain development frameworks, the choice was narrowed down to Polkadot SDK versus Cosmos SDK.

If you had been closely following the interoperability space at the time, you would have noticed that many similar projects, like Axelar and Zetachain, were being developed on top of Cosmos SDK. Cosmos SDK would have been the logical starting point for building the Timechain, especially since some of these protocols had already launched their testnets.

However, a few factors stopped us from pursuing this route after comparing Cosmos versus Polkadot SDKs. More specifically:

  1. Did Golang in Cosmos SDK provide a real advantage over Rust language in Polkadot SDK?
  2. Which framework provided better libraries and tooling for implementing a custom blockchain like the Timechain?
  3. Which framework had better future compatibility and performance for the state transitions?
  4. Which framework was more agile in terms of onchain governance and upgrades?

Why Polkadot SDK?

Early on in the development, we faced the challenge of designing a blockchain that was fully compatible with the Threshold Signature Scheme (TSS) while also utilizing its underlying Byzantine Fault Tolerant (BFT) capabilities. Finding different TSS design decisions, such as whether TSS nodes should function as onchain validators or offchain workers, proved particularly difficult.

Analog successfully integrated a TSS module in the Timechain by utilizing the concept of off-chain workers within the Polkadot SDK. This module allows the Timechain to interact seamlessly with external blockchains. Moreover, due to Polkadot's modular consensus layer, Analog was able to build an NPoS consensus framework compatible with TSS.

Based on these design decisions, we came up with different custom pallets. To start with, Analog implemented the shards pallet, which keeps track of the shard status (e.g., offline, online, or committed). This pallet hosts the logic of the Chronicle Nodes, which are off-chain validators that attest to external transactions.

Analog also developed other custom pallets, including:

  • Elections pallet: Manages unassigned members and creates shards if enough members are online.
  • Networks pallet: Facilitates the creation of new networks (i.e., blockchains).
  • Task pallet: Provides several extrinsic for managing various operations.

Beyond enabling the TSS functionality, other reasons we found the Polkdat SDK helpful include:

  • Security: While both Rust and Go are modern, high-performance languages, Rust’s robust memory management capabilities provide a greater degree of security.
  • Forkless upgrades: Polkadot SDK allows us to update the runtime logic without creating a hard fork. This is possible because it includes the runtime WebAssembly (WASM) blob as a component in the blockchain’s runtime state.
  • Future compatibility and performance: Because WASM is at the core of all the state transition functions in Polkadot SDK, which is stored on-chain, we are able to build a future-proof Timechain.

Takeaways

Building a blockchain from scratch can be complex, time-consuming, and resource-intensive. Polkadot SDK is a popular and battle-tested framework that has allowed Analog to build a future-proof blockchain. Thanks to the separation of the client (WASM executor) and the blockchain runtime (state transition function), as well as the modularity of the Polkadot SDK pallets, Analog has been able to build an interoperable protocol that addresses developers’ needs in multi-chain and cross-chain environments.

From the blog

Polkadot Roundup MMXXIV

Dive into Polkadot Roundup MMXXIV for an in-depth look at 2024 milestones, including high-performance rollups, decentralized governance, and exciting expansions. Discover how Polkadot is evolving into a next-level web3 platform—plus a sneak peek at Polkadot 2, Polkadot 3, and the JAM protocol supercomputer.

Unifying Polkadot’s developer docs: A new chapter for builder experience

The PaperMoon team, supported by a Decentralized Futures grant, launches the Polkadot Developer Documentation Hub, a unified platform that simplifies developer onboarding and provides access to essential resources. This marks a transformative step for builders in the Polkadot ecosystem.

Building the future of decentralized marketing: A case study

Polkadot’s decentralized marketing sets the standard for Web3 growth. With OpenGov, bounties, and community tools, contributors are empowered to innovate, ensuring consistent, impactful campaigns and showcasing the potential of decentralized ecosystems.

Uplifting new voices and validators: Polkadot's path to sustainable decentralization

Decentralized Nodes and Decentralized Voices programs by the Web3 Foundation offer pathways for validators and governance participants to gain influence based on merit, helping to build a fairer, more resilient Polkadot ecosystem that aligns with the core principles of web3.

Is large-scale, high-quality Web3 education possible?

The Polkadot Blockchain Academy (PBA) is taking Web3 education to the next level with PBA-X, an online course crafted to deliver high-quality blockchain knowledge at scale. Learn how we’re preserving educational standards, fostering a global community, and creating new opportunities for learners everywhere.

Blockchain explained: A practical guide from concepts to use cases

Blockchain has grown far beyond its roots in cryptocurrency, reshaping industries from finance to healthcare. This guide walks you through the basics, benefits, and groundbreaking potential of blockchain and its impact on the future of the open internet.

Empowering the next wave of founders: Welcome to EasyA x Polkadot University

Unlock a structured path to start building on Polkadot with EasyA x Polkadot University.

Dynamic & Modular: Scaling Ambition with Agile Coretime

Polkadot’s Agile Coretime simplifies launching and scaling blockchain projects with dynamic blockspace allocation and flexible cost options. Learn how Agile Coretime makes it easier to build, launch, and scale ambitious Web3 projects.

How play-to-earn (P2E) is transforming onchain mobile sports gaming

Play-to-earn games are transforming mobile sports gaming. Learn how blockchain, NFTs, and platforms like Polkadot create new opportunities for digital asset ownership and cross-chain gameplay.

Polkadot Token 2049 and Decoded Asia 2024: A multichain ecosystem in action

At Token 2049 and Decoded Asia 2024 in Singapore, Polkadot teams and contributors showcased a multichain future for real-world applications. Key moments included Dr. Gavin Wood’s vision for digital individuality, Chrissy Hill’s regulatory insights, and announcements from emerging projects shaping the Web3 ecosystem.

What is a crypto wallet? Your all-access pass to the future web

In Web3, your wallet is your most valuable digital tool. It’s more than just a place to store, send, and receive cryptocurrencies securely—it’s your passport to the decentralized world.

July 2024: Key network metrics and insights

Welcome to your go-to source for the latest tech updates, key metrics, and discussions within Polkadot, brought to you by the Parity Success Team. This blog series covers a variety of topics, drawing insights from GitHub, project teams, and the Polkadot Forum.