top of page
  • Twitter
  • Telegram
  • Discord
  • GitHub
  • Youtube
  • Writer's pictureAndrey Shevchenko

Why Building Appchains in a Substrate Environment is Your Best Choice

Updated: Jul 14, 2023

Polkadot is a programmable blockchain platform providing a space for developers to deploy their own blockchains, known as parachains. Parachains run on the Polkadot Relay Chain and are developed using Substrate, the foundational blockchain framework behind the Polkadot ecosystem, which empowers developers to create fully customized appchains. The Tanssi protocol, an appchain infrastructure tool, streamlines this development process, turning what used to take months into a process that can be accomplished in under an hour. This increases efficiency and expedites deployment like never before.


Polkadot parachains, built using Substrate's Rust-based blockchain framework, are bundled with a variety of integrations and innovative tools. Polkadot operates on a variant of Proof of Stake, and the parachains derive their consensus from Polkadot, ensuring a robust security model. Thus, to compromise a single parachain would necessitate breaking the security of the entire Polkadot network.


It is fair to say that unless one is immersed in the Polkadot community, the full extent of its capabilities might not be immediately apparent. In today's landscape, specialized blockchains catering to specific applications, such as games or DeFi platforms, usually consist of a unique EVM/Solidity environment that doesn’t share space with all other apps on Ethereum or similar platforms.


However, Polkadot takes a different route. Thanks to the Substrate blockchain development framework, developers have the capability to implement their own integrated applications, create custom gas rules, tailor transaction hooks, and even bring to life their most imaginative ideas. When these efforts are combined with Tanssi for deploying an appchain, the onboarding process to Polkadot becomes a breeze, effectively reducing much of the complexity that often makes teams wary of constructing their own chains.


Before diving into the numerous benefits of choosing Polkadot and its underlying Substrate framework for building appchains, it might be beneficial to review the Tanssi technical overview. This detailed blog post provides an in-depth look at Substrate, exploring its technical aspects and the current landscape of real-world use cases.


It's time to dive deep into the six compelling reasons why choosing a Substrate environment for building an appchain emerges as the top-tier choice.


Versatility and Out-of-the-Box VM Options


One of the major advantages of building on Polkadot is the variety of options available to developers straight out of the box.


Utilizing Substrate pallets makes it possible to effortlessly introduce a smart contract environment, either in WebAssembly or the EVM. And, on top of that, building on the work conducted by parachains like Moonbeam, the integration can be accomplished swiftly, so swiftly, in fact, that nearly all generalized Polkadot parachains have some sort of EVM integration.


On the WebAssembly side, the native pallet_contracts support contracts written in Ink!, an Embedded Domain Specific Language (EDSL) that largely looks like Rust. However, Polkadot-native smart contracts haven’t seen as much development, as most teams prefer to implement custom blockchain runtimes to create their applications.


There's a strong reason behind this preference. Custom Runtimes are faster and offer more flexibility than smart contracts. They feature native upgradability from the get-go, circumventing the need for complex proxy contract setups. Additionally, unique operations can be executed at a Runtime level that is inconceivable within smart contracts (more on this later).


But contracts don’t encapsulate the entirety of what blockchains can offer. Substrate also incorporates several crucial modules such as governance, fungible and nonfungible tokens, domain names, salaries, consensus, treasury management, and more.


Overall, Substrate is well-designed to handle all the basics, allowing developers to focus on creating their unique app logic, rather than reinventing the wheel each time. While there will be more steps required from publishing code to launching the parachain, by and large, the development stage is relatively easy and quick to initiate (especially when compared to other appchain environments).


Cost-Effective and Secure Parachains


When it comes to security and affordability, Polkadot’s parachains are hard to beat.

Parachains on Polkadot are distinct blockchains that rely on the main Polkadot Relay Chain for consensus. To be accepted as a parachain, a blockchain must win the current parachain auction by bonding the largest amount of DOT among all competitors for that slot. Once victorious, the parachains enter into a predefined lease lasting 96 weeks, or just under two years.


During this time, the initial bond is locked as collateral, though it’s returned once the lease expires. Effectively, for those capable of securing the required capital, a parachain is essentially costless. The only costs are in opportunity: because the bonded DOT cannot be staked, resulting in a baseline missed gain of about 20% APR, in addition to being unable to access the capital.


However, even here, cost reduction strategies exist. The first one involves using crowdloans, a method for sourcing DOT from the community in return for the parachain's tokens. This approach effectively promotes early token distribution, as contributors lock up tangible assets to receive vested parachain tokens. It ensures a high level of commitment from these community members, unlike simpler distribution methods like airdrops.


Once the crowdloan is launched, there are a number of projects, such as Bifrost and Parallel, offering liquid parachain crowdloan derivatives, which essentially create an IOU token representing the DOT locked in that parachain’s lease. Crowdloan contributors (which can include the team itself) can realize those staked DOTs to earn yield elsewhere, vastly reducing their opportunity costs.


So, in summary, Polkadot parachains can be acquired nearly for free, as long as projects can muster the liquidity. But even this requirement has seen a substantial reduction in recent months.


Polkadot Parachain Auctions Timeline | Tanssi Network
Source: parachains.info

The most recent auctions witnessed projects secure their slots with as little as 117k DOT bonded, equating to roughly $700,000. This is a significant decrease from the $1.4+ billion secured by the inaugural parachains back in November 2021. Several factors contribute to this steep fall, from the drastic market downturn since then, to the significant increase in parachain supply.


Nevertheless, with these costs, a parachain effectively needs to bond less than $500k annually to be secured by a network worth $6 billion. This is incredibly affordable, especially when compared to an L2 rollup like Optimism, which incurs approximately $60M every year in L1 gas costs (based on 2B gas used daily priced at 45 Gwei).


The costs are variable and may change in the future. But it’d be a long way before it becomes more expensive than independent security or L2 systems.


Substrate Offers Unique Tools Not Found Elsewhere


Polkadot does more than merely providing fundamental smart contract capabilities. It brings to the table tools and features that are either impossible or extremely challenging to implement elsewhere.


Let's begin with one example: blockchain hooks. Substrate allows the definition of various callbacks that execute at specific stages of the block production cycle, including:

  • OnInitialize: executed before processing the first transaction in a block

  • OnIdle: executed after the transactions are calculated but before the block is finalized, allowing adding more transactions if required.

  • OnFinalize: called after all transactions are applied, and the block is finalized

These hooks alone are extremely powerful for many types of use cases. For instance, they can enable "whole block" flash loans, special types of MEV rights, unique transaction fees, or numerous other concepts that may be conceived.


Next, there are the Offchain workers. This feature allows Substrate nodes to execute any type of action that doesn't require on-chain correctness guarantees, such as data storage, external HTTP requests, and complex calculations. While Offchain workers can read the chain's state, they cannot alter it without sending transactions.


This tool can be used for a number of features, including custom oracles, cryptographic calculations (that are difficult to compute but easy to verify), custom scalability solutions and many more.


Polkadot also has verifiable on-chain randomness thanks to its consensus mechanism, which can be effectively used for lotteries and games.


Substrate permits nearly any change in the block production and transaction rules. Teams have enabled features such as gas payment with any token, completely gasless transactions, or defining gas with custom rules. For example, a DEX could charge gas as a percentage of the trade's value, rather than a flat fee, significantly improving UX and profitability for specialized app chains.


Polkadot and Substrate provide complete creative freedom in designing custom blockchains, making it available through simple plug & play modules. For the innovators out there, it truly is a sandbox that’s still unexplored.


Polkadot Hack Protection and Kusama Canary Testing


One of the most underrated features of Polkadot (and Kusama) is the significant control it offers to governance, to the extent that very few security incidents have resulted in loss of funds.


One incident, in particular, showcases the power of governance. An attacker had siphoned 11k KSM (about $4M worth at the time) in October 2021, but governance swiftly reclaimed nearly all of the money as it was idling in the attacker’s wallet. What could have been a substantial loss of funds turned into merely an interesting incident to recount.


Hacks and vulnerabilities are an unavoidable reality when developing groundbreaking dApps. One reason why crypto has been heavily affected by them is that it's straightforward for hackers to make off with the money. It's impossible to take it back, and blocking the escape routes is extremely challenging. In Polkadot, these escape routes are much easier to block and reverse, thanks to the enhanced governance power. While there may be some philosophical debates against this feature, the reality remains that in the current stage of blockchain technical maturity, this is invaluable.


This feature proves particularly handy on Kusama, the "canary" network of Polkadot offering nearly the same features as the Polkadot mainnet. Previously, the community attempted to position Kusama as an "independent" chain serving a different purpose or target audience compared to Polkadot.


However, this vision hasn't quite manifested, and the few Kusama-only projects have gradually migrated elsewhere as focus shifted almost entirely to Polkadot upon its launch. But Kusama remains an extremely beneficial environment for testing new ideas with real money on the table. This makes it far more practical than conventional "paper money" testnets, as it creates a realistic economic environment with stresses similar to mainnet.


In conclusion, developing on Polkadot offers far more safety measures than any other network, a truly unique offering in this space.


Seamless Connection With Polkadot’s XCM


Polkadot's Cross-Chain Message Passing (XCM) protocol enables teams to connect parachains with the broader ecosystem seamlessly. XCM is distinctive in the interoperability field due to its flexibility and security.


XCM messages transit via the Relay Chain, thus requiring a full parachain connection. However, the advantage over "peer-to-peer" messaging systems (or more trusted mechanisms, like those provided by generalized bridges) is that XCM's security is as robust as the Relay Chain itself.


With hundreds of independent validators, Polkadot boasts a notably decentralized consensus and stake distribution, making it optimal for hosting the parachain message passing system.

So, what kinds of messages are we talking about? The format is absolutely generic, so the limitations of XCM only extend to the creativity of the teams. Conventional token bridges are still the most common use case, effectively linking Polkadot and Kusama parachains with each other.


As teams pioneer new and innovative solutions, the general application of XCM is becoming evident. For instance, consider Moonbeam's Connected Contracts, aiming to allow Moonbeam smart contracts to interface with virtually anything else, whether it's on Polkadot or Ethereum and other chains.


Parachains like OAK Network offer similar XCM-enabled use cases, employing an event-based architecture that can "call" functions on other chains via XCM.


XCM is crucial to foster a fully developed appchain ecosystem. Without it, an NFT chain could never tap into on-chain liquidity for its assets, a DEX chain could never access additional assets to trade, and infrastructure chains could never acquire users.


Leveraging The United Polkadot Community


The last item, but certainly not least, is the strength and unity of the Polkadot community.

Polkadot boasts a vibrant and active community of developers, users, and enthusiasts who are passionate about the platform and its potential.


For new projects entering the ecosystem, the Polkadot community is an obvious source of first users, investors, and maintainers. New chains can solicit validators and collators from within the Polkadot community. Parachains can secure auctions by soliciting DOT from community members. When things go sour, the support of the community is vital to address these issues.


The community congregates in a few places, notably the Matrix chat. Simply chiming in there allows getting in touch with anyone, from regular fans to Polkadot and parachain developers.


Innovative teams, primarily in infrastructure, can apply for grants from the Web3 Foundation and receive some level of marketing and financial support. For other initiatives, the Polkadot treasury is open to anyone making any kind of legitimate proposal, including content, development, and marketing.


Overall, Polkadot combines the best of smart contract-heavy and independent blockchains. It is one united ecosystem that strives to work together on many issues, but it still enables a large degree of independence and self-sufficiency.


Are There Reasons Not to Build on Polkadot?


Apart from the standard business and opportunity considerations, there is one substantial downside to building your own parachain: the complexity of deployment. This issue isn't exclusive to Polkadot and impacts all appchains alike, but it does mean that smart contracts are objectively simpler to deploy and maintain than appchains.


Although developing the runtime with Substrate is relatively straightforward, launching a parachain involves numerous steps: enrolling collators, establishing block explorers, enabling wallet support, configuring XCM connections, arranging data indexing and analytics, integrating DEX, and more. These tasks are considerably more challenging with appchains than with smart contracts, where most of these auxiliary features are standardized from the outset.


Fortunately, that's where Tanssi comes in: making appchain deployment as simple as smart contracts. Through its ContainerChain protocol, Tanssi facilitates the creation of complete Substrate runtimes that are encapsulated within existing parachains. It’s similar to the virtual machine on a computer: a virtual and independent instance of a full operating system that can easily access its host's input/output channels when needed.


Tanssi represents the perfect blend of appchains' functionality and the ease of deployment inherent in smart contracts. You get to enjoy all the benefits of Substrate that we've previously discussed, in addition to more straightforward and cost-effective development, given that all the infrastructure setup is managed by ContainerChains.


While Tanssi is still a work in progress, stay tuned to learn more about building appchains with us!

396 views0 comments

Comentários


bottom of page