• Stars
    star
    310
  • Rank 134,926 (Top 3 %)
  • Language
    Python
  • License
    Other
  • Created over 9 years ago
  • Updated over 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

The Honey Badger of BFT Protocols

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:

  • N means the total number of parties;
  • t means the tolerance, usually N/4 in our experiments;
  • B means the maximum number of transactions committed in a block (by default N log N). And therefore each party proposes B/N transactions.

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 Signature Keys

    python -m HoneyBadgerBFT.commoncoin.generate_keys N (t+1) > thsigN_t.keys

  • ECDSA Keys

    python -m HoneyBadgerBFT.ecdsa.generate_keys_ecdsa N > ecdsa.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:

  • Prepare the all the keys files and put them in your local directory (namely ec2 folder)

    (See the instructions above)

  • Launch new machines

      launch_new_instances(region, number_of_machine)
    
  • Query IPs

      ipAll()
    
  • Synchronize keys

      c(getIP(), 'syncKeys')
    
  • Install Dependencies

      c(getIP(), 'install_dependencies')
    
  • Clone and repo

      c(getIP(), 'git_pull')
    
  • Launch the experiment

      c(getIP(), 'runProtocol:N,t,B')
    

where N, t, B are experiment parameters (replace them with numbers).

Roadmap and TODO

  • Implement distributed key generation

  • Investigate better parameterization and add support for larger key sizes

  • Replace plain TCP sockets with reliable/authenticated channels

  • Integration with Hyperledger, Open Blockchain, etc.

Interested in contributing to HoneyBadgerBFT? Developers wanted. Contact [email protected] for more info.

More Repositories

1

libfreenect-goodies

Extra libraries and examples for libfreenect, especially high level processing, vision, and visualizations
Python
166
star
2

redblackmerkle

An authenticated data structure based on a red-black tree.
Python
54
star
3

lambda-auth

authenticated data structures, generically
Python
49
star
4

sprites

Python
44
star
5

haskell-saucy

Super Amazing Universal Composability, Yeah!
Haskell
32
star
6

bitcoin-python

Friendly bitcoin API binding for Python
Python
26
star
7

python-zk-proofs

Python
25
star
8

instant-poker

Off-chain poker in Ethereum
Python
22
star
9

tinybitcoinpeer

A toy bitcoin peer. Connects to testnet, shakes hands, reacts to pings, asks for pongs.
Python
21
star
10

generic-ads

Generalized Authenticated Data Structures
Haskell
20
star
11

pinocchio

pinocchio from Microsoft Research - this is rehosted on github only because Codeplex went down!
C++
18
star
12

ethereum-blockhashes

Contract to record hashes of recent and historic blocks
Python
14
star
13

sgx-epid-contest

Good Riddance to EPID Pre-Deprecation Memorial Contest
Solidity
12
star
14

blockplayer

Blockplayer is a system that uses a depth sensor to acquire and track a building block model in realtime, as the user assembles and interacts with the physical model. This is the open-source project code that goes along with the IEEE TVGC 2012 (IEEE VR 2012) paper "Interactive 3D Model Acquisition and Tracking for Building Block Structures".
Python
11
star
15

pykinect

Python demos and tools for working with kinect data
Python
10
star
16

distributed-keygen

Distributed Key Generation in the Wild (from https://crysp.uwaterloo.ca/software/DKG/ )
C++
10
star
17

bitcoin-sok

Systematizing Knowledge about Bitcoin
TeX
8
star
18

dstack-vm

Python
7
star
19

fstar374

algorithms and models of computation in fstar
F*
7
star
20

gramine-rsademo

Python
7
star
21

gramine-sgx-revm

Rust
6
star
22

allofthecoins

Dockerfile
5
star
23

otrjs

OTR Implementation in Javascript (libotr clone)
JavaScript
5
star
24

glxcontext

Gets you an OpenGL context for offscreen rendering
Python
5
star
25

static_server

Static web server that uses bottle
Python
4
star
26

shadow-plugin-bitcoin

Shadow plugin for bitcoind (the Satoshi reference client)
C
4
star
27

byzbit

a model of Bitcoin as a distributed Byzantine consensus protocol
Python
4
star
28

rtmodel

Python
4
star
29

pyzxing

qrcode reader - wrapper for Zebra-Crossing (zxing/cpp)
C++
4
star
30

projective_stereo

Python
3
star
31

CoinCoq

An attempt at a formal specification for Bitcoin, including formal semantics for Bitcoin scripts.
Verilog
3
star
32

zero-collateral-lottery

Commitment-based Ethereum Lotteries without Collateral
Python
3
star
33

wxpy3d

wxWidgets-based alternative to GLUT that works with ipython -wthread
Python
3
star
34

gramine-dummy-attester

Python
3
star
35

accessoracles

C
3
star
36

upright

Automatically exported from code.google.com/p/upright
Java
2
star
37

chitchat

An experiment using a chat with a three-person group
Python
2
star
38

viff

Clone of http://viff.dk/
Python
2
star
39

legoscan

3D reconstruction for lego
Python
2
star
40

clickmeasure

Python
2
star
41

geppetto

Geppetto from Microsoft Research
F#
2
star
42

quartet

Python
2
star
43

classipy-visuals

Classifier Performance Visualization
Python
2
star
44

nonoutsourceable

Nonoutsourceable Scratch-off Puzzles to Discourage Bitcoin Mining Coalitions
C
2
star
45

browseridchat

A real-time encrypted chat service using Browser ID
JavaScript
2
star
46

mesh

Python
2
star
47

dapperlabs

Free Software from Dapper Vision Inc.
2
star
48

solidity-dupchecker

solidity code for checking if an array has duplicates using a bloom filter or advice
Solidity
2
star
49

gramine-forge

Solidity
2
star
50

figr

Use the web to display matplotlib figures from a headless machine
1
star
51

miniviff

experiments in secret sharing
Python
1
star
52

mev-meditations

Jupyter Notebook
1
star
53

graphicsii

Python
1
star
54

pystats

Python
1
star
55

pyreg

Python and JS bridge for easy prototyping
Python
1
star
56

ucmodel

Python
1
star
57

handframe_calibration

Python
1
star
58

statusupdate

it's status update, our top secrete game
PHP
1
star
59

cot6410coq

computability models and theorems in coq
Verilog
1
star
60

dividingline

Python
1
star
61

calibkinect

Convert OpenNI (opennpy) depth images to metric 3D and back
Python
1
star
62

giftchecks

Self-issued currency for a gift-economy. An electronic potlatch.
Python
1
star
63

pywebcredits

Python
1
star
64

docker-zcash

Docker files for building zcash repeatably.
Shell
1
star
65

expdeam

deamortized exponential datastructures
Haskell
1
star
66

wearcoin

JavaScript
1
star
67

rapier

Rapid Iterative Prototyping Tutorials for Python
1
star
68

pnymgr

Pseudonym Manager - javascript toolkit for managing your pseudonyms
1
star