Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Radicle and Pkarr? #64

Open
lorenzleutgeb opened this issue May 25, 2024 · 4 comments
Open

Radicle and Pkarr? #64

lorenzleutgeb opened this issue May 25, 2024 · 4 comments

Comments

@lorenzleutgeb
Copy link

lorenzleutgeb commented May 25, 2024

Hey there!

I recently started contributing to Radicle:

Radicle is an open source, peer-to-peer code collaboration stack built on Git. Unlike centralized code hosting platforms, there is no single entity controlling the network. Repositories are replicated across peers in a decentralized manner, and users are in full control of their data and workflow.

Simplifying a bit: Every user generates an Ed25519 identity and runs a Radicle Node associated with this identity. Radicle Nodes gossip updates via Git, including Patches and Issues.

For example, my identity:

$ rad self
Alias           lorenz
DID             did:key:z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz
└╴Node ID (NID) z6MkkPvBfjP4bQmco5Dm7UGsX2ruDBieEHi8n9DVJWX5sTEz
SSH             running (?)
├╴Key (hash)    SHA256:xX6bpr+AeF5G0wIvU8nLisgYRM6XjQVNJs3hkMGt+T0
└╴Key (full)    ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIFhK7CqgIIbSthoNn8ea32krOnMzC807Z+PpBkR2YOVj

As will be obvious to you, there's a discovery challenge. For now, DNS names of bootstrap nodes are baked in the binary, and passing around hostnames works okay, but it'd be nice to get addresses of other nodes just by their Radicle Node ID, which is an Ed25519 public key (using a different encoding than Pkarr does).

There's also Radicle Explorer, which is a web-based viewer for projects. As you'll notice from the example URL https://app.radicle.xyz/nodes/ash.radicle.garden/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5 it currently encodes the address of the Radicle Node that should be contacted right in the path (the deployment at app.radicle.xyz may connect to an arbitrary Radicle Node via radicle-httpd, a bridge-like component similar to a Pkarr Relay). It'd be cool if this could be a Radicle Node ID, resolved to an address via a Pkarr Relay.

Apart from the minor discrepancy of different encodings for keys, it looks like Pkarr would be a perfect match for Radicle. So I'm very hyped and happy that you are working on Pkarr. Thanks! I don't have anything particular to discuss here — I guess I would have to prototype an implementation first to see how it goes — but wanted to ping you anyway.

Feel free to check out the Radicle Zulip at radicle.zulipchat.com

@dpc
Copy link
Contributor

dpc commented May 25, 2024

@lorenzleutgeb Oh, hi there again. :D

@Nuhvi
Copy link
Collaborator

Nuhvi commented May 25, 2024

@lorenzleutgeb Thanks for your interest. And I am aware of Radicle, such a cool project with good taste.

resolved to an address via a Pkarr Relay.

Can't wait to see your prototype, and you can also see other projects already using Pkarr like https://github.com/dvc94ch/p2p or https://iroh.computer/blog/iroh-global-node-discovery.

That being said, and out of an abundance of caution, I want to make sure you realize you don't need Pkarr relays, at least outside of browsers, you can always use the DHT directly, which is what happens when you call PkarrClient::resolve(), and even if you use it in browser, you can and should use multiple relays in parallel. Pkarr uses relays and resolvers only to enhance latency, but never compromise on censorship resistance.

@lorenzleutgeb
Copy link
Author

lorenzleutgeb commented May 25, 2024

@Nuhvi Sweet :)

resolved to an address via a Pkarr Relay.

Can't wait to see your prototype, and you can also see other projects already using Pkarr like https://github.com/dvc94ch/p2p or https://iroh.computer/blog/iroh-global-node-discovery.

Actually I found out about Pkarr exactly via the page about global node discovery in iroh that you link :)

That being said, and out of an abundance of caution, I want to make sure you realize you don't need Pkarr relays, at least outside of browsers, you can always use the DHT directly, which is what happens when you call PkarrClient::resolve(), and even if you use it in browser, you can and should use multiple relays in parallel. Pkarr uses relays and resolvers only to enhance latency, but never compromise on censorship resistance.

Aye, I got that :) My idea was for Radicle Nodes to look up in the DHT directly via your Rust API, and using Relays only for web. Sorry for not being explicit.

@Nuhvi
Copy link
Collaborator

Nuhvi commented May 25, 2024

@lorenzleutgeb Yes that should work pretty well, if you intend to run this experiment for a long time, you will need to add an interval task to republish records every hour or two, but other than that, I hope and expect that everything will work smoothly, and happy to support if you encountered any issues otherwise.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants