Skip to content

Templates Overview

Introduction

Appchains deployed through Tanssi are fully customizable blockchains benefiting from a shared set of sequencers and the security of a provider of their choice (for example, Symbiotic for Ethereum). They also need to implement the necessary functionalities and configurations to support the Tanssi protocol, which the templates presented in this article already do, making it easier for developers.

As presented in the Included Templates from the Learn section, Tanssi already provides two templates to jumpstart the development process:

In this article, the required base setup and how to use the templates as a starting point to start building your Tanssi appchain are presented.

Base Setup to Support the Tanssi Protocol

Tanssi appchains must implement the following modules to support the protocol and benefit safely from Tanssi's block production as a service:

  • Author Noting - registers the set of sequencers assigned to the appchain by Tanssi
  • Author Inherent - Allows the sequencer authoring the block to include its identity to get validated and rewarded

If you don't include these modules in the Tanssi appchain's runtime, there won't be a method to confirm that the blocks are being generated by trustworthy sequencers designated by the Tanssi orchestrator. This could create a vulnerability for malicious actors to exploit and compromise the appchain.

More information about Tanssi's block production as a service and the interaction between Tanssi, the security provider, and your Tanssi appchain can be found in the Technical Features article.

Besides block production, there are other essential aspects for any appchain covered in the templates, such as:

  • Consensus - appchains have the necessary functionality to allow the sequencers to produce blocks, gossip and validate them, and coordinate with the security provider to get notified about the block's finality
  • Appchains Interoperability - handles the ingestion and dispatch of incoming downward and lateral messages, allowing a Tanssi appchain to communicate and interoperate with the other chains within the ecosystem
  • Runtime Upgrades - a runtime upgrade in a Tanssi appchain must be informed to the security provider's operators to allow them to check on the blocks produced by the sequencers of the Tanssi appchains

Included Modules

Besides the necessary modules to support the operation of a Tanssi appchain, many other modules provide functional behavior that the users can interact with.

These are some of the functional modules exposing a behavior to the users that are included in the templates and ready to use:

  • Balances - the Balances module provides functions for handling accounts and balances for the Tanssi appchain native currency
  • Utility - the Utility module provides functions to execute multiple calls in a single dispatch. Besides batching transactions, this module also allows the execution of a call from an alternative signed origin
  • Proxy - the Proxy module provides functions to delegate to other accounts (proxies) the permission to dispatch calls from a proxied origin
  • Maintenance Mode - the Maintenance Mode module allows the Tanssi appchain to be set to a mode where it doesn't execute balance/asset transfers or other transactions. This could be useful when upgrading the runtime in an emergency, when executing large storage migrations, or when a security vulnerability is discovered
  • Tx Pause - the Tx Pause module allows a valid origin (typically Root) to pause (and unpause) an entire module or a single transaction. A paused transaction (or all the transactions included in a paused module) will fail when called until it is unpaused. This module provides a higher degree of granularity compared to maintenance mode, making it particularly useful when a faulty or vulnerable transaction is identified in the runtime
  • Multisig - the Multisig module enables transaction dispatches that require -typically- more than one signature. A multisig transaction defines a set of authorized accounts and a threshold for its approval, requiring consensus among multiple parties

Start Building

To start building on top of the provided templates, be it the Baseline Tanssi appchain template or the Baseline EVM (Ethereum Virtual Machine) template, the recommended approach is to fork the Tanssi repository and start adding built-in modules or custom-made modules on top of the latest release tag.

This approach comes with some advantages, such as:

  • Building on top of the latest and stable release
  • Get the Tanssi protocol already configured and included in the template runtime
  • Keep your fork up-to-date by syncing with the Tanssi upstream repository
  • Run the included tests, ensuring that block production on your Tanssi appchain works as intended
  • Run a complete local environment with the included Zombienet configuration

If the templates already cover your use case needs, or after building and testing your chain, you can continue with the Deploy your Tanssi appchain via the Tanssi dApp article to know how to use the Tanssi dApp to register and get your chain up and running.

Last update: November 7, 2024
| Created: August 16, 2023