Bsc
A BNB Smart Chain client based on the go-ethereum fork
Install / Use
/learn @bnb-chain/BscREADME
BNB Smart Chain
The goal of BNB Smart Chain is to bring programmability and interoperability to BNB Beacon Chain. In order to embrace the existing popular community and advanced technology, it will bring huge benefits by staying compatible with all the existing smart contracts on Ethereum and Ethereum tooling. And to achieve that, the easiest solution is to develop based on go-ethereum fork, as we respect the great work of Ethereum very much.
BNB Smart Chain starts its development based on go-ethereum fork. So you may see many toolings, binaries and also docs are based on Ethereum ones, such as the name "geth".
But from that baseline of EVM compatible, BNB Smart Chain introduces a system of 21 validators with Proof of Staked Authority (PoSA) consensus that can support short block time and lower fees. The most bonded validator candidates of staking will become validators and produce blocks. The double-sign detection and other slashing logic guarantee security, stability, and chain finality.
The BNB Smart Chain will be:
- A self-sovereign blockchain: Provides security and safety with elected validators.
- EVM-compatible: Supports all the existing Ethereum tooling along with faster finality and cheaper transaction fees.
- Distributed with on-chain governance: Proof of Staked Authority brings in decentralization and community participants. As the native token, BNB will serve as both the gas of smart contract execution and tokens for staking.
More details in White Paper.
Release Types
There are three types of release, each with a clear purpose and version scheme:
- 1.Stable Release: production-ready builds for the vast majority of users. Format:
v<Major>.<Minor>.<Patch>, example: v1.5.19. - 2.Feature Release: early access to a single feature without affecting the core product. Format:
v<Major>.<Minor>.<Patch>-feature-<FeatureName>, example: v1.5.19-feature-SI. - 3.Preview Release: bleeding-edge builds for users who want the latest code. Format:
v<Major>.<Minor>.<Patch>-<Meta>, Meta values indicate maturity: alpha (experimental), beta (largely complete), rc (release candidate), example: v1.5.0-alpha.
Key features
Proof of Staked Authority
Although Proof-of-Work (PoW) has been approved as a practical mechanism to implement a decentralized network, it is not friendly to the environment and also requires a large size of participants to maintain the security.
Proof-of-Authority(PoA) provides some defense to 51% attack, with improved efficiency and tolerance to certain levels of Byzantine players (malicious or hacked). Meanwhile, the PoA protocol is most criticized for being not as decentralized as PoW, as the validators, i.e. the nodes that take turns to produce blocks, have all the authorities and are prone to corruption and security attacks.
Other blockchains, such as EOS and Cosmos both, introduce different types of Deputy Proof of Stake (DPoS) to allow the token holders to vote and elect the validator set. It increases the decentralization and favors community governance.
To combine DPoS and PoA for consensus, BNB Smart Chain implement a novel consensus engine called Parlia that:
- Blocks are produced by a limited set of validators.
- Validators take turns to produce blocks in a PoA manner, similar to Ethereum's Clique consensus engine.
- Validator set are elected in and out based on a staking based governance on BNB Smart Chain.
- Parlia consensus engine will interact with a set of system contracts to achieve liveness slash, revenue distributing and validator set renewing func.
Native Token
BNB will run on BNB Smart Chain in the same way as ETH runs on Ethereum so that it remains as native token for BSC. This means,
BNB will be used to:
- pay
gasto deploy or invoke Smart Contract on BSC
Building the source
Many of the below are the same as or similar to go-ethereum.
For prerequisites and detailed build instructions please read the Installation Instructions.
Building geth requires both a Go (version 1.24 or later) and a C compiler (GCC 5 or higher). You can install
them using your favourite package manager. Once the dependencies are installed, run
make geth
or, to build the full suite of utilities:
make all
If you get such error when running the node with self built binary:
Caught SIGILL in blst_cgo_init, consult <blst>/bindinds/go/README.md.
please try to add the following environment variables and build again:
export CGO_CFLAGS="-O -D__BLST_PORTABLE__"
export CGO_CFLAGS_ALLOW="-O -D__BLST_PORTABLE__"
Executables
The bsc project comes with several wrappers/executables found in the cmd
directory.
| Command | Description |
| :--------: | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| geth | Main BNB Smart Chain client binary. It is the entry point into the BSC network (main-, test- or private net), capable of running as a full node (default), archive node (retaining all historical state) or a light node (retrieving data live). It has the same and more RPC and other interface as go-ethereum and can be used by other processes as a gateway into the BSC network via JSON RPC endpoints exposed on top of HTTP, WebSocket and/or IPC transports. geth --help and the CLI page for command line options. |
| clef | Stand-alone signing tool, which can be used as a backend signer for geth. |
| devp2p | Utilities to interact with nodes on the networking layer, without running a full blockchain. |
| abigen | Source code generator to convert Ethereum contract definitions into easy to use, compile-time type-safe Go packages. It operates on plain Ethereum contract ABIs with expanded functionality if the contract bytecode is also available. However, it also accepts Solidity source files, making development much more streamlined. Please see our Native DApps page for details. |
| bootnode | Stripped down version of our Ethereum client implementation that only takes part in the network node discovery protocol, but does not run any of the higher level application protocols. It can be used as a lightweight bootstrap node to aid in finding peers in private networks. |
| evm | Developer utility version of the EVM (Ethereum Virtual Machine) that is capable of running bytecode snippets within a configurable environment and execution mode. Its purpose is to allow isolated, fine-grained debugging of EVM opcodes (e.g. evm --code 60ff60ff --debug run).
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
