diff --git a/.github/workflows/jekyll-docker.yml b/.github/workflows/jekyll-docker.yml new file mode 100644 index 0000000000..3d0eedb4ce --- /dev/null +++ b/.github/workflows/jekyll-docker.yml @@ -0,0 +1,20 @@ +name: Jekyll site CI + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + +jobs: + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + - name: Build the site in the jekyll/builder container + run: | + docker run \ + -v ${{ github.workspace }}:/srv/jekyll -v ${{ github.workspace }}/_site:/srv/jekyll/_site \ + jekyll/builder:latest /bin/bash -c "chmod -R 777 /srv/jekyll && jekyll build --future" diff --git a/.gitignore b/.gitignore index aacfa61fba..516d899dfa 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,7 @@ site/ .cache .DS_Store + +build + +.docusaurus \ No newline at end of file diff --git a/README.md b/README.md index 1fda557a88..868dd2ccff 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# Welcome to BNBChain Knowledge Base +# Welcome to BNB Chain Knowledge Base -This is the BNBChain Knowledge Base documentation for the BNBChain developers. It is based on the Mkdocs Material theme. +This is the BNB Chain Knowledge Base documentation for the BNB Chain developers. It is based on the Mkdocs Material theme. ## Prerequisite @@ -24,5 +24,5 @@ This is the BNBChain Knowledge Base documentation for the BNBChain developers. I ## 📜 License -Copyright (c) 2024 BNBChain +Copyright (c) 2024 BNB Chain diff --git a/docs/announce/altai-gnfd.md b/docs/announce/altai-gnfd.md new file mode 100644 index 0000000000..78189488c7 --- /dev/null +++ b/docs/announce/altai-gnfd.md @@ -0,0 +1,30 @@ +# Altai Upgrade of Greenfield + +
+ Hardfork +
+ + +## Upgrade Timeline + +- Testnet: Sep 21th 2024 06:00:00 AM UTC Blockheight: 12,513,708 + +- Mainnet: Sep 23th 2024 06:00:00 AM UTC Blockheight: 11,917,971 + + +For Validators: greenfield [v1.9.1](https://github.com/bnb-chain/greenfield/releases/tag/v1.9.1?ref=bnbchain.ghost.io) + +For SP: no action needed. + + +## Hot Fix Release +Greenfield and the Metamask extension are facing compatibility issues, affecting some functionalities such as bucket creation on Dcellar. +This issue is occurring because the MetaMask Extension recently upgraded its middleware library to the latest version, +implementing stricter EIP712 signature verification rules. + +This release contains the hotfix to resolve this issue, all dapps that using the go-sdk and js-sdk is suggested to upgrade to the +latest version. + +- [Go-SDK v1.7.3](https://github.com/bnb-chain/greenfield-go-sdk/releases/tag/v1.7.3) +- [Js-SDK v2.2.0-alpha](https://github.com/bnb-chain/greenfield-js-sdk/releases/tag/%40bnb-chain%2Fgreenfield-js-sdk%402.2.0-alpha.0) + diff --git a/docs/announce/bohr-bsc.md b/docs/announce/bohr-bsc.md new file mode 100644 index 0000000000..4031e81589 --- /dev/null +++ b/docs/announce/bohr-bsc.md @@ -0,0 +1,27 @@ +# Bohr Upgrade of BSC + +
+ Hardfork +
+ +## Upgrade Timeline +The Bohr upgrade will happen at: + +- Testnet: 2024-08-20 01:23:16 AM UTC(passed) +- Mainnet: 2024-09-26 02:20:00 AM UTC + +## Upgrade BSC Mainnet Nodes to v1.4.14 Before Hardfork +Release [v1.4.14](https://github.com/bnb-chain/bsc/releases/tag/v1.4.14) is a hard fork release for BSC Mainnet, the HF name is: [Bohr](https://forum.bnbchain.org/t/bnb-chain-roadmap-mainnet/936) + +There are 4 BEPs in Bohr: + +- BEP-341: Validators can produce consecutive blocks +- BEP-402: Complete missing fields in Block Header to generate Signature +- BEP-404: Clear Miner History when Switching Validators Set +- BEP-410: Add Agent for Validators + +## Key Highlight: [BEP-341: Validators can produce consecutive blocks](https://github.com/bnb-chain/BEPs/blob/master/BEPs/BEP-341.md) +Among these BEPs, BEP-341 holds the most significance as it proposes a change to the block production protocol. However, BEP-341 will only come into effect after the affirmative outcome of a governance vote. + +## Key Highlight: [BEP-402: Complete missing fields in Block Header to generate Signature](https://github.com/bnb-chain/BEPs/blob/master/BEPs/BEP-402.md) +BEP-402 updates the block header signature logic, please pay special attention if your product involves the logic of block header verification. diff --git a/docs/announce/feynman-bsc.md b/docs/announce/feynman-bsc.md index 3daf33d86f..342e10c17b 100644 --- a/docs/announce/feynman-bsc.md +++ b/docs/announce/feynman-bsc.md @@ -2,14 +2,13 @@
Hardfork - 2024 April 10
## Upgrade Timeline The Haber upgrade will happen at: -- Testnet: 11th March 2024 at 6:00 UTC -- Mainnet: 18th April 2024 at 05:49 UTC +- Testnet: March 11 2024 06:00:00 AM UTC +- Mainnet: April 18 2024 05:49:00 AM UTC ## Upgrade to BSC Node v1.3.13 Before Hardfork diff --git a/docs/announce/final-sunset-bc-testnet.md b/docs/announce/final-sunset-bc-testnet.md new file mode 100644 index 0000000000..ae53f85e5d --- /dev/null +++ b/docs/announce/final-sunset-bc-testnet.md @@ -0,0 +1,44 @@ +# Final Sunset Hardfork of BC Testnet + +
+ Hardfork +
+ +## Upgrade Timeline + +The Final Sunset Hardfork will happen at: + +- Testnet: August 1 2024 6:00:00 AM UTC + +## Upgrade to BC Node v0.10.23 Before Hardfork + +BC node need to be upgraded before the hardfork time. + +- https://github.com/bnb-chain/node/releases/tag/v0.10.23 + +### Upgrade Instructions + +As a fullnode runner, you need to take the following steps before the hardfork block height. + +1) Download the new v0.10.23 binary and replace the previous version. + +2) Download the new config + file [app.toml](https://github.com/bnb-chain/node/releases/download/v0.10.23/testnet_config.zip) to replace the + previous version or add the following under the [upgrade] module of `app.toml`. + +```toml +FinalSunsetHeight = 56218686 +``` + +3) Stop the bnbchaind process and restart it with v0.10.23. + +```shell +service bnbchaind restart +``` + +## Key Highlight + +After Final Sunset, the cross-chain communication between the Beacon Chain and BSC will be completely stopped. +The validators in the Beacon Chain community will gradually shut down, and the entire chain will no longer accept +new transactions or propose new blocks. +For more information about BNB Chain Fusion, please refer to [this](https://www.bnbchain.org/en/bnb-chain-fusion). \ No newline at end of file diff --git a/docs/announce/fjord-opbnb.md b/docs/announce/fjord-opbnb.md new file mode 100644 index 0000000000..28276e63ce --- /dev/null +++ b/docs/announce/fjord-opbnb.md @@ -0,0 +1,54 @@ +# Fjord Upgrade of opBNB + +
+ Hardfork +
+ + +## Upgrade Timeline + +The Fjord upgrade will happen at: + +- Testnet: Sep-10-2024 06:00 AM +UTC +- Mainnet: Sep-24-2024 06:00 AM +UTC + +## Upgrade opBNB op-node and op-geth to v0.5.0 Before Hardfork + +Releases: + +- https://github.com/bnb-chain/opbnb/releases/tag/v0.5.0 +- https://github.com/bnb-chain/op-geth/releases/tag/v0.5.0 + +Docker Images + +- ghcr.io/bnb-chain/op-node:v0.5.0 +- ghcr.io/bnb-chain/op-geth:v0.5.0 +- ghcr.io/bnb-chain/op-batcher:v0.5.0 +- ghcr.io/bnb-chain/op-proposer:v0.5.0 + +## Key Highlight: L1 fee calculation changed + +Fjord updates the L1 cost calculation function to use a FastLZ-based compression estimator. The L1 cost is computed as: + +``` +l1FeeScaled = l1BaseFeeScalar*l1BaseFee*16 + l1BlobFeeScalar*l1BlobBaseFee +estimatedSizeScaled = max(minTransactionSize * 1e6, intercept + fastlzCoef*fastlzSize) +l1Fee = estimatedSizeScaled * l1FeeScaled / 1e12 +``` + +You can find the detailed explanation in the [spec](https://specs.optimism.io/protocol/fjord/exec-engine.html). + +## User Facing Changes + +* New flag `--wait-node-sync` added to op-batcher (default false), indicates if during startup, the batcher should wait for a recent batcher tx on L1 to finalize (via more block confirmations). This should help avoid duplicate batcher txs +* New flag `--wait-node-sync` added to op-proposer (default false), indicates if during startup, the proposer should wait for the rollup node to sync to the current L1 tip before proceeding with its driver loop +* New flag `--compression-algo` added to op-batcher (default zlib), user can choose brotli algo after Fjord fork +* New flag `--l1.rpc-max-cache-size` added to op-node (default 1000), so user can config the the maximum cache size of the L1 client + +## Pull Requests + +* Merge upstream v1.7.7 by @bnoieh in https://github.com/bnb-chain/opbnb/pull/216 +* feat(op-node): Keep consistent status when meet an unexpected el sync by @krish-nr in https://github.com/bnb-chain/opbnb/pull/222 +* feat(op-node): add l1 cache size config by @welkin22 in https://github.com/bnb-chain/opbnb/pull/225 +* feat(op-chain-ops): add Wright fork config into genesis file generation code by @welkin22 in https://github.com/bnb-chain/opbnb/pull/226 + diff --git a/docs/announce/haber-bsc.md b/docs/announce/haber-bsc.md index 85f3f788e5..cd49074b83 100644 --- a/docs/announce/haber-bsc.md +++ b/docs/announce/haber-bsc.md @@ -2,14 +2,13 @@
Hardfork - 2024 May 24
## Upgrade Timeline The Haber upgrade will happen at: -- Testnet: 2024-05-29 06:07:00 AM UTC -- Mainnet: 2024-06-20 06:05:00 AM UTC +- Testnet: May 29 2024 06:07:00 AM UTC +- Mainnet: June 20 2024 06:05:00 AM UTC ## Upgrade to BSC Node v1.4.8 Before Hardfork Release [v1.4.8](https://github.com/bnb-chain/bsc/releases/tag/v1.4.8) is a cut-in **hard fork release for BSC Testnet and Mainnet**, the HF name is: [Haber](https://forum.bnbchain.org/t/bnb-chain-roadmap-mainnet/936#h-4haber-wip-25), it only supports one BEP: [BEP-381: Precompile for secp256r1 Curve Support](https://github.com/bnb-chain/BEPs/blob/master/BEPs/BEP-381.md) diff --git a/docs/announce/haber-opbnb.md b/docs/announce/haber-opbnb.md index fb8d54cede..193729162b 100644 --- a/docs/announce/haber-opbnb.md +++ b/docs/announce/haber-opbnb.md @@ -2,15 +2,14 @@
Hardfork - 2024 May 24
## Upgrade Timeline The Haber upgrade will happen at: -- Testnet: May 30, 2024, at 6:00 AM UTC -- Mainnet: June 20th, 2024 08:00:00 AM UTC +- Testnet: May 30 2024, 06:00:00 AM UTC +- Mainnet: June 20 2024 08:00:00 AM UTC ## Upgrade to opBNB Node v0.4.2 Before Hardfork diff --git a/docs/announce/index.md b/docs/announce/index.md index 21b1472008..4808af52ac 100644 --- a/docs/announce/index.md +++ b/docs/announce/index.md @@ -2,27 +2,18 @@ # Announcement
- +
-
BSC Harber Hardfork
-
Enable EIP7212 to support precompiled secp256r1 curve on BSC
+
Altai Upgrade of Greenfield
+
A hotfix release to address Metamask compatibility issue
- 2023 MAY 24 + 2024 Sep 23
- +
-
opBNB Harber Hardfork
-
Enable EIP7212 to support precompiled secp256r1 curve on opBNB
+
Bohr Upgrade of BSC (Mainnet)
+
Introduce 4 BEPs on BSC Mainnet
- 2023 MAY 24 + 2024 Sep 26
- -
-
Greenfield Serengeti Hardfork
-
Introduce major updates and enhancements to the platform, including storage fee paymaster
-
- 2023 MAY 24 -
- -
diff --git a/docs/announce/mongolian-greenfield.md b/docs/announce/mongolian-greenfield.md new file mode 100644 index 0000000000..a57d906f74 --- /dev/null +++ b/docs/announce/mongolian-greenfield.md @@ -0,0 +1,31 @@ +# Mongolian Upgrade of Greenfield + +
+ Hardfork +
+ + +## Upgrade Timeline + +- Testnet: July 31th 2024 07:00:00 AM UTC Blockheight: 10,780,238 + +- Mainnet: August 8th 2024 07:00:00 AM UTC Blockheight: 10,314,605 + +## Validators and SPs should complete upgrading to the latest version before hardfork: + +For Validators: greenfield [v1.9.0](https://github.com/bnb-chain/greenfield/releases/tag/v1.9.0?ref=bnbchain.ghost.io) + +For SPs: greenfield-storage-provider [v1.9.0](https://github.com/bnb-chain/greenfield-storage-provider/releases/tag/v1.9.0?ref=bnbchain.ghost.io) + +## New features introduced: + +* [#639] https://github.com/bnb-chain/greenfield/pull/639 feat: Support msg to create policy by cross chain + +## Bug fixing +* [#638] https://github.com/bnb-chain/greenfield/pull/638 fix: initial val for min value comparison should be large enough +* [#640] https://github.com/bnb-chain/greenfield/pull/640 fix: broken links reroute from local repo to bnbchain docs + +## Docs +* [#633] https://github.com/bnb-chain/greenfield/pull/633 docs: replace docs link + +[//]: # (Reference: https://www.bnbchain.org/en/blog/bnb-greenfield-mongolian-hardfork) \ No newline at end of file diff --git a/docs/announce/second-sunset-bc-testnet.md b/docs/announce/second-sunset-bc-testnet.md new file mode 100644 index 0000000000..216fb82c2d --- /dev/null +++ b/docs/announce/second-sunset-bc-testnet.md @@ -0,0 +1,43 @@ +# Second Sunset Hardfork of BC Testnet + +
+ Hardfork +
+ +## Upgrade Timeline + +The Second Sunset Hardfork will happen at: + +- Testnet: June 21 2024 6:00:00 AM UTC + +## Upgrade to BC Node v0.10.21 Before Hardfork + +BC node need to be upgraded before the hardfork time. + +- https://github.com/bnb-chain/node/releases/tag/v0.10.21 + +### Upgrade Instructions + +As a fullnode runner, you need to take the following steps before the hardfork block height. + +1) Download the new v0.10.21 binary and replace the previous version. + +2) Download the new config + file [app.toml](https://github.com/bnb-chain/node/releases/download/v0.10.21/testnet_config.zip) to replace the + previous version or add the following under the [upgrade] module of `app.toml`. + +```toml +SecondSunsetHeight = 54554742 +``` + +3) Stop the bnbchaind process and restart it with v0.10.21. + +```shell +service bnbchaind restart +``` + +## Key Highlight + +All TimeLocks and AtomicSwaps on BC tesnet will automatically be refunded to user accounts. +All the BSC delegations will be automatically undelegated and refunded to user accounts after the unbonding period. +For more information about BNB Chain Fusion, please refer to [this](https://www.bnbchain.org/en/bnb-chain-fusion). \ No newline at end of file diff --git a/docs/announce/second-sunset-bc.md b/docs/announce/second-sunset-bc.md new file mode 100644 index 0000000000..cbad9b2859 --- /dev/null +++ b/docs/announce/second-sunset-bc.md @@ -0,0 +1,43 @@ +# Second Sunset Hardfork of BC + +
+ Hardfork +
+ +## Upgrade Timeline + +The Second Sunset Hardfork will happen at: + +- Mainnet: July 14 2024 6:00:00 AM UTC + +## Upgrade to BC Node v0.10.22 Before Hardfork + +BC node need to be upgraded before the hardfork time. + +- https://github.com/bnb-chain/node/releases/tag/v0.10.22 + +### Upgrade Instructions + +As a fullnode runner, you need to take the following steps before the hardfork block height. + +1) Download the new v0.10.22 binary and replace the previous version. + +2) Download the new config + file [app.toml](https://github.com/bnb-chain/node/releases/download/v0.10.22/mainnet_config.zip) to replace the + previous version or add the following under the [upgrade] module of `app.toml`. + +```toml +SecondSunsetHeight = 378062790 +``` + +3) Stop the bnbchaind process and restart it with v0.10.22. + +```shell +service bnbchaind restart +``` + +## Key Highlight + +All TimeLocks and AtomicSwaps on BC tesnet will automatically be refunded to user accounts. +All the BSC delegations will be automatically undelegated and refunded to user accounts after the unbonding period. +For more information about BNB Chain Fusion, please refer to [this](https://www.bnbchain.org/en/bnb-chain-fusion). \ No newline at end of file diff --git a/docs/announce/serengeti-greenfield.md b/docs/announce/serengeti-greenfield.md deleted file mode 100644 index a764aa8db4..0000000000 --- a/docs/announce/serengeti-greenfield.md +++ /dev/null @@ -1,28 +0,0 @@ -# Sereengeti Upgrade of Greenfield - -
- Hardfork - 2024 May 29 -
- - -## Upgrade Timeline - -- Testnet: May 16th at 07:00 AM UTC Blockheight: 8,285,529 - -- Mainnet: May 29th at 07:00 AM UTC Blockheight: 7,861,456 - -## Validators and SPs should complete upgrading to the latest version before hardfork: - -For Validators: greenfield [v1.7.1](https://github.com/bnb-chain/greenfield/releases/tag/v1.7.1?ref=bnbchain.ghost.io) - -For SPs: greenfield-storage-provider [v1.7.1](https://github.com/bnb-chain/greenfield-storage-provider/releases/tag/v1.7.1?ref=bnbchain.ghost.io) - -## New features introduced: - -- Add new cross-chain channel `ExecutorChannel` and corresponding cross-app `ExecutorApp` -- Implement storage fee paymaster -- New API to query the recommended virtual group family id for creating bucket - - -Reference: https://www.bnbchain.org/en/blog/bnb-greenfield-erdos-hardfork \ No newline at end of file diff --git a/docs/announce/veld-greenfield.md b/docs/announce/veld-greenfield.md new file mode 100644 index 0000000000..786adaa926 --- /dev/null +++ b/docs/announce/veld-greenfield.md @@ -0,0 +1,31 @@ +# Veld Upgrade of Greenfield + +
+ Hardfork +
+ + +## Upgrade Timeline + +- Testnet: June 25 2024 07:00:00 AM UTC Blockheight: 9,581,218 + +- Mainnet: July 8 2024 07:00:00 AM UTC Blockheight: 9,269,910 + +## Validators and SPs should complete upgrading to the latest version before hardfork: + +For Validators: greenfield [v1.8.0](https://github.com/bnb-chain/greenfield/releases/tag/v1.8.0?ref=bnbchain.ghost.io) + +For SPs: greenfield-storage-provider [v1.8.0](https://github.com/bnb-chain/greenfield-storage-provider/releases/tag/v1.8.0?ref=bnbchain.ghost.io) + +## New features introduced: + +No new feature is introduced. + +## Bug fixing +* [#621](https://github.com/bnb-chain/greenfield/pull/621) fix: add bucket status to bucket migration related events +* [#625](https://github.com/bnb-chain/greenfield/pull/625) fix: discontinued bucket can't be migrated +* [#626](https://github.com/bnb-chain/greenfield/pull/626) fix: principal value supports group name +* [#632](https://github.com/bnb-chain/greenfield/pull/632) fix: ignore register channel error + + +[//]: # (Reference: https://www.bnbchain.org/en/blog/bnb-greenfield-veld-hardfork) \ No newline at end of file diff --git a/docs/announce/wright-opbnb.md b/docs/announce/wright-opbnb.md new file mode 100644 index 0000000000..05fd2d6602 --- /dev/null +++ b/docs/announce/wright-opbnb.md @@ -0,0 +1,32 @@ +# Wright Upgrade of opBNB + +
+ Hardfork +
+ + +## Upgrade Timeline +The Wright upgrade will happen at: + +- Testnet: August 15 2024, 06:00:00 AM UTC +- Mainnet: August 27 2024 06:00:00 AM UTC + +## Upgrade opBNB op-geth to v0.4.5 Before Hardfork + +op-geth need to be upgraded before the hardfork time. + +- https://github.com/bnb-chain/op-geth/releases/tag/v0.4.5 + +op-node upgrade is optional but recommended. + +- https://github.com/bnb-chain/opbnb/releases/tag/v0.4.4 + +## Key Highlight: [gasless feature support](https://github.com/bnb-chain/op-geth/pull/130) + +To support gasless transactions on opBNB, the following features have been introduced: + +- The base fee is set to 0. +- The bundle feature is supported. +- When the gas price is set to 0, the L1 fee will also be set to 0. + +Combined with these features and a sponsor (paymaster), users can send transactions without holding BNB to pay gas fees. diff --git a/docs/assets/bcfusion/circulation.png b/docs/assets/bcfusion/circulation.png new file mode 100644 index 0000000000..976d550219 Binary files /dev/null and b/docs/assets/bcfusion/circulation.png differ diff --git a/docs/assets/bcfusion/dai-onbsc.png b/docs/assets/bcfusion/dai-onbsc.png new file mode 100644 index 0000000000..b16b46a5a1 Binary files /dev/null and b/docs/assets/bcfusion/dai-onbsc.png differ diff --git a/docs/assets/bcfusion/dai-token.png b/docs/assets/bcfusion/dai-token.png new file mode 100644 index 0000000000..89ada11aa2 Binary files /dev/null and b/docs/assets/bcfusion/dai-token.png differ diff --git a/docs/assets/bcfusion/token-recovery-1.png b/docs/assets/bcfusion/token-recovery-1.png new file mode 100644 index 0000000000..3fbfb63f6d Binary files /dev/null and b/docs/assets/bcfusion/token-recovery-1.png differ diff --git a/docs/assets/bcfusion/token-recovery-10.png b/docs/assets/bcfusion/token-recovery-10.png new file mode 100644 index 0000000000..3550399441 Binary files /dev/null and b/docs/assets/bcfusion/token-recovery-10.png differ diff --git a/docs/assets/bcfusion/token-recovery-11.png b/docs/assets/bcfusion/token-recovery-11.png new file mode 100644 index 0000000000..914a78ca74 Binary files /dev/null and b/docs/assets/bcfusion/token-recovery-11.png differ diff --git a/docs/assets/bcfusion/token-recovery-2.png b/docs/assets/bcfusion/token-recovery-2.png new file mode 100644 index 0000000000..4ce2baa323 Binary files /dev/null and b/docs/assets/bcfusion/token-recovery-2.png differ diff --git a/docs/assets/bcfusion/token-recovery-3.png b/docs/assets/bcfusion/token-recovery-3.png new file mode 100644 index 0000000000..f54bf9c347 Binary files /dev/null and b/docs/assets/bcfusion/token-recovery-3.png differ diff --git a/docs/assets/bcfusion/token-recovery-4.png b/docs/assets/bcfusion/token-recovery-4.png new file mode 100644 index 0000000000..60694d36ef Binary files /dev/null and b/docs/assets/bcfusion/token-recovery-4.png differ diff --git a/docs/assets/bcfusion/token-recovery-5.png b/docs/assets/bcfusion/token-recovery-5.png new file mode 100644 index 0000000000..6a269fed14 Binary files /dev/null and b/docs/assets/bcfusion/token-recovery-5.png differ diff --git a/docs/assets/bcfusion/token-recovery-6.png b/docs/assets/bcfusion/token-recovery-6.png new file mode 100644 index 0000000000..31ef5c40f9 Binary files /dev/null and b/docs/assets/bcfusion/token-recovery-6.png differ diff --git a/docs/assets/bcfusion/token-recovery-7.png b/docs/assets/bcfusion/token-recovery-7.png new file mode 100644 index 0000000000..338af58fa7 Binary files /dev/null and b/docs/assets/bcfusion/token-recovery-7.png differ diff --git a/docs/assets/bcfusion/token-recovery-8.png b/docs/assets/bcfusion/token-recovery-8.png new file mode 100644 index 0000000000..e1c39e12af Binary files /dev/null and b/docs/assets/bcfusion/token-recovery-8.png differ diff --git a/docs/assets/bcfusion/token-recovery-9.png b/docs/assets/bcfusion/token-recovery-9.png new file mode 100644 index 0000000000..20985b9f7f Binary files /dev/null and b/docs/assets/bcfusion/token-recovery-9.png differ diff --git a/docs/assets/bcfusion/token-recovery-mismatch-address.png b/docs/assets/bcfusion/token-recovery-mismatch-address.png new file mode 100644 index 0000000000..4fe3a5f1f0 Binary files /dev/null and b/docs/assets/bcfusion/token-recovery-mismatch-address.png differ diff --git a/docs/assets/gifs/buy.gif b/docs/assets/gifs/buy.gif new file mode 100644 index 0000000000..fc01dc798e Binary files /dev/null and b/docs/assets/gifs/buy.gif differ diff --git a/docs/assets/gifs/delist.gif b/docs/assets/gifs/delist.gif new file mode 100644 index 0000000000..b001657718 Binary files /dev/null and b/docs/assets/gifs/delist.gif differ diff --git a/docs/assets/gifs/list.gif b/docs/assets/gifs/list.gif new file mode 100644 index 0000000000..daa3d26cbd Binary files /dev/null and b/docs/assets/gifs/list.gif differ diff --git a/docs/assets/gifs/search.gif b/docs/assets/gifs/search.gif new file mode 100644 index 0000000000..5269491531 Binary files /dev/null and b/docs/assets/gifs/search.gif differ diff --git a/docs/assets/gifs/upload.gif b/docs/assets/gifs/upload.gif new file mode 100644 index 0000000000..f99c4c59f2 Binary files /dev/null and b/docs/assets/gifs/upload.gif differ diff --git a/docs/assets/js/custom.js b/docs/assets/js/custom.js new file mode 100644 index 0000000000..84799e95a9 --- /dev/null +++ b/docs/assets/js/custom.js @@ -0,0 +1,9 @@ +document.addEventListener("DOMContentLoaded", function() { + var navLinks = document.querySelectorAll("nav a"); + + navLinks.forEach(function(link) { + if (link.href.startsWith("http") && !link.href.includes(window.location.hostname)) { + link.setAttribute("target", "_blank"); + } + }); +}); \ No newline at end of file diff --git a/docs/assets/mindpress/buy.png b/docs/assets/mindpress/buy.png new file mode 100644 index 0000000000..2661f87235 Binary files /dev/null and b/docs/assets/mindpress/buy.png differ diff --git a/docs/assets/mindpress/create.png b/docs/assets/mindpress/create.png new file mode 100644 index 0000000000..7767d1eeeb Binary files /dev/null and b/docs/assets/mindpress/create.png differ diff --git a/docs/assets/mindpress/list.png b/docs/assets/mindpress/list.png new file mode 100644 index 0000000000..a1a9cdeff2 Binary files /dev/null and b/docs/assets/mindpress/list.png differ diff --git a/docs/bc-fusion/developers/staking.md b/docs/bc-fusion/developers/staking.md index be09ebd7e5..b963ec30bd 100644 --- a/docs/bc-fusion/developers/staking.md +++ b/docs/bc-fusion/developers/staking.md @@ -177,12 +177,12 @@ specific BNB amount. Please be noted that each validator will have its own APR/APY, and the staking system will auto compound the rewards. The reward is distributed to each validator's BNB pool at 00:00:00 UTC time every day. To calculate the APR/APY of a -validator, the total pooled BNB amount and the crrospanding reward amount for the same day are needed. +validator, the total pooled BNB amount and the corresponding reward amount for the same day are needed. The `StakeHub` contract provides the `getValidatorTotalPooledBNBRecord(address,uint256)(uint256)` and `getValidatorRewardRecord(address,uint256)(uint256)` for the purpose. -The following code shows shows how to calculate the APY at a given day: +The following codes show how to calculate the APY at a given day: ```go // example code, do not use it in production @@ -199,7 +199,7 @@ header, _ := p.client.GetBlockHeader(blockHeight) // calculate the index paramter to call the following functions index := int64(header.Time) / interval.Int64() -// get the total pooled BNB amount and the crrospanding reward amount for the given validator and index +// get the total pooled BNB amount and the corresponding reward amount for the given validator and index totalPooledBNB, _ := stakeHub.GetValidatorTotalPooledBNBRecord(nil, validatorOperatorAddress, index) reward, _ := stakeHub.GetValidatorRewardRecord(nil, validatorOperatorAddress, index) diff --git a/docs/bc-fusion/index.md b/docs/bc-fusion/index.md index 4992de2e0e..bf5028dd42 100644 --- a/docs/bc-fusion/index.md +++ b/docs/bc-fusion/index.md @@ -1,6 +1,8 @@ --- hide: - toc + +title: BNB Chain Fusion --- + # BNB Chain: Empowering the Future of Decentralized Applications ![BNB Chain](./assets/home-hero.png) @@ -59,6 +73,11 @@ Within this ecosystem, the ownership, usage, and monetization of data are possib

BNB Greenfield

A decentralized storage infrastructure designed to provide a secure and scalable platform for storing and managing data on the blockchain. It enables users to store files, NFTs, and other digital assets in a decentralized manner, promoting data ownership and control.

+ + +

Join BNB Ecosystem

+

Share your project with BNB Chain Ecosystem or seeking for cooperations. We want to make it as easy as possible for prjects to get more exposure in BNB Chain Ecosystem or ask for support from the team.

+
## **Use Cases** @@ -87,3 +106,19 @@ Within this ecosystem, the ownership, usage, and monetization of data are possib With the growing demand for Artificial Intelligence or AI, there is now more than ever a need to integrate AI with blockchain technology to reap its benefits. BNB Chain is making this integration a reality by providing a robust platform that easily integrates blockchain and AI. +## **Quick Start** + +
+ +
BNB Smart Chain
+

Getting Started with high performance Layer1 particularly for decentralized finance (DeFi)

+
+ +
opBNB
+

Getting Started with Layer2 scaling solution on BNB Chain ecosystem

+
+ +
BNB Greenfield
+

Getting Started with cutting-edge decentralized storage

+
+
diff --git a/docs/join-ecosystem/index.md b/docs/join-ecosystem/index.md new file mode 100644 index 0000000000..c56b3c30cd --- /dev/null +++ b/docs/join-ecosystem/index.md @@ -0,0 +1,34 @@ +--- +hide: +- toc +--- + + + +
+
+

Join BNB Ecosystem

+ There are several ways to share your project with BNB Chain Ecosystem or seeking for cooperations. We want to make it as easy as possible for prjects to get more exposure in BNB Chain Ecosystem or ask for support from the team. Below is the guideline that we ask projects to follow so that we can get achieve this efficiently. +
+
+ + + +
+ +
DappBay
+

Discover top dApps built on BNB Smart Chain, opBNB & BNB Greenfield, the leading blockchain scaling solution.

+
+ +
Developer Tools
+

List your project on the tool page or find the right tools for your development.

+
+ +
Electrical Capital
+

Add your project to BNB ecosystem and contribute on BNB chain developer data

+
+
\ No newline at end of file diff --git a/docs/join-ecosystem/platforms/dappbay.md b/docs/join-ecosystem/platforms/dappbay.md new file mode 100644 index 0000000000..024e88eff3 --- /dev/null +++ b/docs/join-ecosystem/platforms/dappbay.md @@ -0,0 +1,23 @@ +# Submit Project on DappBay & DappRadar + +DappBay & DappRadar are 2 hubs for users to discover top dApps built on BNB Ecosystem. Projects are encouraged to submit dApp informations to them to get full exposure to users. + +**Submit to DappBay** +DappBay currently supports BNB Smart Chain, opBNB and BNB Greenfield. It also provides risk scanning for those dapps to ensure safety for the ecosystem. You can follow below steps to submit your project: + +1. Connect to [dappbay](https://dappbay.bnbchain.org/) with your wallet. +2. Fill in the form by Clicking on [Submit-Dapps](https://dappbay.bnbchain.org/submit-dapp). +3. Submit the updates by repeating steps 1-2 whenever there is a change of your project, including logo, description, github repo, contract address, ect. + +If you find anything to improve, pls contact us on [BNB Chain official discord](https://discord.com/invite/bnbchain). + +**Submit to DappRadar** +DappRadar is a Dapp Store for user to explore NFTs, NFT Marketplaces, Blockchain Games, De-Fi, Dapps On The Blockchain. It currently supports BNB Smart Chain and opBNB. You can follow below steps to submit your project: + +1. Login [DappRadar](https://dappradar.com/) in the way you prefer. +2. Fill in the form by Clicking on [Submit-Dapp](https://dappradar.com/dashboard/submit-dapp). +3. Submit the updates by repeating steps 1-2 whenever there is a change of your project, including logo, description, github repo, contract address, ect. + +## Submit Project for Cooperations + +For projects seeking for cooperations, you could submit your project details in official discord channel [**submit-project**](https://discord.com/channels/789402563035660308/1209214942448717908). The team will review your submission and contact you if we find a fit. \ No newline at end of file diff --git a/docs/join-ecosystem/platforms/dev-tool.md b/docs/join-ecosystem/platforms/dev-tool.md new file mode 100644 index 0000000000..b99a555a72 --- /dev/null +++ b/docs/join-ecosystem/platforms/dev-tool.md @@ -0,0 +1,11 @@ +# Submit Tools on Developers Tool + +[**Developers Tool**](https://www.bnbchain.org/en/dev-tools) is a developer tooling landscape which collects toolings for developers to build on BSC, opBNB and Greenfield. Contributions on this page will make developers find your project and integrate it in their work more easily. + +**Steps** + +1. **Prepare basic information of your project**: description, website, logo, supported chain, etc. + +2. **Choose the tag** (e.g. Defi, AI, Game, etc) and **Category** (e.g. Wallet, Dex, Marketplace, etc) your project belongs to. + +3. **Submit the above information** by raising a Github PR [**here**](https://github.com/bnb-chain/developer-tools-list). For more information, please refer to this [**Guide**](https://github.com/bnb-chain/developer-tools-list?tab=readme-ov-file#contributing). \ No newline at end of file diff --git a/docs/join-ecosystem/platforms/electrical-capital.md b/docs/join-ecosystem/platforms/electrical-capital.md new file mode 100644 index 0000000000..654bf9d73d --- /dev/null +++ b/docs/join-ecosystem/platforms/electrical-capital.md @@ -0,0 +1,14 @@ +# Contribute on Developer Data + +To contribute on BNB Chain developer activity, projects should add their github repositories to the community-supported developer tracking tool [**Crypto Ecosystems**](https://github.com/electric-capital/crypto-ecosystems), which will track your developer activity and include it in BNB Chain developer statistics. + +**Steps** + +1. Prepare your github repository. + +2. **Create a toml** file under [**ecosystems**](https://github.com/electric-capital/crypto-ecosystems/tree/master/data/ecosystems) for your dapp. + +3. **Add the created toml file to** [**BNB Chain subecosystem**](https://github.com/electric-capital/crypto-ecosystems/blob/master/data/ecosystems/b/bnb-chain-bsc.toml) + +4. For more details, please follow this [**Guide**](https://github.com/electric-capital/crypto-ecosystems?tab=readme-ov-file#how-to-contribute) to add your repository to BNB Chain ecosystem. +Here is an [**example**](https://github.com/electric-capital/crypto-ecosystems/pull/1344) for your reference. \ No newline at end of file diff --git a/docs/showcase/identity/attestation-dev.md b/docs/showcase/identity/attestation-dev.md new file mode 100644 index 0000000000..64546f722a --- /dev/null +++ b/docs/showcase/identity/attestation-dev.md @@ -0,0 +1,157 @@ +--- +title: Get Started - Attestation +--- + +# Get Started - Attestation + +## Creating On-chain Attestations + +The `attest` function enables you to confidently create an on-chain attestation for a specific schema. This powerful function accepts an object with the following properties: + +* `schema`: The unique identifier (UID) of the schema for which the attestation is being created. +* `data`: An object that contains the following properties: + * `recipient`: The BNB address of the attestation recipient. + * `expirationTime`: A Unix timestamp that represents the expiration time of the attestation. You can set it to 0 for no expiration. + * `revocable`: A boolean value that indicates whether the attestation can be revoked or not. + * `refUID`: (Optional) The UID of a referenced attestation. If there is no reference, use ZERO_BYTES32. + * `data`: The encoded data for the attestation, which should be generated using the SchemaEncoder class. + +This function gracefully returns a Promise that resolves to the UID of the newly created attestation. + +```javascript +import { BAS, SchemaEncoder } from "@bnb-attestation-service/bas-sdk"; + +const bas = new BAS(BASContractAddress); +bas.connect(signer); + +// Initialize SchemaEncoder with the schema string +const schemaEncoder = new SchemaEncoder("uint256 eventId, uint8 voteIndex"); +const encodedData = schemaEncoder.encodeData([ + { name: "eventId", value: 1, type: "uint256" }, + { name: "voteIndex", value: 1, type: "uint8" }, +]); + +const schemaUID = "0xb16fa048b0d597f5a821747eba64efa4762ee5143e9a80600d0005386edfc995"; + +const tx = await bas.attest({ + schema: schemaUID, + data: { + recipient: "0xFD50b031E778fAb33DfD2Fc3Ca66a1EeF0652165", + expirationTime: 0, + revocable: true,// Be aware that if your schema is not revocable, this MUST be false + data: encodedData, + }, +}); + +const newAttestationUID = await tx.wait(); + +console.log("New attestation UID:", newAttestationUID); +``` + +## Creating Off-chain Attestations without Saving to GreenField +To generate an off-chain attestation, you can confidently utilize the signOffchainAttestation function offered by the Off-chain class in the BAS SDK. Here’s an example: + +```javascript +import { SchemaEncoder } from "@bnb-attestation-service/bas-sdk"; + +const offchain = await bas.getOffchain(); + +// Initialize SchemaEncoder with the schema string +const schemaEncoder = new SchemaEncoder("uint256 eventId, uint8 voteIndex"); +const encodedData = schemaEncoder.encodeData([ + { name: "eventId", value: 1, type: "uint256" }, + { name: "voteIndex", value: 1, type: "uint8" }, +]); + +// Signer is an ethers.js Signer instance +const signer = new ethers.Wallet(privateKey, provider); + +const offchainAttestation = await offchain.signOffchainAttestation({ + recipient: '0xFD50b031E778fAb33DfD2Fc3Ca66a1EeF0652165', +// Unix timestamp of when attestation expires. (0 for no expiration) + expirationTime: 0, +// Unix timestamp of current time + time: 1671219636, + revocable: true,// Be aware that if your schema is not revocable, this MUST be false + version: 1, + nonce: 0, + schema: "0xb16fa048b0d597f5a821747eba64efa4762ee5143e9a80600d0005386edfc995", + refUID: '0x0000000000000000000000000000000000000000000000000000000000000000', + data: encodedData, +}, signer); + +This function will confidently generate an attestation object off-chain, which will be signed and contain the UID, signature, and attestation data. You can confidently share this object with the intended recipient or confidently store it for future use. +``` + +## Creating Off-chain Attestation and Saving to GreenField +To generate an off-chain attestation and save the result to GreenField Storage, you can confidently utilize the attestOffChain function offered by the BAS SDK. Here’s an example: + +```javascript + const offchain = await bas.getOffchain(); + + // Use wallet or client to ensure the chain is BNB + // [WARN]: should call an async function + await shouldSwitchNetwork(chains[1].id); // BNB chainId + + // Attest offchain + const attestation = await attestOffChain({ + schemaStr: attestParams.schemaStr, + schemaUID: attestParams.schemaUID, + data: attestParams.data, + recipient: attestParams.recipient, + revocable: attestParams.revocable, + }); + + const attestationUID = attestation.uid; + + // Use wallet or client to ensure the chain is Greenfield Chain + await shouldSwitchNetwork(chains[0].id); + const provider = await connector?.getProvider({ chainId: chains[0].id }); + + BigInt.prototype.toJSON = function () { + return this.toString(); + }; + + // Encode the attestation object into blob to store on the Greenfield Storage + const str = JSON.stringify(attestation); + const bytes = new TextEncoder().encode(str); + const blob = new Blob([bytes], { + type: "application/json;charset=utf-8", + }); + + let res; + try { + // Use GreenField SDK to store the attestation + res = await gfClient.createObject( + provider, + new File([blob], `${attestParams.schemaUID}.${attestationUID}`), + attestParams.isPrivate || true + ); + } catch (err: any) { + console.log(err); + alert(err.message); + } +``` + +This function will generate an attestation object off-chain. The attestation object will be signed and will contain the UID, signature, and attestation data. Similar to the previous function, you can also save it to greenfield storage and set the access according to your preferences. + +## More Use Cases + +On-chain attestations will enable a powerful new range of web3 applications, including: + +* Identity +* Trust Scores +* KYC Services +* Social Networks +* Voting +* Oracles (who can be atomically paid for making attestations inside the protocol) +* Likes/Dislikes +* Portable Trust Layers +* Credit Scores +* Clout +* Land Registries + +And many more! + +## Resources +* [BAS JS-SDK](https://doc.bascan.io/sdk/js) \ No newline at end of file diff --git a/docs/showcase/identity/attestation.md b/docs/showcase/identity/attestation.md new file mode 100644 index 0000000000..e953d32d36 --- /dev/null +++ b/docs/showcase/identity/attestation.md @@ -0,0 +1,53 @@ +--- +title: Showcase - BNB Attestation Service +--- + +# BNB Attestation Service + +## What is attestation? +Attestations are digital signatures on structured data used to build more trust on-chain. + + +## BNB Attestation Service(BAS) +The [BNB Attestation Service (BAS)](https://bascan.io/attestation) is an infrastructure built on the BNB ecosystem for generating attestation to verify information. BAS assists users in on-chain or off-chain verification, allowing them to assert ownership of attestation by storing them in Greenfield. This approach ensures data privacy and access control. + +BAS serves as a standard and infrastructure for generating arbitrary attestations. Anyone can define any attestation in BAS along with its resolver. BAS supports the generation of on-chain/off-chain attestations, and by storing off-chain attestations in Greenfield, users gain ownership, ensure attestation privacy, and implement access control. + + +### Core Components of BAS +* [Schema](https://doc.bascan.io/core_concept/schema): A schema is a structured framework that defining the data format and resolver with attest function. Schema dictate what kind of data can be attested and how that data should be presented. + +* [Attestation](https://doc.bascan.io/core_concept/attestation): Attestation provide a standard for user to import any data into web3. With in BAS, attestations can be created on-chain and off-chain. + +* [Resolver](https://doc.bascan.io/core_concept/resolver): User can use resolver to introduce any logic to their attestations. + +Checkout the smart contracts [here](https://github.com/bnb-attestation-service/bas-contract). + +## Types of attestations +Attestations can be made either onchain or offchain. While onchain attestations are stored directly on the BNBChain, offchain attestations reside outside of it, often in decentralized storage solutions like Greenfield. Both methods have their unique advantages, and the choice largely depends on the specific requirements of the use case. + +Learn about the idfference between on-chain and off-chain difference [here](https://doc.bascan.io/core_concept/onchain_vs_offchain). + +### On-Chain Attestation Record + +Users can clearly view the structure of an on-chain attestation on [BASCAN](https://bascan.io/attestation). + + +![On-Chain](../img/onchain-attestation.png) + + +### OffChain Attestation Record +Here's an off-chain attestation record. Unlike the on-chain record, this attestation is public, and the server is unaware of it. Users can share the attestation URL with others to decode the data or publish it to GreenField. Once published or pinned to GreenField, the status icon will switch to "public.” + +![Off-Chain](../img/offchain-attestation.png) + +## Use Cases of Attestation + +### KYC + +Combined BAS with zero-knowledge proofs, [zkPass](https://bas.zkpass.org/) uses three-party TLS and zero-knowledge (ZK) technology to create zero-knowledge proofs of user’s real-world assets or actions directly in your browser. This ensures privacy by not oversharing your data and not requiring API authorizations. ZKPass is a private data protocol using affordable zero-knowledge technology. You can learn more about the use case in this [blog](https://medium.com/zkpass/zkpass-commits-4-million-zkp-tokens-for-bnb-chain-airdrop-alliance-rewards-87e5f32a9ee4). + +### Developer on-chain reputation + +[Aspecta ID](https://aspecta.id/) integrates with the BAS to create and verify on-chain attestations of developers' achievements and activities, ensuring transparency, security, and trust in digital identity management. This partnership allows Aspecta to offer a tamper-proof and verifiable record of developers' skills and contributions, enhancing interoperability and trust within the AI and blockchain ecosystems. By leveraging BAS, Aspecta provides developers with a robust platform to authenticate their credentials, making their professional profiles more credible and secure. You can learn more about the use case in this [blog](https://medium.com/@aspecta_id/bnb-chain-builder-economy-a-builder-community-consensus-to-boost-innovation-with-productivity-ba4d71af6021). + diff --git a/docs/showcase/identity/did.md b/docs/showcase/identity/did.md new file mode 100644 index 0000000000..237f897b18 --- /dev/null +++ b/docs/showcase/identity/did.md @@ -0,0 +1,41 @@ +--- +title: Showcase - Decentralized Identity +--- + +# Decentralized Identity + + +## What is Decentralized Identity? + +Identity, in both the digital and physical worlds, serves as a means of distinguishing and authenticating individuals and entities. + +**Digital Identity**: + +* Includes online personas, accounts, and digital certificates. +* Verified using usernames, passwords, and other authentication methods. +* Relies on electronic data and cryptographic methods for authenticity and security. + +**Decentralized Identifier (DID)**: + +* A semi-anonymous identifier for individuals, companies, objects, etc. +* Protected by a private key, with only the key owner able to verify ownership. +* Allows for multiple DIDs to prevent tracking across different activities. + * Example: One DID for gaming, another for credit reporting. + +### How are decentralized identities secured? +A crucial aspect of securing decentralized identities is cryptography. In cryptography, private keys are known only to their owners, while public keys are widely distributed. This pairing serves two main purposes. First, it enables authentication, allowing the public key to verify that a message was sent by the holder of the corresponding private key. Second, it facilitates encryption, ensuring that only the holder of the paired private key can decrypt a message encrypted with the public key. + +## Benefits of decentralized identity +* **Increased Individual Control**: Users have more control over their identifying information without relying on centralized authorities or third-party services. +* **Trustless Verification**: Facilitates a trustless, seamless, and privacy-protecting method for verifying and managing user identity. +* **Blockchain Technology**: Uses blockchain to create trust between parties and provides cryptographic guarantees for the validity of attestations. +* **Portability of Identity Data**: Identity data is portable; users can store attestations and identifiers in a mobile wallet and share them with any party of their choice, independent of the issuing organization's database. +* **Compatibility with Zero-Knowledge Technologies**: Supports zero-knowledge proofs, allowing individuals to prove ownership or actions without revealing specifics, enhancing trust and privacy for applications like voting. + +## Decentralized Identity Use Cases +| Industry | Traditional Process | Problems/Risks | Verifiable Credentials Solution | +| ------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | +| Supply chain | Utilizes physical IDs and documents to prove compliance, leading to inefficiencies. | Documents can be easily falsified and are challenging to authenticate. The manual verification process is slow and error-prone. Unapproved and non-compliant medical supplies can enter the market, endangering public health. | Verifiable Credentials are tamper-proof and can be verified instantly without needing to contact the issuer, greatly reducing time and costs. | +| Finance | To access financial services, individuals must undergo compliance screening by submitting personal details in physical form, which are stored in large databases and shared with multiple third parties for KYC and credit checks. | Individuals have no control over the security, sharing, and access of their data by third parties. | Credentials are cryptographically secured, tamper-proof, and can be verified, ensuring data integrity and security. | +| Healthcare | Employers manually verify paper-based licenses and certificates for healthcare providers. | Traditional verification processes take weeks or months, delaying the filling of essential healthcare positions. | Medical licenses can be issued as digital credentials by regulatory organizations, allowing healthcare providers to easily share them for immediate verification by hospitals, clinics, or medical departments where they seek employment. | + diff --git a/docs/showcase/identity/dns-dev.md b/docs/showcase/identity/dns-dev.md new file mode 100644 index 0000000000..ce2758a4f2 --- /dev/null +++ b/docs/showcase/identity/dns-dev.md @@ -0,0 +1,104 @@ +--- +title: Get Started - SpaceID +--- + +# Get Started - SpaceID + +## How to Resolve a Name Using the Space ID SDK + +### Step 1: Setup Your Project +1. Install Node.js and npm +Ensure you have Node.js and npm installed. You can download them from Node.js official website. + +2. Create a New Project +Open your terminal and create a new project directory: + +```bash +mkdir spaceid-tutorial +cd spaceid-tutorial +npm init -y +``` +3. Install the Space ID SDK +Install the Space ID SDK package using npm: + +```bash +Copy code +npm install @spaceid/sdk +``` + +### Step 2: Write the Code to Resolve a Name +1. Create a JavaScript File +Create a file named `resolveName.js` in your project directory. + +2. Import the Space ID SDK +At the top of `resolveName.js`, import the Space ID SDK: + +```javascript +const { SpaceID } = require('@spaceid/sdk'); +``` +3. Initialize the Space ID SDK +Initialize the SDK with the necessary parameters: + +```javascript +const spaceId = new SpaceID({ + endpoint: 'https://api.spaceid.io', // API endpoint + apiKey: 'your_api_key' // Replace with your actual API key +}); +``` + +4. Resolve a Name +Write a function to resolve a name using the SDK: + +```javascript +async function resolveName(name) { + try { + const result = await spaceId.resolveName(name); + console.log(`Address for ${name}: ${result.address}`); + } catch (error) { + console.error('Error resolving name:', error); + } +} +``` + +5. Call the Function +Call the `resolveName` function with a sample name: + +```javascript +resolveName('example.eth'); +``` + +### Step 3: Run the Code +1. Run the Script +In your terminal, run the script: + +```bash + +node resolveName.js +``` +2. View the Result +If everything is set up correctly, you should see the resolved address for the provided name in the terminal output. + +## Example Code +Here’s the complete code for resolveName.js: + +```javascript + +const { SpaceID } = require('@spaceid/sdk'); + +const spaceId = new SpaceID({ + endpoint: 'https://api.spaceid.io', + apiKey: 'your_api_key' +}); + +async function resolveName(name) { + try { + const result = await spaceId.resolveName(name); + console.log(`Address for ${name}: ${result.address}`); + } catch (error) { + console.error('Error resolving name:', error); + } +} + +resolveName('example.eth'); +``` +Replace 'your_api_key' with your actual API key and 'example.eth' with the name you want to resolve. You can read more in this [blog](https://nodereal.io/blog/en/how-to-resolve-a-name-through-spaceid-sdk/). diff --git a/docs/showcase/identity/dns.md b/docs/showcase/identity/dns.md new file mode 100644 index 0000000000..d4c6b23b51 --- /dev/null +++ b/docs/showcase/identity/dns.md @@ -0,0 +1,47 @@ +--- +title: Showcase - Decentralized Naming Service +--- + +# Decentralized Naming Service + +## Traditional DNS vs Decentralized Naming Service + +Traditional Domain Name System (DNS) and decentralized naming services like [Ethereum Name Service (ENS)](https://docs.ens.domains/) serve similar purposes but differ significantly in their underlying structures and control mechanisms. Traditional DNS translates human-readable domain names into IP addresses, enabling users to access websites easily. It is managed by centralized authorities, such as ICANN, which oversee the domain registration and resolution process. This centralization can lead to vulnerabilities, such as censorship, single points of failure, and control by a few entities. + +In contrast, decentralized naming services like ENS operate on blockchain technology, distributing control among network participants. ENS maps human-readable names to Ethereum addresses and other resources using smart contracts, ensuring that no single entity has overarching control. This decentralized approach enhances security, reduces the risk of censorship, and provides greater resilience against failures, aligning with the principles of trustlessness and user sovereignty inherent in blockchain ecosystems. + +## SpaceID +### Overview +![spaceid](../img/spaceid.png) + +[Space ID](https://space.id/) offers a universal namespace for blockchain, enabling users to register and manage domain names across different blockchains. It enhances cross-chain interoperability and simplifies user identification across the Web3 ecosystem. This project supports a broad range of applications, from crypto trading to token lending and NFT minting, showcasing a versatile approach to decentralized digital identities. + +### How SpaceID works + +SPACE ID aims to create a universal name service network that connects decentralized identities with the physical and digital worlds. It is progressing toward becoming a comprehensive digital identity solution for Web3. Read the details [here](https://docs.space.id/) + + +### Key features of SpaceID + +**Multi-Chain Name Service** + +Among the top priorities of SPACE ID is supporting more blockchains and top-level domains (TLDs). Unlike SPACE ID 1.0, whose main emphasis was on .bnb Name Service, SPACE ID 2.0 instead focuses on multi-chain name service. +SPACE ID has reached out to various blockchains for partnership discussions, and expects its ecosystem to flourish with time. + +**Web3 Name SDK & API** + +SPACE ID aims to streamline web3 services through the use of a single SDK to assist in the building of DApps. This saves developers time, since they don't have to work with multiple protocols and be encumbered with issues of blockchain incompatibility. +This vision is being realized by adding an all-in-one API over the SDK, allowing current and future partners to seamlessly integrate their web3 services with their unified Web3 Name SDK. + +### Benefits of DNS + +* **Simplified Address Management**: Users can use easy-to-remember names instead of long hexadecimal addresses, reducing the risk of errors in transactions. +* **Interoperability**: SpaceID names can point to various types of addresses and resources, supporting multiple blockchain networks and off-chain data. +* **Decentralization**: SpaceID is built on blockchain, ensuring that no single entity controls the naming system, which enhances security and censorship resistance. +* **Flexibility**: Domain owners have full control over their domains, including the ability to create subdomains, update addresses, and manage metadata. + +### Use Case of SpaceID +* **Cryptocurrency Wallets**: Users can receive payments using simple names instead of complex addresses. +* **Decentralized Websites**: SpaceID names can point to Greenfield content, enabling decentralized websites. +* **Identity Management**: SpaceID can be used as part of a decentralized identity system, linking a user’s SpaceID to their decentralized identifiers and attestations. +* **DApps and Smart Contracts**: Developers can use SpaceID to provide human-readable names for their smart contracts and decentralized applications, improving user experience. diff --git a/docs/showcase/img/bnbminigame.png b/docs/showcase/img/bnbminigame.png new file mode 100644 index 0000000000..ab775b3762 Binary files /dev/null and b/docs/showcase/img/bnbminigame.png differ diff --git a/docs/showcase/img/catizen.png b/docs/showcase/img/catizen.png new file mode 100644 index 0000000000..ca313fc193 Binary files /dev/null and b/docs/showcase/img/catizen.png differ diff --git a/docs/showcase/img/codesnipt1.png b/docs/showcase/img/codesnipt1.png new file mode 100644 index 0000000000..c4b45f1da1 Binary files /dev/null and b/docs/showcase/img/codesnipt1.png differ diff --git a/docs/showcase/img/custom-bundler.png b/docs/showcase/img/custom-bundler.png new file mode 100644 index 0000000000..666ac12608 Binary files /dev/null and b/docs/showcase/img/custom-bundler.png differ diff --git a/docs/showcase/img/in-app-wallet-config.png b/docs/showcase/img/in-app-wallet-config.png new file mode 100644 index 0000000000..3d82863d69 Binary files /dev/null and b/docs/showcase/img/in-app-wallet-config.png differ diff --git a/docs/showcase/img/offchain-attestation.png b/docs/showcase/img/offchain-attestation.png new file mode 100644 index 0000000000..779298f413 Binary files /dev/null and b/docs/showcase/img/offchain-attestation.png differ diff --git a/docs/showcase/img/onchain-attestation.png b/docs/showcase/img/onchain-attestation.png new file mode 100644 index 0000000000..38c8402365 Binary files /dev/null and b/docs/showcase/img/onchain-attestation.png differ diff --git a/docs/showcase/img/pre-built-ui.png b/docs/showcase/img/pre-built-ui.png new file mode 100644 index 0000000000..ddd983c4b6 Binary files /dev/null and b/docs/showcase/img/pre-built-ui.png differ diff --git a/docs/showcase/img/sdk-key.png b/docs/showcase/img/sdk-key.png new file mode 100644 index 0000000000..73c10a9dcd Binary files /dev/null and b/docs/showcase/img/sdk-key.png differ diff --git a/docs/showcase/img/spaceid.png b/docs/showcase/img/spaceid.png new file mode 100644 index 0000000000..bd2c17c81d Binary files /dev/null and b/docs/showcase/img/spaceid.png differ diff --git a/docs/showcase/img/sponsor-rules.png b/docs/showcase/img/sponsor-rules.png new file mode 100644 index 0000000000..c119fdd174 Binary files /dev/null and b/docs/showcase/img/sponsor-rules.png differ diff --git a/docs/showcase/img/thirdweb-plan.png b/docs/showcase/img/thirdweb-plan.png new file mode 100644 index 0000000000..ed3ebc3d7d Binary files /dev/null and b/docs/showcase/img/thirdweb-plan.png differ diff --git a/docs/showcase/telegram/minigame.md b/docs/showcase/telegram/minigame.md new file mode 100644 index 0000000000..e3f13b7f90 --- /dev/null +++ b/docs/showcase/telegram/minigame.md @@ -0,0 +1,143 @@ +--- +title: Showcase - Creating Telegram BNB Mini Apps +--- + +# Creating Telegram BNB Mini Apps: A How-to Guide for Developers + +Launching decentralized applications on Telegram has become increasingly popular due to it giving users access to mini apps and games without requiring them to install additional software, providing an easy way for users to interact with blockchain-based services. This lowers the barriers to entry for users and makes it simple for developers to distribute their apps to a large Telegram audience. + +This guide will walk you through the steps for building a basic Telegram mini app on BNB in just a few hours. By the end, you will have the skills to launch your own BNB project on Telegram’s open platform. Whether you are a blockchain expert or just starting out, this tutorial aims to demystify decentralized app creation. So let’s get started building on BSC! The possibilities are endless when you master Telegram mini apps. + +**Note: This guide only provides a high level overview of the steps that may be involved in creating telegram BNB miniapp. For a detailed guide, visit the [youtube demo](https://www.youtube.com/watch?v=6dMDhPOpPjI) or the [github repo](https://github.com/kang5647/bnb-telegram-demo).** + +# Introduction to Telegram BNB Mini Apps + +## What are Telegram Mini Apps? + +**Telegram Mini Apps** are lightweight web apps that run inside Telegram chats. They allow developers to create social experiences, games, marketplaces, and other services that tap into Telegram's features and large audience. + +![catzen](../img/catizen.png) + +Catizen’s play-to-earn and Hamster Kombat’s tap-to-earn, what's the next big thing for Telegram mini games? + +Mini Apps load instantly, work offline, and don't need to be installed. They can use Telegram login, payments, storage and more. Developers can build Mini Apps using HTML, CSS and JavaScript. +How to Create a Mini App +To create a Mini App, you need: + +- A Telegram bot - Create a bot using @BotFather and obtain an API token. +- A web app - Build an app using web technologies (HTML, CSS, JS) that communicates with your bot. +- Mini App manifest - Provide info about your app like name, description, icon, and your web app's URL. Register the manifest using the @BotFather. + +Your web app will run in an iframe and communicate with the user's Telegram app using the Telegram Bridge. The Bridge exposes the Telegram API and passes messages between your web app and the user's Telegram app. + +## Mini App Types + +There are two main types of Mini Apps: + +### Inline Apps + +Inline Apps show up as results when a user types the bot's username followed by a query. The user taps an app result to launch the Mini App. +Inline Apps are great for: + +- Search experiences +- Quick interactions +- Discovering new content + +### Direct Link Apps + +Users can open a Direct Link App just by tapping a link. Direct Link Apps are aware of the current chat context and support shared, collaborative experiences. +Direct Link Apps are ideal for: + +- Social experiences +- Games +- Productivity tools +- And more + +![example](https://core.telegram.org/file/464001388/10b1a/IYpn0wWfggw.1156850/fd9a32baa81dcecbe4) + +The mini app can also be launched from a keyboard button, from an inline button, and from the bot menu button. Refer to the [official Telegram mini app documentation](https://core.telegram.org/bots/webapps#implementing-mini-apps). + +## Step-by-Step Guide to Creating a BNB Mini App +With the power of Telegram behind them, Mini Apps open up countless new opportunities for creativity and building engaging experiences on the platform. The potential for Mini Apps is huge, and this is just the beginning. + +### Create a Telegram Bot +To get started, you will need to create a Telegram bot. Visit the **@BotFather** bot and enter **/newbot** to create a new bot. You will receive an API token for your bot. Keep this token private as it will allow you to control your bot. + +### Connect the Webapp to Your Bot +Next, you need to connect your webapp to the Telegram bot. Use the **/newapp** command in the **@BotFather** bot by selecting your bot. Provide details such as the app name, description, photo, etc. Finally, enter the URL of your webapp. Your mini app will now appear in the Telegram app and can be launched by users. + +### Additional Capabilities +Mini apps opened from a direct link have limited capabilities. They cannot read or send messages on behalf of the user. However, they support cooperative and multiplayer features within the current chat context. Users must redirect to inline mode to actively pick a result in order to send messages. + +Mini apps are powerful tools for creating fully-fledged web services, team collaborations, multiplayer games, and more. The possibilities are endless. + +## Turning Your Mini App Into a Game +To transform your Mini App into an engaging game on Telegram, you must first register a bot with **@BotFather** and create a Mini App as outlined in the previous section. Once you have a functioning Mini App, you can then convert it into a game by using Telegram’s Game API. + +### Difference Between Mini Apps and Mini Games +Mini games build upon mini apps by providing additional information like: + +- leaderboards, +- game descriptions, +- and a button to launch the game. +- They help package your mini app to make sharing with friends and community easier. + +To create a mini game, use the /newgame command and configure callback functions to return your game's URL. + + +### Register a Game with @GameBot +The first step is to register your game with @BotFather. Send the /newgame command to @BotFather, and provide the required details including: + +- The title and description of your game +- A cover photo +- The message text a user will see when starting a game +- The URL of your Mini App + +Implement Callbacks +You must implement callback functions in your code to handle interactions with the Telegram Game API. Specifically, you need a callback_query() callback which will receive updates from Telegram when a user clicks an inline button in your game. Within this callback, you should check the callback ID to determine which button was clicked. You may implement multiple inline keyboard buttons for the game, but note that the first button must always launch the game. +![codesnpit1](../img/codesnipt1.png) + +### Share Your Game +Once registered, your game will receive a shareable game URL and a game code which players can enter to launch the game. You can share this URL and code on your website, social media, and within Telegram chats to spread your game to new players. + +![bnbminigame](../img/bnbminigame.png) + +### Consider a Leaderboard (Optional) + +To increase engagement and competition, you can implement an in-game leaderboard where players can see the top scores. You will need to store player scores in a database, and return the leaderboard data within your callbacks. Leaderboards are an optional feature, but can greatly enhance the popularity and longevity of Telegram games. + +By following these steps, you can build fully-featured games within Telegram using JavaScript and the Telegram Game API. Games are an exciting way to engage users, and the possibilities for multiplayer, social, and interactive gaming experiences on Telegram are endless. Let your creativity run wild, and build the next hit game on Telegram! + +## FAQs About Telegram BNB Mini Apps + +### What are the main features of Telegram BNB Mini Apps? + +Telegram BNB Mini Apps allow developers to build decentralized applications on BSC or opBNB that can be accessed directly within Telegram. Some of the key features include: + +- Access to Telegram username, chat ID and message ID to provide chat context +- Ability to send messages on behalf of users (with their permission) +- Option to accept payments via crypto wallet +- Access to BSC/opBNB for decentralized functionality +- Option to build multiplayer games and other interactive experiences + +### What are the differences between Mini Apps and Bots? + +Telegram Mini Apps are web apps that run within the Telegram app, while Telegram Bots are automated accounts controlled via API. Some key differences include: + +- Mini Apps have a visual interface, while Bots primarily communicate via text messages. +- Mini Apps can access features like payments, games and location sharing, while Bots have more limited functionality. +- Mini Apps require user consent to access data and send messages, while Bots have implicit access to user data and messaging abilities. +- Mini Apps provide a more robust experience for users while still protecting their data and privacy. Bots continue to be useful for simpler use cases like news updates, reminders and customer support. + +### What languages and frameworks can I use to build a Mini App? + +You can build Telegram Mini Apps using: + +- HTML, CSS and JavaScript - Mini Apps are web apps that run within the Telegram app. +- React, Vue.js or Angular - Popular JavaScript frameworks can be used to build the frontend. +- Solidity - To write smart contracts on BSC for decentralized functionality. +- Web3.js - To interact with BSC from your Mini App's frontend. + +## Summary +Telegram mini apps and mini games provide developers with exciting new ways to engage users. By following the step-by-step guide outlined here, you can leverage Telegram's massive user base to share your own interactive web apps and games. Consider the possibilities - multiplayer experiences, chatbots, productivity tools and more are now just a few lines of code away. As Telegram continues expanding its platform, developers have an opportunity to be on the cutting edge and reach an audience of millions. So don't wait, get started building your own mini app today! With the right idea and a bit of effort, you could create the next viral sensation on Telegram. + diff --git a/docs/showcase/telegram/wallets.md b/docs/showcase/telegram/wallets.md new file mode 100644 index 0000000000..a61dccfc71 --- /dev/null +++ b/docs/showcase/telegram/wallets.md @@ -0,0 +1,33 @@ +--- +title: Showcase - Telegram Wallets +--- + +## **BNB Chain on Telegram: Your Gateway to Web3 Convenience** + +Telegram isn't just for chatting anymore. It's evolving into a powerful hub for Web3 interactions, and BNB Chain is leading the way. If you've been curious about managing your BNB, interacting with dApps, or exploring the decentralized world all within your favorite messaging app, you're in the right place. Let's dive into the exciting possibilities! + +### **Telegram Wallets: Your BNB Chain Companion** + +Forget switching between apps. With Telegram bot wallets, you can seamlessly manage your BNB and interact with the BNB Chain ecosystem directly within your chats. + +| Name | Telegram Link | SDK Doc | +| ----------------- | -------------------------- | ------------------------------------------------------------ | +| CodexField Wallet | https://t.me/codexfieldbot | https://www.npmjs.com/package/codexfield-wallet-connector?activeTab=readme | +| UXUY Wallet | https://t.me/UXUYbot | https://docs.uxuy.com/uxuy-connect/quickstart/ | + + + +### **Telegram Authentication: A Developer's Dream** + +If you're a developer building on BNB Chain, streamlining user onboarding is key. [Privy's SDK](https://docs.privy.io/guide/dashboard/telegram) lets you integrate secure Telegram logins into your app, making it frictionless for users to connect their Telegram identity with your platform. + + +### **Embrace the Future of Web3 on Telegram** + +The convergence of BNB Chain and Telegram opens up a world of possibilities. Whether you're a user looking for convenience or a developer building the next big dApp, these Telegram integrations offer a powerful way to engage with the decentralized world. + +**Remember:** Always do your own research and stay informed about the latest developments in the Web3 space! + + + + diff --git a/docs/showcase/wallet/in-app-wallet.md b/docs/showcase/wallet/in-app-wallet.md new file mode 100644 index 0000000000..2b29bd2f84 --- /dev/null +++ b/docs/showcase/wallet/in-app-wallet.md @@ -0,0 +1,60 @@ +--- +title: Showcase - Thirdweb Wallet SDK Solution +--- + +references: https://thirdweb.com/account-abstraction + +## Service plan + +Developers can choose between two service plans tailored to their needs: + +1. **Free Plan:** Offers basic functionalities and limited access to Thirdweb services. +2. **Pro Plan:** Provides advanced features, priority support, and expanded usage limits. + +![img](../img/thirdweb-plan.png) + +## SDK Key Creation + +To utilize Thirdweb services, developers need to create an SDK key. This key allows integration of the Thirdweb SDK into their applications, enabling various blockchain functionalities. + +**![img](../img/sdk-key.png)** + +## Services of Thirdweb + +**1. Storage Service** + +- **IPFS Support:** The current storage service supports the InterPlanetary File System (IPFS), allowing decentralized file storage and sharing. +- **Future Integration:** There is potential to expand storage options to include Greenfield. This is subject to discussions with Thirdweb. + +**2. In-App Wallet (Wallet as a Service)** + +- **Seamless Integration:** Thirdweb provides an in-app wallet solution, simplifying the process of integrating cryptocurrency wallets into applications. +- **User-Friendly:** This service enhances user experience by offering a seamless and secure method for managing digital assets within the app. + +**![img](../img/in-app-wallet-config.png)** + +**3. Account Abstraction** + +- **Paymaster Configuration:** Thirdweb includes a configuration setup for account abstraction, allowing for advanced transaction management and cost optimization. +- **Customizable:** Developers can tailor the paymaster settings to suit their application's needs. + +**![img](../img/sponsor-rules.png)** + +**4. Third-Party Bundler and Paymaster Integration** + +- **Biconomy and Stackup Support:** Thirdweb supports integration with third-party bundler and paymaster services such as Biconomy and Stackup, offering enhanced functionality and flexibility. + +![img](../img/custom-bundler.png) + +## Supported Chains + +| **Chain** | **mainnet** | **testnet** | +| --------- | ----------- | ----------- | +| **BSC** | **Y** | **Y** | +| **opBNB** | **Y** | **N** | + +## Typical example in React app + +https://portal.thirdweb.com/connect/account-abstraction/guides/react + +![img](../img/pre-built-ui.png) \ No newline at end of file diff --git a/docs/zkbnb/core-concept/overview.md b/docs/zkbnb/core-concept/overview.md index 6ab1cd252a..8cd54a3a8a 100644 --- a/docs/zkbnb/core-concept/overview.md +++ b/docs/zkbnb/core-concept/overview.md @@ -1,5 +1,5 @@ --- -title: zkBNB Overview +title: Overview - zkBNB Core Concepts --- ## Key Features @@ -38,4 +38,4 @@ will be sent to zkBNB to make the trade happen. Users can also cancel an offer m 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. \ No newline at end of file +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. diff --git a/docs/zkbnb/core-concept/zkbnb-arch.md b/docs/zkbnb/core-concept/zkbnb-arch.md index 1a9af72c4f..9df323cd07 100644 --- a/docs/zkbnb/core-concept/zkbnb-arch.md +++ b/docs/zkbnb/core-concept/zkbnb-arch.md @@ -1,5 +1,5 @@ --- -title: zkBNB Architecture +title: zkBNB Architecture - zkBNB --- # zkBNB Architecture @@ -57,4 +57,4 @@ Committer will execute transactions, produce batches. While this ensures efficie 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. \ No newline at end of file +having to rely on the commiter's permission. diff --git a/docs/zkbnb/index.md b/docs/zkbnb/index.md index a088d6bf96..317ec7e849 100644 --- a/docs/zkbnb/index.md +++ b/docs/zkbnb/index.md @@ -1,6 +1,8 @@ --- hide: - toc + +title: zkBNB ---