amiller / HoneyBadgerBFT

The Honey Badger of BFT Protocols
Other
311 stars 82 forks source link

THIS PROJECT HAS MOVED

Please see https://github.com/initc3/HoneyBadgerBFT-Python/ for the more up-to-date Python implementation, and https://github.com/initc3/HoneyBadgerBFT/ for an umbrella project about the HoneyBadgerBFT protocol.

HoneyBadgerBFT

The Honey Badger of BFT Protocols

Most fault tolerant protocols (including RAFT, PBFT, Zyzzyva, Q/U) don't guarantee good performance when there are Byzantine faults. Even the so-called "robust" BFT protocols (like UpRight, RBFT, Prime, Spinning, and Stellar) have various hard-coded timeout parameters, and can only guarantee performance when the network behaves approximately as expected - hence they are best suited to well-controlled settings like corporate data centers.

HoneyBadgerBFT is fault tolerance for the wild wild wide-area-network. HoneyBadger nodes can even stay hidden behind anonymizing relays like Tor, and the purely-asynchronous protocol will make progress at whatever rate the network supports.

License

This is released under the CRAPL academic license. See ./CRAPL-LICENSE.txt Other licenses may be issued at the authors' discretion.

Docker

Build the docker image first.

cd docker
docker build -t honeybadgerbft .

Then for example you want to run an instance with N=8, t=2 and B=16:

docker run -e N="8" -e t="2" -e B="16" -it honeybadgerbft

Installation && How to run the code

Working directory is usually the parent directory of HoneyBadgerBFT. All the bold vars are experiment parameters:

Install dependencies (maybe it is faster to do a snapshot on EC2 for these dependencies)

pbc

wget https://crypto.stanford.edu/pbc/files/pbc-0.5.14.tar.gz
tar -xvf pbc-0.5.14.tar.gz
cd pbc-0.5.14
./configure ; make ; sudo make install
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib

charm

sudo apt-get install python3-dev
git clone https://github.com/JHUISI/charm.git
cd charm
git checkout 2.7-dev
sudo python setup.py install

pycrypt

sudo python -m pip install pycrypto

Clone the code:

git clone https://github.com/amiller/HoneyBadgerBFT.git
git checkout another-dev

Generate the keys

Threshold Encryption Keys

python -m HoneyBadgerBFT.threshenc.generate_keys N (N-2t) > thencN_t.keys

Usually, we run ecdsa key generation with large N just once because it can be re-used for different N/t. And we can store threshold signature keys and threshold encryption keys into different files for convenience.

Launch the code
python -m HoneyBadgerBFT.test.honest_party_test -k thsigN_t.keys -e ecdsa.keys -b B -n N -t t -c thencN_t.keys

Notice that each party will expect at least NlgN many transactions. And usually there is a key exception after they finish the consensus. Please just ignore it.

How to deploy the Amazon EC2 experiment

At HoneyBadger/ec2/ folder, run

python utility.py [ec2_access_key] [ec2_secret_key]

In this interactive ipython environment, run the following:

Roadmap and TODO

Interested in contributing to HoneyBadgerBFT? Developers wanted. Contact ic3directors@systems.cs.cornell.edu for more info.