Skip to content

Commit

Permalink
Merge pull request #101 from hyperledger/task/merkle
Browse files Browse the repository at this point in the history
Task/merkle
  • Loading branch information
takemiyamakoto committed Dec 24, 2016
2 parents e7d3e9f + a98614d commit 1bddcad
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/consensus/sumeragi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace sumeragi {
namespace detail{

unsigned int getNumValidSignatures(const Event::ConsensusEvent& event){
int sum = 0;
unsigned int sum = 0;
for(auto&& esig: event.eventsignatures()){
if(signature::verify( esig.signature(), event.transaction().hash(), esig.publickey())){
sum++;
Expand Down
Binary file added docs/iroha_merkle_tree.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
15 changes: 11 additions & 4 deletions docs/iroha_whitepaper.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,15 @@ Consensus events, when received from the event queue, are processed in the follo
2. Events ordered by the leader
3. New events that need ordering, to be processed by the current leader

### 2.7. Data storage

### 2.7. Consensus
#### Merkle tree structure

Transactions are stored in a Merkle tree with each transaction being a leaf of the tree. After a pre-defined depth of the leafs to the Merkle root, the current Merkle root becomes a leaf in a new tree. This acts to group a set of transactions together into a block. This is shown in the following figure.

![alt tag](iroha_merkle_tree.png)

### 2.8. Consensus

Byzantine fault tolerant systems are engineered to tolerate *f* numbers of Byzantine faulty nodes in a network. Iroha introduces a Byzantine Fault Tolerant consensus algorithm called Sumeragi. It is heavily inspired by the B-Chain algorithm:

Expand Down Expand Up @@ -133,15 +140,15 @@ Consensus in Sumeragi is performed on individual transactions and on the global

When syncing nodes with each other, valid parts of the Merkel tree are shared until the roots match.

### 2.8. Data synchronization and retrieval
### 2.9. Data synchronization and retrieval

The state with the Merkle root that has the most transactions in the Merkle tree and has 2*f*+1 signatures of validating servers is the most advanced state.

### Data permissions

## Hijiri: Trust system
### 2.10. Hijiri: Peer reputation system

The trust system is based on rounds. At each round, validating peers that are registered with the membership service perform the following tasks to establish trust (reliability) ratings for the peers:
The hijiri reputation system is based on rounds. At each round, validating peers that are registered with the membership service perform the following tasks to establish trust (reliability) ratings for the peers:

* ping test
* version test
Expand Down

0 comments on commit 1bddcad

Please sign in to comment.