DEV Community

Cover image for The Confused Developers Guide to Sidechains

Posted on

The Confused Developers Guide to Sidechains


Have you noticed how many scaling solutions there are nowadays? There are several categories like L2s, modular blockchains, and sidechains. The growing number of choices within Layer 2 solutions, modular blockchains, and sidechains can make any level of developer feel overwhelmed.

Within each of those categories, there feels like an ever-growing list of options that is enough to make a developer's head spin.

It's easy to go for the solution with the largest hackathon prize (totally understandable), but when it comes to deploying a dApp in the real world, the decision is much harder.

Let's explore what makes sidechains a unique pick for developers, and how they compare with the rest of the pack. Following that, we're going deep into the Horizen EON EVM sidechain, highlighting the developer experience—what changes and what remains the same.

This will provide some clarity to confused developers. Let's get started:

Sidechains - A Story of Relationships

Blockchains are all about relationships. Relationships can be between addresses, contracts and even other blockchains. We see the relationships between addresses and contracts mostly when using blockchain explorers. A less visible type of relationship exists between different blockchains.

Why do blockchains need to create connections with other blockchains? Because life as a blockchain is hard. It is especially hard if you are a mainchain. You need to consider security (stopping attackers from hijacking the network), scalability (managing and settling all transactions), and decentralization (ensuring control is shared fairly among participants). Managing all three of these well is so important that it has been given its own name called "The Blockchain Trilemma".

To make life easier, a mainchain can recruit friends to help with this trilemma. Friends in this case can be supporting chains like sidechains.

  • Work alongside the mainchain, enabling assets to move back and forth through a two-way peg system.
  • Maintain independence in security and consensus, offering the flexibility to test various rules and scenarios for enhanced scalability.
  • Use the same computing system, like the Ethereum Virtual Machine (EVM), as the mainchain, so developers can work with familiar tools and languages that can coexist with the Ethereum ecosystem.

Layer 2s - The Other BFF

Scalability is so important that mainchains need multiple solutions to address it. Another option is Layer 2 blockchains (L2s). If sidechains are the friends of mainchain, L2s are the siblings. The key difference between L2s and sidechains is that L2s usually rely on the mainchain's security.

Their goal is to enhance scalability, utilizing optimistic rollups and zero-knowledge proofs for quicker transaction handling compared to the mainchain. These transactions still get settled on the mainchain eventually.

Sidechains on the Horizen

To help our understanding of sidechains, let's look at the Horizen EON EVM sidechain as an example. There are two main relationships in the Horizen ecosystem:

Horizen to EON

The first relationship is between Horizen and Horizen EON. Horizen acts as a 'blockchain of blockchains,' offering support for creating fully customizable sidechains optimized for speed, privacy, or consensus. It has its own native token called $ZEN and uses a Proof-of-Work consensus model. Created for particular applications, these sidechains communicate with the mainchain and achieve interoperability with one another through the Cross-Chain Transfer Protocol (CCTP).

EON, designed as an EVM-compatible sidechain, links the EVM with the Horizen network. It allows assets to be sent from Horizen to EON through forward transfers, and assets can be moved back to Horizen using backward transfers.

This means that they execute smart contracts like the EVM with little to no extra changes. From a developer perspective, this means that the same tools that would be used directly deploying a contract to the Ethereum network can still be used.

EON to Ethereum

For EVM compatibility, EON adopts Ethereum's account-based transaction system to handle assets. This system has two kinds of accounts: Externally-Owned Accounts (EOAs) and Contract Accounts.

Externally-Owned Accounts (EOAs) come with private keys, giving the owners the ability to carry out transactions with the assets stored in these accounts. Contract accounts don't have a private key. They are also required to run the code that is attached to the account.

Get Started Building

As we discovered before, a big plus of using an EVM-compatible sidechain is not being required to learn new tools and programming languages.You can use Remix IDE or Hardhat to test and deploy your smart contract. Although it is compatible, you still need to make small modifications to your configuration to access the Gobi testnet (Horizen EON´s testnet).

Thirdweb makes it simple to deploy smart contracts, allowing you to choose from its library or use your own contracts. After adding the Gobi Testnet to your wallet configuration, you can get TZEN, the testnet EON token, by using the Horizen Faucet. Then you can use one of the popular contracts from Thirdweb like NFT Drop or Token. Follow this developer guide to complete the deployment.

Wrapping Up

The variety of options for developers shows how important it is to scale mainchains. With so many options, this can be confusing. Sidechains offer the best of both worlds, giving developers flexibility to improve on what the mainchain misses and connecting back to it when needed.

The Horizen ecosystem puts Horizen EON in a perfect spot to give developers these benefits. Being a 'blockchain of blockchains' means it can host specialized sidechains while maintaining compatibility with the EVM whenever it's needed. The aim of this article was to help developers confused by all these solutions. The best way to stop being confused is to start deploying code on testnet and just experiment with the tools available. Become part of the Horizen community today!

Finally, the best way to truly understand the power of this technology is to start building on it. Check out the Horizen EON documentation to start deploying your first dApp!

Top comments (3)

sabrinaesaquino profile image

i love it cause i'm confused developers

dappadandev profile image

We all are, some of us are just to afraid to admit it.

danizeres profile image
Dani Passos

really great content 🔥