
Editor's Note: This article comes fromPolkaWorld(ID:gh_6c4c2038ddba), reproduced by Odaily with authorization.
Editor's Note: This article comes from
), reproduced by Odaily with authorization.
Polkadot is a blockchain for scalable decentralized computing and interoperability. In this article, we'll look at one of the main parts of the network: parachains.
Blockchains today come in a pretty standard form, consisting of two parts. The first part is the consensus algorithm, which provides security. The second part is the state machine, which provides certain aspects of the chain through which the chain gains security. Ethereum, Bitcoin, Zcash, etc. are all secured by proof-of-work consensus (PoW) or variants thereof, but the kinds of transactions and accounts they process (the things that make up their unique state machines) are completely different. Imagine a developer who comes up with a great idea for a new blockchain that could provide efficient privacy or wealth distribution or other exciting features. While developers are working on implementing that unique state machine, they must also implement some kind of consensus algorithm, and when launching their chain, it must compete with others for secure resources. This brings certain overhead and insecurity to developing new blockchain projects. Let me introduce parachains. Parachains (chains that run in parallel) are a simple form of blockchain that append to the security provided by the "relay chain" without providing security of its own. It is called the relay chain because it not only provides security for the connected parachains, but also guarantees secure message delivery between them. A key feature of parachains is that the computations they perform are inherently independent. A comprehensive general-purpose system of Turing-complete smart contracts has problems determining which transactions will "collide" with each other, meaning that transactions that could be parallelized often run sequentially, wasting valuable computation time. Drawing boundaries between parachains means we can execute all of them at once without fear of collisions - if we have 10 parachains, we can use the same security source to perform 10 times the work. Highly specialized parachains serve another purpose: they can implement data storage and transaction operations in the most efficient way for their domain of expertise, without getting bogged down in blockchain-specific scripting languages or virtual machines. Models like Bitcoin Script and the EVM are designed with the goal of interoperability at their core, but systems that use these models pay increasing execution costs for all parts of their implementation, not just Those from which other systems running on the same network can access. In contrast, Polkadot parachains communicate with each other via asynchronous message passing, thus paying the price of data consistency only at the boundaries where the parachains intersect. Note that you can still create a parachain that provides the framework for fully general and Turing-complete smart contracts. A simple example is a parachain powered by the EVM. For the above reasons, contracts executed on this parachain suffer from the generality and interoperability of Ethereum smart contracts while benefiting from it. The main difference is that it is fully opt-in. We think Polkadot's ability to integrate focused solutions while retaining the option to use an extremely general framework is one of its strongest features. One of the most interesting use cases for parachains is as a tool for scalability. You can create parachains that have their own parachains, and so on. This creates a tree structure that can be used to perform highly distributed computations without reducing the overall burden on the root relay chain itself. The main issue is ensuring data availability - parachain blocks should be accompanied by a proof of validity that anyone can use, at least for a certain period of time. Validators are responsible for ensuring that the proofs for the blocks they validate are still available. Unfortunately, without moving the message on-chain, it is impossible (or at least very difficult) to prove that a message was not sent when it was supposed to be sent. We can avoid this problem with reputation guarantees: when relatively trusted parties use validators as withholding data, they are penalized. This can also be generalized to token voting systems or multi-tiered courts. To reduce the effectiveness and usefulness of malicious and false reports, each report of misconduct shall be accompanied by a non-refundable drain of funds. When enough people are watching the computation, as in the case of first-level parachains, there is usually the necessary data. Another strategy for mitigating risk is to design parachains so that stored value can be recovered when the chain is stalled or attacked, although when the chain executes smart contracts to automatically lock funds or manage its own fees , this is difficult to achieve.