#dat #p2p #replication #protocol #hypercore


Replication protocol for Hypercore feeds

6 releases

0.4.1 Oct 26, 2023
0.4.0 Oct 12, 2023
0.3.1 Aug 9, 2021
0.3.0 Mar 10, 2021
0.0.1 Jun 1, 2020

#76 in Concurrency

Download history 4/week @ 2023-08-05 9/week @ 2023-08-12 3/week @ 2023-08-19 6/week @ 2023-08-26 7/week @ 2023-09-02 10/week @ 2023-09-09 6/week @ 2023-09-16 2/week @ 2023-09-23 4/week @ 2023-09-30 32/week @ 2023-10-07 16/week @ 2023-10-14 63/week @ 2023-10-21 40/week @ 2023-10-28 14/week @ 2023-11-04 17/week @ 2023-11-11 21/week @ 2023-11-18

100 downloads per month
Used in peermerge



Hypercore Protocol

crates.io version build status downloads docs.rs docs

Hypercore protocol is a streaming, message based protocol. This is a Rust port of the wire protocol implementation in the original Javascript version. This crate targets the Hypercore LTS version 10.

This crate provides a low-level streaming API to hypercore-protocol and exposes an interface that should make it easy to implement actual protocol logic on top.

This crate uses either async-std or tokio for async IO, snow for the Noise handshake and RustCrypto's crypto_secretsteram for encryption.


  • Complete the Noise handshake
  • Establish libsodium's crypto_secretstream.
  • Open channels with a key
  • Accept channels opened by the remote end if your end knows the key
  • Create and verify capability hashes
  • Send and receive all protocol messages
  • Support async-std or tokio runtimes
  • Support WASM
  • Test Javascript interoperability
  • Support the new manifest in the wire protocol to remain compatible with upcoming v11
  • Finalize documentation and release v1.0.0


cargo add hypercore-protocol


These examples sync data between Rust and NodeJS hypercore-protocol implementations. To prepare, run

cd examples-nodejs && npm install && cd ..


Runs the replication.rs example by replicating a hypercore between Rust and Node hypercores and printing the result.

  • Node Server / Rust Client
node examples-nodejs/run.js nodeServer
  • Rust Server / Node Client
node examples-nodejs/run.js rustServer
  • Rust Server / Rust Client
node examples-nodejs/run.js rust
  • Node Server / Node Client
node examples-nodejs/run.js node


To test interoperability with Javascript, enable the js_interop_tests feature:

cargo test --features js_interop_tests

Run benches with:

cargo bench


We're actively looking for contributors to the datrust development! If you're interested, the easiest is to say hi in the #rust channel on the Hypercore Protocol Discord.

Want to help with Hypercore Protocol? Check out our "Contributing" guide and take a look at the open issues.


MIT OR Apache-2.0


~260K SLoC