The smart contracts on BSC(Layer1) for ZkRollup BNB Chain.
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.
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:
- 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.
- 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.
- L2 to L1 Communication. Each
Rollup L2 Block
including a batch ofL2 operation
that need to be processed by L1 contracts. - "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.
yarn install
npx hardhat compile
npx hardhat test
zkbnb-contract
is released under the Apache License, Version 2.0.