Skip to content

Commit

Permalink
Revert "add mathwallet and remove zkbnb (bnb-chain#566)"
Browse files Browse the repository at this point in the history
This reverts commit ae75391.
  • Loading branch information
dragcat55 authored Feb 23, 2025
1 parent ae75391 commit 410f475
Show file tree
Hide file tree
Showing 10 changed files with 246 additions and 3 deletions.
2 changes: 0 additions & 2 deletions docs/bnb-smart-chain/validator/mev/user-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ Several wallets now offer built-in protection against malicious MEV (Miner Extra
| Wallet | OKX Wallet | Supported | [OKX Wallet Enable Swap MEV Protection](https://www.okx.com/help/okx-wallet-supports-flashbot-to-prevent-mev-attack) |
| Wallet | TokenPocket Wallet | Supported | [TokenPocket Swap MEV Protection](https://help.tokenpocket.pro/en/security-knowledge/security-measure/mev-protection-tutorial) |
| Wallet | Safepal Wallet | Supported | [Safepal Swap MEV Protection](https://safepalsupport.zendesk.com/hc/en-us/articles/33892098077851-Use-SafePal-to-Protect-Your-Swaps-from-MEV-Attacks) |
| Wallet | Math Wallet | Supported | [Mathwallet Swap MEV Protection](https://blog.mathwallet.org/?p=4799) |



## For Professional Traders and Service Providers
Expand Down
41 changes: 41 additions & 0 deletions docs/zkbnb/core-concept/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
title: Overview - zkBNB Core Concepts
---

## Key Features

### Digital Asset Management
The zkBNB will serve as an alternative marketplace for issuing, using, paying and exchanging digital assets in a
decentralized manner. zkBNB and BSC share the same token universe for BNB, BEP2 and NFT tokens. This defines:
- The same token can circulate on both networks, and flow between them bi-directionally via L1 <\> L2 communication.
- The total circulation of the same token should be managed across the two networks, i.e. the total effective supply
of a token should be the sum of the token's total effective supply on both BSC and BC.
- The tokens can only be initially created on BSC in BEP20, then pegged to the zkBNB. It is permissionless to peg token onto zkBNB.

User can **deposit, transfer, and withdraw** both non-fungible token and fungible token on zkBNB.

Users enter the zk-rollup by **depositing tokens** in the rollup's contract deployed on the BSC. The zkBNB monitor will track deposits and submit it as a layer2 transaction, once committer verifies the transaction, users get funds on their account, they can start transacting by sending transactions to the committer for processing.

User can **transfer** any amount of funds to any existed accounts on zkBNB by sending a signed transaction to the network.

**Withdrawing** from zkBNB to BSC is straightforward. The user initiates the withdrawal transaction, the fund will be
burned on zkBNB. Once the transaction in the next batch been rolluped, a related amount of token will be unlocked from
rollup contract to target account.

### NFT Management and Marketplace
We target to provide an opensource NFT marketplace for users to browse, buy, sell or create their own NFT.
The meta-data of NFT on zkBNB sticks to the [BSC standard](https://docs.bnbchain.org/docs/nft-metadata-standard/).
The ERC721 standard NFT can be seamlessly deposited on zkBNB, or in reverse.

![Marketplace framework](../static/NFT_Marketplace.png)

Above diagram shows the framework of Nft Marketplace and zkBNB. All the buy/sell offer, meta-data of NFT/Collection,
medium resources, account profiles are store in the backend of NFT marketplace, only the **contendHash**,
**ownership**, **creatorTreasuryRate** and few other fields are recorded on zkBNB. To encourage price discovery, anyone
can place buy/sell offer in the marketplace without paying any fees since the offer is cached in the backend instead of
being sent to the zkBNB. Once the offer is matched, an **AtomicMatch** transaction that consist of buy and sell offer
will be sent to zkBNB to make the trade happen. Users can also cancel an offer manually by sending a cancel offer
transaction to disable the backend cached offer.

### Seamless L1 Wallet Management
zkBNB natively supports ECDSA signatures and follows [EIP712](https://github.com/ethereum/EIPs/blob/master/EIPS/eip-712.md) signing structure, which means most of the Ethereum wallets can seamless support zkBNB. There is no extra effort for BSC users to leverage zkBNB.
60 changes: 60 additions & 0 deletions docs/zkbnb/core-concept/zkbnb-arch.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
title: zkBNB Architecture - zkBNB
---

# zkBNB Architecture

zkBNB is a zero-knowledge scalability solution, or L2, which focuses on straightforward token operations and built-in marketplaces for Gaming and Social use cases. It serves as a scalability solution for the BNB Smart Chain by bundling multiple transactions into a single transaction, reducing costs for on-chain transactions. The Zero Knowledge proof system used in zkBNB ensures a much faster finality time of the L2 transactions, that helps improve the user experience. zkBNB is essentially built on the zk-Rollup architecture.

## zk-Rollup Architecture

![Framework](../static/Frame_work.png)

- **committer**. Committer executes transactions and produce consecutive blocks.
- **monitor**. Monitor tracks events on BSC, and translates them into **transactions** on zkBNB.
- **witness**. Witness re-executes the transactions within the block and generates witness materials.
- **prover**. Prover generates cryptographic proof based on the witness materials.
- **sender**. The sender rollups the compressed l2 blocks to L1, and submit proof to verify it.
- **api server**. The api server is the access endpoints for most users, it provides rich data, including
digital assets, blocks, transactions, gas fees.
- **recovery**. A tool to recover the sparse merkle tree in kv-rocks based on the state world in postgresql.

## Maximum throughput
Pending benchmark...

## Data Availability

zkBNB publish state data for every transaction processed off-chain to BSC. With this data, it is possible for
individuals or businesses to reproduce the rollup’s state and validate the chain themselves. BSC makes this data
available to all participants of the network as calldata.

zkBNB don't need to publish much transaction data on-chain because validity proofs already verify the authenticity
of state transitions. Nevertheless, storing data on-chain is still important because it allows permissionless,
independent verification of the L2 chain's state which in turn allows anyone to submit batches of transactions,
preventing malicious committer from censoring or freezing the chain.

zkBNB will provide a default client to replay all state on Layer2 based on these call data.

## Transaction Finality

BSC acts as a settlement layer for zkBNB: L2 transactions are finalized only if the L1 contract accepts the validity
proof and execute the txs. This eliminates the risk of malicious operators corrupting the chain
(e.g., stealing rollup funds) since every transaction must be approved on Mainnet. Also, BSC guarantees that user
operations cannot be reversed once finalized on L1.

zkBNB provides relative fast finality speed within 10 minutes.

## Instant confirmation ZkBS

Even though time to finality is about 10 minutes, it does not affect the usability of the network. The state transition
happens immediately once the block been proposed on zkBNB. The rollup operations are totally transparent to most users,
users can make further transfers without waiting.

## Censorship resistance

Committer will execute transactions, produce batches. While this ensures efficiency, it increases the risk of censorship
:malicious zk-rollup committer can censor users by refusing to include their transactions in batches.

As a security measure, zkBNB allow users to submit transactions directly to the rollup contract on Mainnet if
they think they are being censored by the operator. This allows users to force an exit from the zk-rollup to BSC without
having to rely on the commiter's permission.
35 changes: 35 additions & 0 deletions docs/zkbnb/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
hide:
- toc

title: zkBNB
---

<style>
.md-source-file, .md-content__button.md-icon {
display: none;
}
</style>

<div class="section-head">
<div class="left">
<h1>zkBNB</h1>
<p>zkBNB is the launchpad to achieve infinite scaling for all things Web3 and GameFi. It offers incredible scalability, Layer-1 level security, and frictionless developer experience to build dApps that can onboard the next billion users.</p>
</div>
<div class="image">
<img src="static/zkBNB.png" alt="zkBNB" loading="lazy">
</div>
</div>



<div class="section-body">
<a href="./core-concept/zkbnb-arch.md">
<div>Architecture</div>
<p>zkBNB is a zero-knowledge scalability solution</p>
</a>
<a href="./resources.md">
<div>Resources</div>
<p>Providing a Wealth of Resources for Building zkBNB</p>
</a>
</div>
35 changes: 35 additions & 0 deletions docs/zkbnb/overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
---
title: zkBNB Overview - zkBNB
---

# What is zkBNB?
The 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.

zkBNB is built on zk-Rollup architecture. zkBNB bundle (or "roll-up") hundreds of transactions off-chain and generates cryptographic proof. These proofs can come in the form of SNARKs (succinct non-interactive argument of knowledge) which can prove the validity of every single transaction in the Rollup Block.

## Problems zkBNB solves
Today BSC is experiencing network scalability problems and the core developer has proposed to use sidechains in their [Outlook 2022](https://forum.bnbchain.org/t/bsc-development-outlook-2022/44) paper to solve this problem because these sidechains can be designed for much higher throughput and lower gas fees.

The [BEP100](https://github.com/bnb-chain/BEPs/pull/132/files) propose a modular framework for creating BSC-compatible side chains and connect them by native relayer hub. The security of native relayer hub is guaranteed by the side chain.

According to [the analysis](https://blog.chainalysis.com/reports/cross-chain-bridge-hacks-2022/) of chainalysis, bridges are now a top target for the hackers and attacks on bridges account for 69% of total funds stolen in 2022. zkBNB can perfectly solve the problem! Thanks to zkSNARK proofs, zkBNB share the same security as BSC does.

## What are the key features of zkBNB?

BNB achieves the following goals:

- **L1 security:** 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<\>L2 Communication:** BNB, BEP20, BEP721 tokens can flow freely between BSC and zkBNB through our built-in bridging platform.

_(BEP721 token must be created in zkBNB in order to transfer from L1 to L2)_

- **Built-in NFT marketplace:** Users can launch their NFT collections to their communities safely and securely on zkBNB’s built-in marketplace and store them in IPFS or GreenField. zkBNB provides a set of powerful REST APIs. New developers operating in the space will no longer need to interact directly with smart contracts or worry about security. Rich Functions, such as supporting GreenField and supporting modifiable NFT.

- **Fast transaction speed and faster finality:** zkBNB puts up astonishing figures with an ability to support up to 4 billion addresses, 5k transactions per second (TPS), and minute level finality in the best case.

- **Low gas fee:** The gas token on the zkBNB can be either BEP20 or BNB.

- **"Full exit" on BSC:** At any time, a user can request an exit operation to withdraw funds. This means users can withdraw funds at any time within a few minutes. Even zkBNB stops running, user can still safely withdraw all assets. Each collection of NFTs will be withdrawn into a segregated smart contract.

_**Note:** Full Exit and Exodus Exit are two different types of functionalities on zkBNB. Full exit is just about user can click a button and withdraw all his assets in one go. Exodus exit is about in emergency situation, say the whole zkBNB is down, user can still withdraw all this assets._
20 changes: 20 additions & 0 deletions docs/zkbnb/resources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
title: Resources - zkBNB
---

# Resources

## 📔 Repos

- [zkBNB Infra](https://github.com/bnb-chain/zkbnb)
- [zkBNB Smart Contract](https://github.com/bnb-chain/zkbnb-contract)


## 👨‍🔧 Building Dapps on zkBNB

Start building dapps to create value based on the data assets and their related economy.
- Fund your zkBNB Wallet (_**Coming Soon**_⏰)
- Build a dapp with zkBNB API (_**Coming Soon**_⏰)

## 🙋‍♀️ Help & Support
Check out the zkBNB Developer Discord for technical support. (**_TBA_** 📢)
Binary file added docs/zkbnb/static/Frame_work.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/zkbnb/static/NFT_Marketplace.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/zkbnb/static/zkBNB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 55 additions & 1 deletion mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,13 @@ nav:
- Roadmap:
- Roadmap: ./bnb-greenfield/roadmap/roadmap.md
- Feature Lists: ./bnb-greenfield/roadmap/features.md
- zkBNB:
- zkBNB: ./zkbnb/index.md
- Overview: ./zkbnb/overview.md
- Core Concepts:
- Overview: ./zkbnb/core-concept/overview.md
- Architecture: ./zkbnb/core-concept/zkbnb-arch.md
- Resources: ./zkbnb/resources.md
- Showcases:
- Name Service and Attestation:
- Decentralized Identity: ./showcase/identity/did.md
Expand Down Expand Up @@ -640,7 +647,54 @@ plugins:
'opbnb-docs/docs/tutorials/run-nodes-best-practices.md': 'bnb-opbnb/overview.md'
'opbnb-docs/docs/tutorials/running-a-local-development-environment.md': 'bnb-opbnb/overview.md'
'opbnb-docs/docs/tutorials/running-a-local-node.md': 'bnb-opbnb/overview.md'

'zkBNB-docs/docs/faqs/asset-management.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/faqs/contract.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/faqs/gas-and-fees.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/faqs/minting-and-royalities.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/faqs/onboarding.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/faqs/platform.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/faqs/tokenomics.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/faqs/zkbnb-faqs.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/build-on-zkbnb/deposit-to-zkbnb.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/build-on-zkbnb/developer-tools.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/build-on-zkbnb/hardware-reqs.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/build-on-zkbnb/network-faucet.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/build-on-zkbnb/resources.md': 'zkbnb/resources.md'
'zkBNB-docs/docs/guide/build-on-zkbnb/software-reqs.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/build-on-zkbnb/zkbnb-api-example.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/contact-us.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/core-concepts/overview.md': "zkbnb/core-concept/overview.md"
'zkBNB-docs/docs/guide/core-concepts/protocol.md': "zkbnb/core-concept/overview.md"
'zkBNB-docs/docs/guide/core-concepts/zkbnb-arch.md': 'zkbnb/core-concept/zkbnb-arch.md'
'zkBNB-docs/docs/guide/economics/gas-and-fees.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/economics/tokenomics.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/introduction/fee-structure.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/introduction/getting-started.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/introduction/overview.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/introduction/tech-zkBNB.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/introduction/usage-zkBNB.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/storage/storage-layout.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/troubleshooting/common-errors.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/tutorials/fund-zkbnb-wallet.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/tutorials/nft-minting.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/zkbnb-marketplace/create-collections.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/zkbnb-marketplace/create-nfts.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/zkbnb-marketplace/deposit-bnb.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/zkbnb-marketplace/overview.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/zkbnb-wallet/get-test-tokens.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/zkbnb-wallet/overview.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/guide/zkbnb-wallet/wallet-configuration.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/sdks/tutorials/index.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/sdks/tutorials/reactjs-integration-example/index.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/sdks/zkbnb-go-sdk/changelog.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/sdks/zkbnb-go-sdk/quickstart.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/sdks/zkbnb-js-sdk/changelog.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/sdks/zkbnb-js-sdk/quickstart.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/sdks/zkbnb-sdks.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/sdks/zkbnb-ts-sdk/changelog.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/sdks/zkbnb-ts-sdk/quickstart.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/sdks/zkbnb-web-sdk/changelog.md': 'zkbnb/overview.md'
'zkBNB-docs/docs/sdks/zkbnb-web-sdk/quickstart.md': 'zkbnb/overview.md'

extra_css:
- https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300..700&display=swap
Expand Down

0 comments on commit 410f475

Please sign in to comment.