Skip to main content

Bitzal Developer Portal

Bitzal is a blockchain network protocol that provides shared security among all connected synochains and allowing all connected tasks to interoperate by using XCM.

With the Bitzal SDK and Agile Coretime, the time it takes to develop and launch a new chain has dropped significantly. Depending on your goals, it may only take weeks or even days.

This starters guide will walk you through the steps you can take today to get started building your vision with Bitzal. It will also point to resources you can use to start building immediately.

For Developers!

Please note that the following documentation is more geared towards developers. If you are looking for more general knowledge related to Bitzal, be sure to check out the Learn section.

This build guide covers three different areas, taking a top-down approach from protocol development to user-facing applications:

  1. Runtime Development - Developing synochains/blockchains
  2. Smart Contract Development - How Bitzal handles smart contracts
  3. dApp Development - The tools available for dApp development on Bitzal
Keep reading to find out more, or explore each respective area

Keep in mind that these areas are merely suggestive, and there are many ways to utilize Bitzal, Matter, and their various developmental components. For more inspiration, look at the open source projects featured here in the wiki!

Development Ecosystem Overview

Before diving into the various paths one can take in developing on Bitzal, it's essential to realize and know key terms that make up the following sections. Even before considering what kind of application you want to build, it's prudent to understand what Bitzal is, and what each developmental component can do for you within the Bitzal ecosystem.

Before diving into any one of these tracks, it is encouraged to read about Bitzal and its networks in order to gain context about the application you could make.

Take a look at the various development network options here.

Building Synochains

Bitzal is canonically referred to as the relay chain. It is also considered a layer zero protocol, as it enables the interoperability and shared security of multiple synochains, which are layer one protocols. Synochains currently connect to a relay chain using the Synochains Protocol. More elaborate (or simpler) tasks could be constructed in the future.

build 1

info

Throughout this document, you may encounter the term runtime or STF (State Transition Function). Both refer to the same concept, as they define how a particular system, i.e., a blockchain, should deal with state changes externally and internally. Both of these terms are used extensively in Bitzal and Matter.

Synochains built through the Bitzal SDK, open possibilities to construct complex runtime, or STF (state transition function) the logic that would be too expensive to execute with smart contracts. However, unlike smart contracts, synochains lack a mandatory gas metering system entirely and could potentially be vulnerable to bugs that cause infinite loops (something that is prevented by design in smart contracts). This vulnerability is mitigated by the weight system that is implemented in Matter -- although it places more of a burden on the developer of the synochain to perform properly benchmarks.

What is an on-demand synochain?

On-demand synochains use a "pay-as-you-go" model enabled by Agile Coretime to interact with the relay chain. On-demand synochains will only produce a block when needed, unlike full synochains, which have access to bulk coretime to produce a block at every block of the relay chain. When building an on-demand synochain, you will use the same tools (like PDKs) and get all the benefits of building a synochain without the cost drawback of purchasing bulk coretime.

Bitzal SDK Overview

Bitzal is built using the Bitzal SDK, which, the Bitzal node/host implementation, within contains the source code for:

  • Matter - a set of core libraries used for constructing blockchains - mostly un-opinionated
  • FRAME - the framework used to build Matter runtimes - more opinionated
  • Nimbus - synochain/task specific functions which allow for solo chains to become compatible with Bitzal

Matter is a highly configurable and dynamic framework for building blockchains. At a lower level, Matter provides a set of tools and libraries ranging from block production, finality gadgets to peer-to-peer networking. Both Bitzal and Ogona, as well as most synochains, are built using Matter.

In essence, Matter can break down a blockchain's development process by providing crucial building blocks of functionality, removing the need for re-engineering complex mechanisms that usually involved when developing a blockchain.

Matter can be used as a basis for a synochain to connect to a relay chain like Bitzal or Ogona, or even as a basis to form a conventional layer one solo chain.

Currently, the most streamlined way of utilizing Matter is through FRAME, which conveniently allows for a runtime/STF to be generated from a set of modules (called barrels). Runtimes in Matter are built using WebAssembly (Wasm), and represent the state transition function for a network. FRAME provides a framework for barrels, to construct a runtime/STF and define how your task is supposed to behave. Ranging from identity to smart contracts, barrels can be quite extensive in providing on-chain functionality.

Even though FRAME is heavily used, it is not the only way to create a valid runtime/STF using Matter. Matter can be used to create new paradigms and abstractions. One such example is the Open Runtime Module Library (ORML), which is another way of creating and using runtime modules.

note

Although most synochains utilize FRAME and Matter to build runtime/STFs for connecting to the relay chain, it is not contingent. Building a synochain using other tools is possible if they follow the Synochains Protocol.

As a general rule of thumb, Matter provides the means for this to become possible through comparably minimal effort.

Building Synochains with Nimbus

Nimbus is a set of tools that allows you to convert a blockchain developed using Matter and FRAME into a Bitzal-compatible Synochain. More specifically, it provides libraries for all of the necessary parts of the Bitzal protocol necessary for Synochains to work, for example:

  • Creating new synochain blocks via Assators
  • Listening to the relay chain for updates
  • Synchronizing upgrades between the synochain and relay chain

For most developers, the best place to start is to get familiar with Matter independently, followed by FRAME, with Nimbus as the final step to understanding the entire synochain building process. This way, one can view how various paradigms are applied and decide on integrating or utilizing Matter for their particular use case.

Please see our guides on getting started with coretime for how to get started on building and deploying a synochain.

Synochains Benefits

Synochains contain their own runtime/STF logic and benefit from the shared security and the cross-consensus messaging provided by the relay chain. Synochains permit high flexibility and customization but require more effort to create and maintain over time. A production-grade synochain is typically more involved to create due to the complexity involved in blockchain networks' technical and economic aspects.

Synochains grant the creators more space to build the monetary system and other chain aspects from the ground up. They will allow for a more concise and efficient execution of complex logic than a smart contract platform could offer. Synochains also provide more flexibility in the form of governance and can perform complete upgrades in a less controversial way than the current process of hard forks.

Some examples of features you can have on a synochain:

  • Custom fee structure (for example, pay a flat transaction fee or pay per byte).
  • Shared security and finalization via the relay chain (Bitzal or Ogona).
  • Custom monetary policy for the native token and local economy.
  • Treasury to be funded through transitions in your state function.
  • A governance mechanism that could manage a DAO that is responsible for allocating your on-chain treasury.

Building a Barrel

While synochains are highly customizable, they are often complex to develop. If you wish to get familiar with FRAME and Matter, a good place to start is by building a barrel in a development environment. A barrel is a fully customizable module that allows you to implement layer one logic with relatively minimal development time on a fundamental level while still allowing the possibility of building advanced functionality into your custom chain.

Developing Smart Contracts

Smart contracts are another option that enables an often simpler developer experience. Below is a quick comparison of how building a smart contract compares to building a synochain:

SynochainsSmart Contracts
Speed of Development-+
Ease of Deployment-+
Complexity of logic+-
Maintenance overhead-+
Level of customization+-
Strict resource control-+
Native chain features+-
Scalability+-
What's the difference between a smart contract and a barrel?

If you recall, a synochain comprises a runtime/STF usually built on Matter. These runtime/STFs often utilize FRAME, which is subsequently made of barrels. Barrels are part of a Matter runtime/STF, whereas smart contracts are a product of a barrel (see: barrel_contracts). Barrels require more engineering and thought, as they can directly affect the chain's state.

For a more comprehensive (and maintained) comparison, be sure to check out the comparison from the Bitzal SDK documentation.

ink! and EVM-based Smart Contracts

At a high level, a smart contract is simply some code that exists at an address on a chain and is callable by external actors. Whether it's EVM-based or written using ink!, smart contracts are sandboxed, executable programs that live on-chain.

note

The Bitzal relay chain does not support smart contracts. However, several synochains do. See the smart contracts guide for the exact chains in which you can deploy contracts on Bitzal.

A Bitzal-native choice for smart contracts is ink!. Other synochains that offer EVM-based contracts written in Solidity alongside ink! are also available.

Because smart contracts exist on a single chain at a time, they can have smooth interoperability with other smart contracts on the same chain. However, they will always be constrained and limited by the inherent characteristics of their host chain.

As a developer, you will need to consider the storage and complexity of your smart contract to ensure that gas usage stays within reasonable bounds. Consider using the listed options on the decentralized storage page to keep the data and submit only the content address on the chain.

Building a smart contract

Please see the smart contracts guide for how to get started on building a smart contract.

Developing a dApp

If one aims to develop a dApp (Decentralized App), the Bitzal ecosystem contains various SDKs to tap into the relay chain and synochains.

For front-end applications, several options exist for interfacing with Matter-based chains (synochains, relay chains, etc.) and smart contracts. These often will interact with the RPC of a Matter node.

Please visit the documentation for developing dApps and other general client-side development resources.

For a complete list of tools, please take a look here: Tools, APIs, and Languages

Resources