Skip to content
This repository has been archived by the owner on Jun 6, 2024. It is now read-only.

bnb-chain/zkbnb-contract

Repository files navigation

ZkBNB Contract

banner

The smart contracts on BSC(Layer1) for ZkRollup BNB Chain.

What is ZkBNB Contract

The ZkRollup BNB Chain(ZkBNB) is an infrastructure for developers that helps them to build large scale BSC-based apps with higher throughput and much lower or even zero transaction fees.

Framework

The above framework shows that the zkbnb-contract is one of the core components, it is the entrance and exit of L2 ecosystem. zkbnb-contract achieves that:

  1. L1 security. The ZkBNBVerifier Contract can verify the SNARKs proofs(succinct non-interactive argument of knowledge) that generated by Layer2 and so that we can prove the validity of every single transaction in the Rollup Block. So the ZkBNB share the same security as BSC does. Thanks to zkSNARK proofs, the security is guaranteed by cryptographic. Users do not have to trust any third parties or keep monitoring the Rollup blocks in order to prevent fraud.
  2. L1 to L2 Communication. The ZkBNB Contract expose several interfaces to support BNB, and BEP20/BEP721 created on BSC or ZkBNB can flow freely to ZkBNB.
  3. L2 to L1 Communication. Each Rollup L2 Block including a batch of L2 operation that need to be processed by L1 contracts.
  4. "Full exit" on BSC. The user can request through L1 smart contract to withdraw funds if he thinks that his transactions are censored by ZkBNB.

Getting Started

build && test

yarn install 
npx hardhat compile
npx hardhat test

The deployed contracts on testnet and mainnet(coming soon)

Design

ZkBNB Key Contracts

ZkBNB Name Service

Upgradeable Design

License

zkbnb-contract is released under the Apache License, Version 2.0.