Become a sponsor to cowlicks
The peer-to-peer append-only log Hypercore is awesome. But the de-facto implementation is written in JavaScript, and there have been no viable implementations in other languages. Which is why I'm working on implementing Hypercore in Rust with the Datrs Organization
Why Rust? I'm not writing Rust for Rust's sake (it is fun though). With Rust's FFI features we can build C libraries for Hypercore, and every† language provides a way to call C. The first step in bringing Hypercore to more languages is writing it in Rust. Then using UniFFI we can build libraries for Python, Swift, Kotlin and others. Preliminary experiments with this are here.
More languages, means more peers, means a more resilient swarm, with more data availability.
Each of these foreign language bindings will use the same internal rust implementation which will prevent incompatibilities from implementation differences. Eventually the JavaScript libraries could even use Rust implementation.
This started when I wanted to implement a peer-to-peer RSS protocol. I initially did this with the JS libraries here. This was a good proof-of-concept but is illustrative of JavaScript Hypercore's limitations. The PoC only works as a standalone application. It can't be integrated into existing RSS clients (unless of course they're written in JavaScript).
Progress
I started by implementing Hyperbee a B-Tree built on Hypercore. That is basically done, here. It took around 2 months of work.
Then I experimented with generating foreign language bindings. With these I've published a Python library. It needs testing! Please let me know if you would like to help with Kotlin, or Swift testing.
I also created FFI bindings (without UniFFI) for usage from C.
When that was done, I moved on to the networking AKA "replication" in rust basically did not exist. I've been working on that off and on for a few months, and it is mostly complete. is currently being integrated with hypercore and hyperbee. You can now actually use Rust hypercore libraries over the internet! The Rust and Javascript implementations are tested to be compatible. More testing is needed!
The next steps are finishing the Rust implementation of hyperswarm
and creating a Rust implementation ofcorestore
.
Future
What else could we do with Hypercore? I have so many ideas:
- A peer-to-peer package manager
- Integrate with existing torrent indexing websites and torrent clients
- Integrate peer-to-peer RSS into existing RSS clients. Or building podcast client built on p2p RSS.
- Distributing centralized API's. For example, popcorn (a nice p2p torrent client) could use it to distribute their torrent and metadata through Hypercore.
- Sharing large mutable libraries. Something like the Internet Archive.
- Email me your own idea!
If you'd like to help checkout our GitHub org, our discord channel, or the Rust Hypercore room on Keet.
1 sponsor has funded cowlicks’s work.
Featured work
-
cowlicks/hyperbee
A peer-to-peer append-only B-tree built on Hypercore
Rust 11 -
cowlicks/replicator
Replicator for hypercores
Rust 2 -
cowlicks/hyper-rss
peer-to-peer RSS built on Hypercore
JavaScript 3