Skip to content

Commit 3f97efc

Browse files
committed
merged development branch, initial release
1 parent 0a2e4a1 commit 3f97efc

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+6237
-7
lines changed

.gitignore

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# IDE junk files
2+
.idea/*
3+
*.pyc
4+
tmp*
5+
core/msglog*
6+
core/visual*
7+
core/benchmark*
8+
core/bin*
9+
thoughts
10+
mmr13/server_code*
11+
mmr13/tor*
12+
*~
13+
core/server_code*
14+
core/tor*
15+
core/local_experiment_logs/*
16+
commoncoin/keys
17+
msglog.*
18+
ec2/logs/*
19+
ec2/logs_old/*
20+
ec2/hosts
21+
.idea/*
22+
*_keys

CRAPL-LICENSE.txt

+115
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,115 @@
1+
THE CRAPL v0 BETA 1
2+
3+
4+
0. Information about the CRAPL
5+
6+
If you have questions or concerns about the CRAPL, or you need more
7+
information about this license, please contact:
8+
9+
Matthew Might
10+
http://matt.might.net/
11+
12+
13+
I. Preamble
14+
15+
Science thrives on openness.
16+
17+
In modern science, it is often infeasible to replicate claims without
18+
access to the software underlying those claims.
19+
20+
Let's all be honest: when scientists write code, aesthetics and
21+
software engineering principles take a back seat to having running,
22+
working code before a deadline.
23+
24+
So, let's release the ugly. And, let's be proud of that.
25+
26+
27+
II. Definitions
28+
29+
1. "This License" refers to version 0 beta 1 of the Community
30+
Research and Academic Programming License (the CRAPL).
31+
32+
2. "The Program" refers to the medley of source code, shell scripts,
33+
executables, objects, libraries and build files supplied to You,
34+
or these files as modified by You.
35+
36+
[Any appearance of design in the Program is purely coincidental and
37+
should not in any way be mistaken for evidence of thoughtful
38+
software construction.]
39+
40+
3. "You" refers to the person or persons brave and daft enough to use
41+
the Program.
42+
43+
4. "The Documentation" refers to the Program.
44+
45+
5. "The Author" probably refers to the caffeine-addled graduate
46+
student that got the Program to work moments before a submission
47+
deadline.
48+
49+
50+
III. Terms
51+
52+
1. By reading this sentence, You have agreed to the terms and
53+
conditions of this License.
54+
55+
2. If the Program shows any evidence of having been properly tested
56+
or verified, You will disregard this evidence.
57+
58+
3. You agree to hold the Author free from shame, embarrassment or
59+
ridicule for any hacks, kludges or leaps of faith found within the
60+
Program.
61+
62+
4. You recognize that any request for support for the Program will be
63+
discarded with extreme prejudice.
64+
65+
5. The Author reserves all rights to the Program, except for any
66+
rights granted under any additional licenses attached to the
67+
Program.
68+
69+
70+
IV. Permissions
71+
72+
1. You are permitted to use the Program to validate published
73+
scientific claims.
74+
75+
2. You are permitted to use the Program to validate scientific claims
76+
submitted for peer review, under the condition that You keep
77+
modifications to the Program confidential until those claims have
78+
been published.
79+
80+
3. You are permitted to use and/or modify the Program for the
81+
validation of novel scientific claims if You make a good-faith
82+
attempt to notify the Author of Your work and Your claims prior to
83+
submission for publication.
84+
85+
4. If You publicly release any claims or data that were supported or
86+
generated by the Program or a modification thereof, in whole or in
87+
part, You will release any inputs supplied to the Program and any
88+
modifications You made to the Progam. This License will be in
89+
effect for the modified program.
90+
91+
92+
V. Disclaimer of Warranty
93+
94+
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
95+
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
96+
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT
97+
WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT
98+
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
99+
A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
100+
PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
101+
DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
102+
CORRECTION.
103+
104+
105+
VI. Limitation of Liability
106+
107+
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
108+
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR
109+
CONVEYS THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
110+
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES
111+
ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT
112+
NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR
113+
LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM
114+
TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER
115+
PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.

README.md

+117-7
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,128 @@
11
# HoneyBadgerBFT
22
The Honey Badger of BFT Protocols
33

4-
54
<img width=200 src="http://i.imgur.com/wqzdYl4.png"/>
65

7-
COMING SOON
8-
==
9-
106
Most fault tolerant protocols (including RAFT, PBFT, Zyzzyva, Q/U) don't guarantee good performance when there are Byzantine faults.
11-
Even the so-called "robust" BFT protocols (like UpRight, RBFT, Prime, Spinning) have hard-coded timeout parameters (or at least a gradually increasing back-off policy), and only guarantee liveness when the network behaves as expected.
7+
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.
8+
9+
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.
10+
11+
### License
12+
This is released under the CARPL academic license. See ./CRAPL-LICENSE.txt
13+
Other licenses may be issued at the authors' discretion.
14+
15+
### Docker
16+
17+
Build the docker image first.
18+
19+
cd docker_build
20+
docker build -t honeybadgerbft .
21+
22+
Then for example you want to run an instance with N=8, t=2 and B=16:
23+
24+
docker run -e N="8" -e t="2" -e B="16" -it honeybadgerbft
25+
26+
### Installation && How to run the code
27+
28+
Working directory is usually the **parent directory** of HoneyBadgerBFT. All the bold vars are experiment parameters:
29+
30+
+ **N** means the total number of parties;
31+
+ **t** means the tolerance, usually N/4 in our experiments;
32+
+ **B** means the maximum number of transactions committed in a block (by default N log N). And therefore each party proposes B/N transactions.
33+
34+
#### Install dependencies (maybe it is faster to do a snapshot on EC2 for these dependencies)
35+
pbc
36+
37+
38+
wget https://crypto.stanford.edu/pbc/files/pbc-0.5.14.tar.gz
39+
tar -xvf pbc-0.5.14.tar.gz
40+
cd pbc-0.5.14
41+
./configure ; make ; sudo make install
42+
export LIBRARY_PATH=$LIBRARY_PATH:/usr/local/lib
43+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
44+
45+
charm
46+
47+
48+
sudo apt-get install python3-dev
49+
git clone https://github.com/JHUISI/charm.git
50+
cd charm
51+
git checkout 2.7-dev
52+
sudo python setup.py install
53+
54+
55+
56+
pycrypt
57+
58+
59+
sudo python -m pip install pycrypto
60+
61+
Clone the code:
62+
63+
git clone https://github.com/amiller/HoneyBadgerBFT.git
64+
git checkout another-dev
65+
66+
Generate the keys
67+
+ Threshold Signature Keys
68+
69+
python -m HoneyBadgerBFT.commoncoin.generate_keys N (t+1) > thsigN_t.keys
70+
71+
+ ECDSA Keys
72+
73+
python -m HoneyBadgerBFT.ecdsa.generate_keys_ecdsa N > ecdsa.keys
74+
75+
Threshold Encryption Keys
76+
77+
python -m HoneyBadgerBFT.threshenc.generate_keys N (N-2t) > thencN_t.keys
78+
79+
Usually, we run ecdsa key generation with large N just once because it can be re-used for different N/t.
80+
And we can store threshold signature keys and threshold encryption keys into different files for convenience.
81+
82+
##### Launch the code
83+
python -m HoneyBadgerBFT.test.honest_party_test -k thsigN_t.keys -e ecdsa.keys -b B -n N -t t -c thencN_t.keys
84+
85+
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.
86+
87+
### How to deploy the Amazon EC2 experiment
88+
89+
At HoneyBadger/ec2/ folder, run
90+
91+
python utility.py [ec2_access_key] [ec2_secret_key]
92+
93+
In this interactive ipython environment, run the following:
94+
95+
+ Prepare the all the keys files and put them in your local directory (namely ec2 folder)
96+
97+
(See the instructions above)
98+
99+
+ Launch new machines
100+
101+
launch_new_instances(region, number_of_machine)
102+
103+
+ Query IPs
104+
105+
ipAll()
106+
107+
+ Synchronize keys
108+
109+
c(getIP(), 'syncKeys')
110+
111+
+ Install Dependencies
112+
113+
c(getIP(), 'install_dependencies')
114+
115+
+ Clone and repo
116+
117+
c(getIP(), 'git_pull')
118+
119+
+ Launch the experiment
12120

13-
HoneyBadgerBFT is fault tolerance for the *wild*. Badger nodes can even stay hidden behind anonymizing relays like Tor, and the purely-asynchronous protocol makes progress at whatever rate the network provides.
121+
c(getIP(), 'runProtocol:N,t,B')
122+
where N, t, B are experiment parameters (replace them with numbers).
14123

15-
Read more at https://eprint.iacr.org/2016/199
124+
### Unit Tests
16125

126+
TBA
17127

18128

__init__.py

Whitespace-only changes.

commoncoin/README.md

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Implementation of Shoup's RSA-based threshold signature scheme.
2+
3+

commoncoin/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
__all__ = ["millerrabin", "boldyreva", "boldyreva_gpic", "generate_keys"]
2+
import millerrabin
3+
import generate_keys

0 commit comments

Comments
 (0)