Rust implementation of the negentropy set-reconcilliation protocol.

Overview

Negentropy

Description

Implementation of the negentropy set-reconciliation protocol.

Project structure

The project is split up into many crates:

Flame Graph and perf

Install flamegraph and then run make graph. You'll find a new file in the project root called flamegraph.svg: open it in a browser.

In the terminal you should see something like:

Client init took 0 ms
Relay items: 1000000
Relay reconcile took 25 ms
Client reconcile took 39 ms
[ perf record: Woken up 10 times to write data ]
[ perf record: Captured and wrote 2.406 MB perf.data (150 samples) ]

Benchmarks (unstable)

To run the benchmarks use: make bench

License

This project is distributed under the MIT software license - see the LICENSE file for details

Donations

⚡ Tips: https://getalby.com/p/yuki

⚡ Lightning Address: [email protected]

You might also like...
Rust implementation of the Inter-Blockchain Communication (IBC) protocol.

ibc-rs Rust implementation of the Inter-Blockchain Communication (IBC) protocol. This project hosts the ibc rust crate which defines the main data str

Pure Rust implementation of components of the Secure Shell (SSH) protocol

RustCrypto: SSH Pure Rust implementation of components of the Secure Shell (SSH) protocol. Crates Name crates.io Docs Description ssh—encoding Decoder

Rust implementation of the Matter protocol. Status: Experimental

matter-rs: The Rust Implementation of Matter Build Building the library: $ cd matter $ cargo build Building the example: $ cd matter $ RUST_LOG="matt

An implementation of the SuperNova protocol, written in Rust

SuperNova Warning: this implementation is experimental and not audited. Please use at your own risk. This repository contains an implementation of the

Flexible Rust implementation of the MuSig2 multisignature protocol, compatible with Bitcoin.

MuSig2 This crate provides a flexible rust implementation of MuSig2, an optimized digital signature aggregation protocol, on the secp256k1 elliptic cu

Prefix tree (ordered map and set) data structure using 100% safe Rust

PFX: A 100% safe, blob-oriented prefix tree This crate provides a prefix tree map and set data structure, implemented purely in safe Rust. The API is

Minimal implementation of the Mimblewimble protocol.

Grin Grin is an in-progress implementation of the Mimblewimble protocol. Many characteristics are still undefined but the following constitutes a firs

An implementation of the OPAQUE password-authenticated key exchange protocol

The OPAQUE key exchange protocol OPAQUE is an asymmetric password-authenticated key exchange protocol. It allows a client to authenticate to a server

A safe implementation of the secure remote password authentication and key-exchange protocol (SRP), SRP6a and legacy are as features available.

Secure Remote Password (SRP 6 / 6a) A safe implementation of the secure remote password authentication and key-exchange protocol (SRP version 6a). Ver

Comments
  • Connecting test harness

    Connecting test harness

    Hi! I got the harness working. Unfortunately the test suite isn't passing yet. I'm trying to track it down. Here's my work so far: https://github.com/yukibtc/rust-negentropy/compare/master...hoytech:rust-negentropy:harness

    I added the harness and started comparing the behaviour of the C++ versus the Rust impl. The first thing that was causing me problems was that you used a vector for pending_output, but I used a deque. I just made the Rust one use a deque instead, so I can compare more directly for now. We can roll that back later if not necessary.

    The first difference I noticed was in the splitRange function. The C++ function has an iterator curr whereas the rust one doesn't. I added some tracing lines (visible in the above commit) and this is the output I get from rust:

    TRACE A 0
    TRACE A 1677970534
    TRACE A 1677970534
    TRACE A 1677970534
    TRACE A 1677970534
    TRACE A 1677970534
    TRACE A 1677970534
    TRACE A 1677970534
    TRACE A 1677970534
    TRACE A 1677970534
    TRACE A 1677970534
    TRACE A 1677970534
    TRACE A 1677970534
    TRACE A 1677970534
    TRACE A 1677970534
    TRACE A 1677970534
    TRACE B 18446744073709551615
    

    But this is what I got from the C++:

    TRACE A 1677970550
    TRACE A 1677970563
    TRACE A 1677970577
    TRACE A 1677970595
    TRACE A 1677970609
    TRACE A 1677970622
    TRACE A 1677970634
    TRACE A 1677970648
    TRACE A 1677970657
    TRACE A 1677970668
    TRACE A 1677970677
    TRACE A 1677970687
    TRACE A 1677970691
    TRACE A 1677970713
    TRACE A 1677970725
    TRACE A 18446744073709551615
    TRACE B 18446744073709551615
    

    So something isn't advancing through the ranges properly in the rust version. You can reproduce this by checking out the two repos side-by-side (make sure to pull latest master in negentropy repo) and running the following command inside the negentropy/test/ directory:

    DEBUG=1 RUST_BACKTRACE=1 RECS=200 P1=1 P2=0 P3=0 perl fuzz.pl rust rust
    
    bug 
    opened by hoytech 5
  • New protocol version

    New protocol version

    Hi Yuki,

    I have made some significant changes to the protocol. In order to protect against malicious input, I have changed the fingerprint function to SHA-256. I also added a protocol version negotiation mechanism.

    This PR brings the Rust version up to compatibility with the latest negentropy master branch, and is byte-wise identical to the C++ and JS implementations.

    I plan to roll out a new version of strfry that uses this ASAP.

    Happy to answer any questions.

    Thanks!

    opened by hoytech 0
Releases(v0.3.0)
  • v0.3.0(Sep 17, 2023)

    What's Changed

    • New protocol version by @hoytech in https://github.com/yukibtc/rust-negentropy/pull/3

    Full Changelog: https://github.com/yukibtc/rust-negentropy/compare/v0.2.1...v0.3.0

    Source code(tar.gz)
    Source code(zip)
  • v0.2.1(Sep 13, 2023)

    What's Changed

    • Testing harness for compatability with negentropy reference test suite, fix issues found by test suite by @hoytech in https://github.com/yukibtc/rust-negentropy/pull/2

    New Contributors

    • @hoytech made their first contribution in https://github.com/yukibtc/rust-negentropy/pull/2

    Full Changelog: https://github.com/yukibtc/rust-negentropy/compare/v0.2.0...v0.2.1

    Source code(tar.gz)
    Source code(zip)
  • v0.2.0(Sep 12, 2023)

Owner
Yuki Kishimoto
86F3 105A DFA8 AB58 7268 DCD7 8D3D CD04 2496 19D1
Yuki Kishimoto
Rust implementation of Zcash protocol

The Parity Zcash client. Gitter Blog: Parity teams up with Zcash Foundation for Parity Zcash client Installing from source Installing the snap Running

Parity Technologies 183 Sep 8, 2022
A prototype implementation of the Host Identity Protocol v2 for bare-metal systems, written in pure-rust.

Host Identity Protocol for bare-metal systems, using Rust I've been evaluating TLS replacements in constrained environments for a while now. Embedded

null 31 Dec 12, 2022
A Rust implementation of the Message Layer Security group messaging protocol

Molasses An extremely early implementation of the Message Layer Security group messaging protocol. This repo is based on draft 4 of the MLS protocol s

Trail of Bits 109 Dec 13, 2022
Ecoball Node is the Official Rust implementation of the Ecoball protocol.

Ecoball Node is the Official Rust implementation of the Ecoball protocol. It is a fork of OpenEthereum - https://github.com/openethereum/

Ecoball Chain 2 Jun 9, 2022
A rust implementation of the ABCI protocol for tendermint core

?? DEPRECATED ?? This repo has been deprecated. Development work continues as the "abci" crate of informalsystems/tendermint-rs. Please reference that

Tendermint 117 Dec 12, 2022
Open source Rust implementation of the Witnet decentralized oracle protocol, including full node and wallet backend 👁️🦀

witnet-rust is an open source implementation of the Witnet Decentralized Oracle Network protocol written in Rust. Components witnet-rust implements ma

The Witnet Project 155 Nov 21, 2022
The Rust implementation of Conflux protocol.

Conflux-Rust Conflux-rust is a Rust-based implementation of the Conflux protocol. It is fast and reliable. Please follow the Conflux Documentation to

Conflux 562 Jan 7, 2023
In addition to encryption library, pure RUST implementation of SSH-2.0 client protocol

In addition to encryption library, pure RUST implementation of SSH-2.0 client protocol

陈年旧事。 73 Jan 1, 2023
Next-generation implementation of Ethereum protocol ("client") written in Rust, based on Erigon architecture.

?? Martinez ?? Next-generation implementation of Ethereum protocol ("client") written in Rust, based on Erigon architecture. Why run Martinez? Look at

Arthur·Thomas 23 Jul 3, 2022
Prost is a Protocol Buffers implementation for the Rust Language.

PROST! prost is a Protocol Buffers implementation for the Rust Language. prost generates simple, idiomatic Rust code from proto2 and proto3 files. Com

Tokio 2.5k Jan 8, 2023