Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bihs, a bivalent variant for hotstuff protocol

bihs differs from hotstuff in two aspects:

  1. the votes are splitted into (height, view) like pbft
  2. the possible block for each height is bivalent, either the one proposed by current leader(which can be calculated after the confirmation of the previous block), or a deterministic empty block.

So bihs doesn't have the requirement to know leader for future block, it's as safe as pbft, while the complexity is still O(n).

Usage

var (
    store StateDB
    p2p P2P
    conf Config
)

# all you need to do is to provide the implementations for Block/StateDB/P2P interfaces

store = ...
p2p = ...

hs := New(store , p2p , conf)
hs.Start()

# after this, you can propose blocks when it's your turn

hs.Propose(someBlk)

# you can also wait for the confirmation of some block easily

hs.Wait(context.Background(), height)

Demo

Here

geth integration

Here

About

bivalent hot stuff consensus

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages