Polkadot Development Solutions
Let's describe what Polkadot is and how it works. We will tell you how to launch an application or website using solutions based on Polkadot.
Polkadot is one of the few blockchain startups that managed to raise more than $ 100 million at the end of the ICO without any problems. This is due to the fact that the project originated from Gavin Wood, who, among other things, is the co-founder of Ethereum and the creator of the Solidity smart contract programming language.
His new project is a platform for launching smart contracts, tokens and DApps. In this article, we'll explain how Polkadot works, how it differs from the competitors, and how to build your app or website with Polkadot.
Like Ethereum, Polkadot is not just a cryptocurrency, but an entire ecosystem for smart contracts, decentralized applications, tokens and automated market makers. The main feature of the project is a unique architecture for the exchange and transformation of data between heterogeneous blockchain systems, which supports the creation of individualized sidechains for organizing interaction with public blockchain networks and protocols.
The Polkadot network itself in this ecosystem acts as a relay, on the basis of which numerous verifiable and interconnected dynamic data structures can be built. That is, based on Polkadot, it will be possible to launch custom blockchains (parachains) with their own logic, Dapps smart contracts and tokens. At the same time, all such chains will be connected to Polkadot using special bridge protocols that will allow operations between all parachains without intermediaries and third-party networks.
This is very similar to how Ethereum 2.0 will work, which is created on sharding technology, where shards are, in fact, the same blockchains that can interact with each other through the Ethereum 2.0 network. Only Polkadot, instead of shards, will have parachains - customizable blockchains, each of which can have its own characteristics, which will make it as efficient as possible for performing specific tasks, for example, launching cryptocurrency exchanges or video games.
At the same time, the parachains will be compatible with each other, which will make it possible to exchange tokens and data between such networks without any problems. In addition, Polkadot has collective network security, common for everyone and united into a single pool, while in Ethereum, each shard is responsible for its own security.
Here are some more important differences between Polkadot and Ethereum:
The Polkadot ecosystem works differently than Ethereum (or the future Ethereum 2.0). It is based on three types of chains: parachains and parathreads, which are connected to the main relay chain).
Polkadot network architecture. Source
Parachains are customizable, standalone and independent blockchains connected to the Polkadot platform. They allow you to create new blockchain networks to solve specialized problems, such as launching a very fast exchange or a very reliable wallet. To this end, the creators of parachains are given the freedom to develop their own control systems using Polkadot's general security feature and Polkadot's computing resources to validate the accuracy of transactions. This approach allows you to make parachains very flexible in functionality and at the same time as reliable and secure as possible.
To be eligible to run parachain on Polkadot, you need to rent a slot in the Relay Chain through the slot auction. This will be discussed below, in the section on the cost of developing and launching applications and websites on Polkadot.
Parathreads — these chains of the Polkadot platform have the same functionality as parachains, but with some differences. For example, paraflows are based on a pay-as-you-go model rather than a slot lease. In addition, parastreams are primarily designed to launch applications and smart contracts that do not require constant access to the network.
Other Polkadot functions include:
Heterogeneous sharding. Unlike Ethereum, Polkadot is based on a heterogeneous sharding model. This means that user chains connected to the main network can have very different functionality, while these chains can process transactions in parallel and safely exchange data with each other. Thanks to this, you can run any smart contracts and dapps on Polkadot, not just template projects with slight differences.
Ease of chain update. Each application needs to be updated from time to time to fix bugs and add new functionality. However, if we are talking about the blockchain, then the update process is not so easy, since in this case the update requires a fork in the network, which takes a lot of time and effort, and can also lead to a split in the community (after a hard fork). In Polkadot, there will be no problems with updates, since this system allows you to update chains without forks in the chains. This feature allows projects developed on Polkadot to remain flexible, adapt and evolve in accordance with the pace of technology development and the needs of the market and users.
Cross-chain layout. Polkadot supports internetworking. Connected custom chains, smart contracts and applications can transmit messages, exchange data, values and functionality, and interact with external blockchain chains.
Transparent management. DOT token holders support the Polkadot network. They can vote on an existing proposal or create proposals to update / amend the Polkadot protocol.
High speed. After all the optimizations of the parachain technology are completed and their number grows to 100 slots, the system is expected to be able to process about 1 million transactions per second. Now 20 slots are occupied, which provide a speed of 100 thousand operations per second.
Expenses. It is expected that launching sites, tokens, smart contracts and dapps on Polkadot will be more profitable than using a single chain or launching projects on top of an existing smart contract platform (like Ethereum). Startups will be able to save both on network fees and on the development itself.
Launching your own website or app on Polkadot involves two main steps. The first is the creation of the site or application itself. The second is deployment of your project to Polkadot. We wrote a lot about the first stage in articles like «How to create an online auction site» or «How to develop a blockchain application for Android and iOS». Therefore, in this article we will not repeat ourselves and will go straight to the process of deploying projects on the Polkadot blockchain.
Polkadot provides several ways for this: as a smart contract on an existing parachain, as your own parachain, or as a paraflow. Each of them has its own nuances that you need to consider when launching your website or application. In addition, for this, it is also desirable to have the knowledge and experience of launching blockchain projects. If not, then it is best to entrust this task to a company that specializes in this, such as Merehead.
Parachains are "parallel" chains that contain their own execution logic. They provide a high degree of flexibility and customization, but require more effort to develop, deploy and maintain. In addition, unlike smart contracts, parachains are devoid of a mandatory gas metering system, which both creates a lot of opportunities and makes them vulnerable to errors that cause infinite loops. And although this vulnerability is mitigated by the Substrate weighting system, at the same time it imposes a large burden on the parachain developer.
All of this suggests that parachains are great for running complex applications that target high traffic and user base. But at the same time, their development and deployment will be more difficult than launching parachains or smart contracts. In particular, building a Polkadot parachain requires deep knowledge of Substrate (Rust language) and PDK: Substrate and Cumulus.
In addition, to include parachain in the Polkadot network, a parachain slot must be purchased. These slots are sold in open auctions, the mechanism of which can be found on the Parachain wiki auction page.
Parathreads allow the developer to control the logic of their application at a lower level than parachains. In addition, parastreams are "cheaper" since their protection is much more economical. This is due to the fact that parathreads will only create a block when needed (dapp), unlike parachains, which protect the slot for creating a block in each relay chain.
In other words, parachains are worth using if you want to run a small site or application on Polkadot that doesn't need to control a lot of traffic and data flow. In addition, parachains are suitable for dapps that do not need a constant internet connection and / or the Polkadot network.
When creating a parachain, you will use the same tools and get almost all the benefits of parachaining, but you can save money.
Smart contracts are executable programs that only exist on one chain and have limited complexity. Deploying a smart contract in Polkadot will be slightly different depending on which parachain you are using. You will most likely have to pay an appropriate fee for the initialization logic and any storage your contract uses.
The process of deploying smart contracts on Polkadot is carried out through:
Deployment cost. The Polkadot network currently has only 100 parachain slots. At the same time, there are much more projects wishing to borrow them. Therefore, the Polkadot team conducts parachain auctions (crowdloans) and a company that wants to launch its own parachain will have to rent a slot through an auction.
The auction mechanism is quite simple: bidders are bidding higher and higher, and the winner is the highest bidder at the close of the auction. More details can be found on the official website. You can see what is happening with auctions and crowdloans now on Polkadot.js.
The cost of launching parachains is determined in a different way. They pay the parachain to use its resources, just like AWS does. Or several projects that want to launch their parastreams on Polkadot merge and together rent a slot for parachain.
How much it costs to develop and launch a smart contract on Polkadot depends on its complexity and transaction fees.