ZetaChain Development Concepts
Below we provide a high-level overview of how ZetaChain is constructed and core concepts in building omnichain dApps on top of ZetaChain. For more details on ZetaChain's architecture and background, refer to our whitepaper here.
At a high level, ZetaChain is a Proof of Stake (PoS) blockchain built on the Cosmos SDK and Tendermint PBFT consensus engine. As a result, ZetaChain enjoys fast block time (~5s) and instant finality (no confirmation needed, no re-organization allowed). The Tendermint PBFT consensus engine has been demonstrated to scale to ~300 nodes in production, and with future upgrades with BLS threshold signatures the number can potentially increase to 1000+. The throughput of transactions on ZetaChain can potentially reach 100 TPS due to the efficient Tendermint consensus protocol. The ZetaChain architecture consists of a distributed network of nodes, often referred to as validators. Validators act as decentralized observers that can reach consensus on relevant external state and events, and can also update external chain state via distributed key signing. ZetaChain accomplishes these functions in a decentralized (without a single point of failure, trustless, permissionless), transparent, and efficient way. Contained within each validator is the ZetaCore and ZetaClient. ZetaCore is responsible for producing the blockchain and maintaining the replicated state machine. ZetaClient is responsible for observing events on external chains and signing outbound transactions. ZetaCore and ZetaClient are bundled together and run by node operators. Anyone can become a node operator to participate in validation provided that enough bonds are staked.
ZetaChain uses the Tendermint consensus protocol which is a partially synchronous Byzantine Fault Tolerant (BFT) consensus algorithm. Each validator node can vote on block proposals with voting power proportional to the staking coins (ZETA) bonded. Each validator is identified by its consensus public key. Validators need to be online all the time, ready to participate in the constantly growing block production. In exchange for their service, validators will receive block rewards, and potentially other rewards such as gas fees or processing fees, proportional to their bonded staking coins.
Another set of important participants of ZetaChain consensus are the ob- servers who reach consensus on external chain events and states. The observers watch externally connected chains for certain relevant transactions/events/states at particular addresses via their full nodes of external chains. The observers can be further divided into two roles: sequencer and verifier. The sequencer discovers relevant external trans- actions/events/states and reports to verifiers; the verifiers verify and vote on ZetaChain to reach consensus. The system requires at least one sequencer and multiple verifiers. The sequencer does not need to be trusted, but at least one honest sequencer is needed for liveness.
The ZetaChain collectively holds standard ECDSA/EdDSA keys for authenti- cated interaction with external chains. The keys are distributed among multiple signers in such a way that only a super majority of them can sign on behalf of the ZetaChain. Its important to ensure that at no time is any single entity or small fraction of nodes able to sign messages on behalf of ZetaChain on external chains. The ZetaChain system uses bonded stakes and positive/negative incentives to ensure economic safety.
In practice, all above roles (except sequencer) are collocated in the same computer node, sharing software and credentials such as validator keys and bonded stakes and the associated rewards/slashing. ZetaChain is planned to transition from Proof-of- Authority at first to a fully delegated Proof-of-Stake (DPoS) model over time, and gradually delegate the governance of the blockchain to ZETA coin holders via on-chain voting.
Building omnichain dApps on ZetaChain
There are two primary models for building omnichain applications with ZetaChain: messaging or native omnichain smart contracts.
Messaging is the easiest way to add cross-chain functionality to your dApp. To implement, you simply need to implement a send, receive, and revert-handler function on your smart contract that is deployed on a connected chain that interact with a ZetaChain Interface contract. Learn more about how to use messaging here.
Native Omnichain Smart Contracts
A developer can deploy smart contracts directly on ZetaChain that can read and write state to connected chains. Omnichain Smart Contracts are under active development. Stay tuned on our Discord and Twitter for updates!