Champii / hashgraph

Hashgraph consensus in rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hashgraph

Hashgraph consensus in rust

This is a work in progress.

This consensus protocol is liscensed by Swirlds for US citizens, you might want to check how to aquire that liscence.

I intend to modify that algorythm to match the one from MaidSafe that is free and open source: PARSEC

Usage

use hashgraph::{Key, Node, NodeConfig};

fn main() {
    let node = Node::new(Key::generate_new(), NodeConfig::default());

    let (tx_in, tx_out) = node.run();

    tx_in.send("Some transaction".to_string().into_bytes()).unwrap();

    loop {
        let res = tx_out.recv();

        println!("{:?}", String::from_utf8(res.unwrap()).unwrap());
    }
}

Features

  • Gossip
  • Event merge
  • Hashgraph consensus
    • Ancestors
    • Self Ancestors
    • Strongly see
    • Witness
    • Round
    • Round Received
    • Virtual voting
    • Famous Witness
    • Consensus Timestamp
    • Break ties on same Consensus Timestamp (Median timestamp)
    • Break ties on same Consensus Timestamp (Signature XOR)
    • Transaction submit
    • Consensus Transaction output
    • Dynamic participants
      • Peer add
      • Peer Remove
  • Caching for performances
  • Sync
  • Event Signature
  • Implement the PARSEC specification instead of the Swirlds one
  • Transaction validation
  • Bad peer removal or punishement
  • Node test

About

Hashgraph consensus in rust

License:MIT License


Languages

Language:Rust 100.0%