Aleph Zero Blog
Technology

When Will Smart Contracts Debut on the Mainnet?

Oct 5, 2022

With over 1000 smart contracts deployed on the testnet and multiple use-cases and teams we’re in touch with—it’s high time for an update on what to expect in the coming weeks. 

On June 22nd, 2022, smart contracts debuted on the Aleph Zero testnet. Since the launch, the network has amassed a noticeable number of users, and the behind-the-scenes adoption of the protocol has started to blossom. 

We’ve established relationships with talented teams consisting of experienced founders and talented developers—all seeking to utilize Aleph Zero’s capabilities in their products. The list includes but is not limited to: 

  • DRKVRS, a dark metaverse led by Marcin Kobylecki, the executive producer of an Oscar-nominated animation, previously involved in building Cyberpunk 2077 and The Witcher;
  • Art Zero, an NFT marketplace being built by an extremely capable team from Vietnam;
  • Gatenox, a decentralized identity and verifiable credentials firm led by Pawel Kuskowski former Global Head of AML at the Royal Bank of Scotland and the CEO of Coinfirm;
  • Interlock, a DeFi cybersecurity startup led by Rick Deacon, former cybersecurity researcher, Y Combinator alumni & founder with a successful exit;
  • Common, a privacy-enhancing decentralized exchange;
  • Liminal, a ZK- and MPC-based multichain privacy layer;
  • and more.

The team is currently focused on assisting the aforementioned groups while preparing to launch an official grant and incubation program hosted by the Aleph Zero Foundation and Cardinal Cryptography, the core developer of the network. And, of course – smart contracts and the ability to launch the product on the mainnet play a large part in this. 

Technically, smart contracts can be launched on the mainnet even today. The technology has been, and still is, working well on the testnet. All the feedback from the bug bounty program has also been implemented. 

But there’s one major development to pay attention to. 

Expecting ink! 4.0

Aleph Zero is a sovereign network with the novel AlephBFT consensus protocol at its core. The consensus has been our primary focus for the initial two years of the development – it has been vital to have it properly peer-reviewed and audited. Once done, we sought to integrate it with the Substrate stack, a library of ready-to-use components that would vastly shorten Aleph Zero’s time to market and allow the team to focus on privacy-enhancing technologies. So far, that part has been successfully executed, and we continue contributing to the broader ecosystem. 

Aleph Zero is one of the largest chains (including Polkadot and Kusama parachains) utilizing the Substrate framework. One part of that framework is – you guessed it – the smart contracts. Currently, the Aleph Zero testnet is operating smart contracts compatible with ink! 3.3.1, the latest major iteration of ink!—a smart contract programming language. All of our partners are also developing their products with ink! 3.3.1. You can also do it—visit our documentation or use the ink! Playground

ink! Playground is a web-based tool for developers

Our initial plan for bringing smart contracts to the Aleph Zero mainnet was to follow our usual deployment strategy: first, deploy ink!-3-compatible smart contracts to the testnet, and then, after several weeks of careful testing and faultless operation, proceed with the mainnet update. However, somewhere along that line, the vision of the next generation of ink! started to become a reality. Ink! 4.0 is currently pre-released in its alpha stage and is scheduled for production release this month. 

ink! 4.0 is vastly improving the developer experience

The new generation of ink! brings significant improvements over the previous version. Contract size optimization has been vastly improved, resulting in smaller sizes of compiled contracts and reduced storage fees when deploying a new contract. The whole storage logic has been reworked to further reduce the space a contract instance occupies on-chain. The developer experience is improved by reducing boilerplate and making the whole process of contract storage management much simpler and more transparent. The everyday life of a smart contract developer will also be improved thanks to new testing tools allowing for creating end-to-end tests (previously only unit tests were possible) and testing cross-contract calls and calls against a custom runtime. 

These improvements come at a price— ink! 4 is not backward-compatible. Contracts written in ink! 3 will need to be adapted to work with ink! 4, and the ones already deployed on-chain would require careful migration when the underlying chain is upgraded. It’s worth noting that adapting the ink! 3 contracts to ink! 4 contracts does not equal rewriting them from scratch, but rather making small modifications and adjustments in macros and library calls- therefore, it makes sense to exercise slightly more patience and adapt instead of pursuing the migration route.

What’s equally important to point out here is that Supercolony – the authors of OpenBrush, an amazingly capable framework for ink! smart contracts – will support ink! 4 shortly after its launch.

Launching with the right foundation

Having all that in mind, after careful consideration, our team has decided to wait with the launch of smart contracts on the Aleph Zero mainnet until ink! 4 is released. With such a short timeframe for a significant, compatibility-breaking update, we think it’s much more reasonable to wait a few weeks instead of rushing and launching a technology that would become obsolete days after going live. This decision is not only beneficial for the long run; it’s a must-have for the short term, too. 

Ultimately, it ensures the right resource allocation for everyone involved as the ecosystem participants can focus on perfecting their products without worrying about migrating them after the deployment. 

So yes, smart contracts are coming to the Aleph Zero mainnet – and they’ll be noticeably better than we originally assumed.