Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


Efficient BFT in partial synchronous networks

BDLS Consensus


BDLS is an innovative BFT consensus algorithm that features safety and liveness by presenting a mathematically proven secure BFT protocol that is resilient in open networks such as the Internet. BDLS overcomes many problems, such as the deadlock problem caused by unreliable p2p/broadcast channels. These problems are all very relevant to existing realistic open network scenarios, and are the focus of extensive work in improving Internet security, but it is an area largely ignored by most in mainstream BFT protocol design. (Paper: or or or )

For this library, to make the runtime behavior of consensus algorithm predictable as function: y = f(x, t), where 'x' is the message it received, and 't' is the time while being called, then'y' is the deterministic status of consensus after 'x' and 't' applied to 'f', it has been designed in a deterministic scheme, without parallel computing, networking, and the correctness of program implementation can be proven with proper test cases.


  1. Pure algorithm implementation in deterministic and predictable behavior, easily to be integrated into existing projects, refer to DFA for more.
  2. Well-tested on various platforms with complicated cases.
  3. Auto back-off under heavy payload, guaranteed finalization(worst case gurantee).
  4. Easy integratation into Blockchain & non-Blockchain consensus, like WAL replication in database.
  5. Builtin network emulation for various network latency with comprehensive statistics.


For complete documentation, see the associated Godoc.

Install BDLS on Ubuntu Server 20.04

sudo apt-get update
sudo apt-get -y upgrade
sudo apt-get install autoconf automake libtool curl make g++ unzip
cd /tmp
sudo tar -xvf go1.19.linux-amd64.tar.gz
sudo mv go /usr/local
echo 'export GOROOT=/usr/local/go' >> .profile
echo 'export GOPATH=$HOME/go' >> .profile
echo 'export PATH=$GOPATH/bin:$GOROOT/bin:$PATH' >> .profile
source ~/.profile 
go version
go env
git clone
cd bdls/
git checkout master
cd cmd/emucon/
go build .
./emucon help genkeys
./emucon genkeys --count 4

[open four terminals to run four participants. if you log to remote Linux, 
you may use tmux commands. In tmux, you can switch termian using "ctrl+b d" 
and use "tmux attach -t 0" to enter the terminal. Use "tmux list-session" 
to check the current active terminals]

./emucon run --id 0 --listen ":4680"
./emucon run --id 1 --listen ":4681"
./emucon run --id 2 --listen ":4682"
./emucon run --id 3 --listen ":4683"

cd ../..
go test -v -cpuprofile=cpu.out -memprofile=mem.out -timeout 2h

Regenerate go.mod and go.sum

rm go.*
go mod init
go mod tidy
go mod vendor

See benchmark ourput at: AMD-NORMAL.TXT and PI4-OVERLOAD.TXT


  1. Consensus messages are specified in message.proto, users of this library can encapsulate this message in a carrier message, like gossip in TCP.
  2. Consensus algorithm is NOT thread-safe, it MUST be protected by some synchronization mechanism, like sync.Mutex or chan + goroutine.


  1. A testing IPC peer -- ipc_peer.go
  2. A testing TCP node -- TCP based Consensus Emualtor




The BDLS Byzantine Fault Tolerance protocol by Yongge Wang and GO-Language implementation by







No releases published


No packages published