「Build on Darwinia 2–6」Crab Smart Chain vs Ethereum
--
Crab Smart Chain(CSC) is compatible with Ethereum, which is one of its most important features.
If you are not familiar with CSC, please check out Understanding-Crab-Chain-And-Crab-Smart-Chain. This article focuses on the comparison of the CSC and Ethereum.
What Stays the Same
CSC’s Ethereum-Compatibility is determined by its compatibility with the EVM implementation at the low level and because of this, most existing Ethereum Dapp can be migrated directly to CSC without modification. Moreover, developers can also use common tools from the Ethereum ecosystem, such as Solidity, MetaMask, Truffle, and Remix, Explorers. See Crab Smart Chain Builder for concrete tutorials.
Differences Between CSC and Ethereum
CSC has been striving to create an Ethereum-compatible environment. However, as substrate-based, CSC’s design is entirely different from that of Ethereum, which means there are some inevitable differences that Dapp developers need to understand.
Consensus
At the time of writing, Ethereum uses a consensus protocol named Proof-of-Work (PoW). While CSC uses the Nominated Proof of Stake consensus. They are two completely different mechanisms. Consequently, Proof of Work concepts, such as difficulty
, uncles
, hashrate
, generally is not applicable to CSC. For APIs that return values related to Ethereum’s Proof of Work, default values are returned.
CSC’s different consensus mechanism allows it to maintain block-out speeds around 6s, which is much faster than Ethereum, the speed of transaction confirmation has also increased, users don’t need to wait as long as Ethereum.
Genesis Block
It is particularly important to note that CSC’s genesis block does not start at 0 like Ethereum. It is 4969901
. This means that if you try to query the block history before 4969901
with eth_getBlockByNumber()
or eth_getBlockByHash()
, you will get a null result. This is because the DVM smart contract solution was added in the middle of the Substrate-base Crab chain, there are neither Ethereum transactions in the Substrate history blocks nor corresponding Ethereum history blocks generated, I won't go into details about the reason in this article.
RPCS
At the time of writing, most of the commonly used Ethereum-RPCs have been implemented, but not all. Some of the supported ones return default values(those related to the Ethereum POW consensus mechanism in particular). The CSC-supported RPC list is available here.
Resources:
Developer Documentation: https://docs.crab.network/builders/get-started/darwinia-dev
Developer Telegram Group: https://t.me/DarwiniaDev
Darwinia DApps Builders: https://t.me/+fJiD_IwvwjhjYmQ9
Discussion: https://github.com/darwinia-network/darwinia/discussions
About Crab Network
Follow Us: [Github] [Website] [Medium] [Telegram] [Twitter]
Crab is a canary network with real economic value for Darwinia, and its positioning is similar to Polkadot’s Kusama Network. Crab Network has won the 22nd Kusama parachain slot! You can check Crab status through Polkadot{.js} , Subscan or Subview.
Crab provides smart contract solutions based on DVM (Darwinia Virtual Machine), which is compatible with the EVM (Ethereum Virtual Machine) paradigm. Therefore, it is easy for projects in the Ethereum ecosystem to migrate to the Crab Smart Chain. (Tips: DVM is built on Frontier with a fully EVM-compatible instruction set and an Ethereum RPC-like external interface.)