How to Bootstrap a Blockchain With Polygon Supernets
May 5, 2022
There are a number of reasons why a Web3 project might choose to build on a network other than Ethereum. Whether it’s experimenting with innovative features not available on the mainnet, tailoring the network to a specific use case or simply having more control over its fees, the answer in one word is customization.
Polygon Edge was announced in May 2021 to anticipate that very demand. Edge is a customizable blockchain stack written in Golang that developers can use to build and launch networks fine-tuned specifically for their needs. Last month, Polygon unveiled Supernets to even further abstract the process of building application-specific blockchains.
This is how to bootstrap Ethereum-compatible blockchains with Polygon Supernets.
Having custom blockchain networks allows teams to configure essential parameters, such as which consensus is used, what is the block limit for transactions, who are the trusted participants in the network (validators), and much more.
Answering these questions is the easy part. Implementing the actual blockchain logic is where it becomes tricky. Diving into building a blockchain layer from scratch involves focusing on several key aspects:
This sounds like a lot of work - and it is. Polygon Supernets makes the process straightforward, so that teams can focus on what’s really important – their actual product.
Architecture of Polygon Supernets
By now it’s clear that blockchain clients have a lot of moving parts – Polygon Supernets is no different – it additionally offers modularity when it comes to all major components of the stack.
It all starts at the base networking layer, which utilizes libp2p – a modular, extensible, and fast networking framework that provides a great foundation for some of the advanced features of Polygon Supernets. Nodes discover and interact with each other through the networking layer, which allows them to participate in complicated processes such as block syncing and consensus.
The blockchain layer is in charge of coordinating block additions and state transitions with other modules of Polygon Supernets to make sure the data is verified and committed to the chain.
Local to each node, the TxPool module is the central place for handling transactions. Any transaction that gets added manually to the node, or gets received from other nodes in the network will be processed and handled accordingly here.
Finally, dApp developers and node operators have front-row seats when interacting with a Polygon Supernets blockchain. By utilizing the standardized JSON-RPC layer, Web3 frameworks can easily interact with the underlying blockchain. Node operators can use simple commands to interact with the Polygon Supernets node, which relies on gRPC under the hood, making the UX fast and enjoyable.
Blockchain Deployment 101
It’s easy to get up and running with a custom blockchain network using Polygon Supernets. There are 3 steps:
1. Generate the secrets data
Each node has pairs of keys it needs to successfully communicate and participate with other nodes. These include the node’s validator private key and the networking private key. Private keys need to be generated on each node.
2. Genesis configuration
The genesis block is where all chains start. Users need to generate a genesis configuration that their blockchain will use. This is the point where they specify which consensus mechanism is used, what is the block limit, which accounts have pre-mined balances, and more. The full list of available options can be found in the documentation.
3. Start the node
Now that everything is configured, all systems are ready for launch. When starting the node, users can specify additional runtime parameters. The full list of supported parameters can be found in the documentation.
After all of the nodes are started, they will attempt to form a fully-meshed network and start producing blocks.
Here are some interesting features offered by Polygon Supernets, that are out of the scope for this article:
IBFT PoA / PoS switching
Polygon Supernets offers chains the ability to seamlessly switch between PoA and PoS IBFT consensus modes, without needing to reset the chain beforehand.
Backup / Restore functionality
Backing up and restoring chain data is a must. Lengthy chains can take a long time to sync on new nodes, so having a backup ready for restore just exponentially speeds up this process – all without having to turn off a single node, as this is offered on the fly.
Integration with Hashicorp Vault / Amazon SecretsManager
Sometimes sensitive data such as private keys shouldn’t be kept on disk. Polygon Supernets offers the ability to store and manage private keys on Hashicorp Vault or Amazon SecretsManager.
When trying to figure out the throughput of a custom blockchain, it can be difficult to pick the right tools for stress testing the network. Polygon Supernets offers a baked-in load bot feature that spams transactions to the blockchain and reports back with the performance results.
Upcoming development efforts are focused on implementing a cross-chain bridge solution, which would allow custom blockchains to interact between each other. Another area of focus will be Proof of Stake, with new features and improvements such as governance and delegated staking underway. Additionally, the Polygon Supernets team is considering adding support for additional runtimes in the future, as the current EVM implementation is plug and play.
Polygon began development of Supernets about two years ago, working closely with the Trapesys team. There are now over 35 teams ranging from government organizations to gaming companies using Supernets. Polygon also announced plans to invest $500 million in projects interested in building on the Supernet chain.
Ethereum’s shift to Proof of Stake consensus, known as the Merge, has dramatically cut Polygon’s carbon dioxide emissions, opening the path to going beyond being carbon negative and toward empowering others to do the same. The conversation has shifted from blockchain sustainability to blockchain as a sustainability solution. Join us for the second chapter of […]
Today, we are thrilled to announce that Robinhood has chosen Polygon as the first blockchain network to support its newly launched Web3 wallet. The Robinhood Wallet beta is now live for 10,000 iOS customers out of 1+ million who signed up for the waitlist in May. Together, Polygon and Robinhood are opening access to decentralized […]
Zero-knowledge (ZK) tech is one of the most prominent and promising paths to scaling Ethereum. One popular use of ZK proofs to scale Ethereum is what’s known as a zkEVM (zero-knowledge Ethereum Virtual Machine). So what is a zkEVM, and how does it help us make Ethereum cheaper and more efficient to use? Understanding the […]
Polygon has teamed up with Alpha Venture DAO and Icetea Labs to launch the inaugural Icetea Labs Accelerator Program for blockchain startups. Working in a tight three-way partnership, Polygon is co-creating an accelerator to funnel resources, mentorship, education, and business acumen to promising Web3 companies from around the world. The startups selected for the accelerator […]
Applications are open for Polygon Bootcamp Africa, launched in partnership with Xend Finance! The eight-week intensive educational course and hackathon combo will put developers in Africa on the Web3 map. This is Polygon’s biggest step in providing resources to developers, builders, and creators in Africa, and it comes during an important time. An internet and […]
Today, we are thrilled to announce that Starbucks Coffee Company is working with Polygon to provide the blockchain technology to build its recently announced Web3 experience, Starbucks Odyssey. As a result of the partnership, this new Web3-powered experience will allow Starbucks Rewards loyalty program members and Starbucks partners (employees) in the United States to earn […]
Polygon has teamed up with Moralis and Google Cloud as an official Gold-Tier-Sponsor for the Moralis x Google 2022 Defining DeFi Hackathon! From Oct. 3 to Nov. 11, hundreds of developers around the world will build the DeFi applications of their dreams, competing for prizes, bounties, and rewards from a pool of $155,000, with $50,000 […]
Entertainment can help people become more aware of and responsive to the problems we face. That's why Polygon has joined forces with the Ocean Conservation Exploration and Education Foundation (OCEEF) to advance ocean literacy by finding new and engaging ways to give people exposure to deep sea missions. The shared goal of this effort is […]
Hola readers! We announced Polygon Bootcamp Africa, an eight-week intensive educational course and hackathon combo, in partnership with Xend Finance, Polygon-based carbon compensation project Coorest has become the first Web3 initiative to have an officially verified carbon standard, and Quadrata, a passport network bringing the identity and compliance layer to public blockchains, is integrating its […]