-
Notifications
You must be signed in to change notification settings - Fork 37.7k
Add Yggdrasil support #23531
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
Add Yggdrasil support #23531
Conversation
I set up an Yggdrasil router as well: |
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
UPDATE: No opinions on this PR: #23531 (comment)
Despite Yggdrasil is being considered an alpha quality software, it seems to be much more maintained than CJDNS
NACK
Reasons:
- Alpha project should not be used for mainnet. For experiments maybe implementing only for testnet makes sense.
- ipv4, ipv6, Tor, i2p and cjdns already exist. Adding more networks will add complexity based on combinations and possibility of bugs.
- Few other reasons mentioned here: #23077 (comment)
- GNUnet will be a better alternative if/when one more network makes sense
Mind that this is a P2P BIP-level change, I think you'll want to write a (short) ancillary BIP to BIP155 to propose this new assigned number. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't looked into or tested yggdrasil yet. Concept ACK on additional networks available to users if that strengthens the robustness of the peer-to-peer network. Debug build is clean for me. Some initial light feedback.
The addresses used by Yggdrasil are considered routable by Bitcoin Core. That is - just like any other normal IPv6 address, publicly routable on the global internet. They will be gossiped. This is in contrast to CJDNS which uses unroutable addresses from RFC 4193 and thus need special handling in Bitcoin Core.
According to https://yggdrasil-network.github.io/faq.html#will-yggdrasil-conflict-with-my-network-routing it uses
Hmm, CJDNS works for me on FreeBSD/x86_64 and on my OpenWRT router - Linux/mips (there is also an yggdrasil package for OpenWRT). |
That would great news actually! |
If we add support for this, I do think we want to at least include logic to treat Yggdrasil's addresses separately for the purpose of group mapping (e.g. like Tor, treat all of Yggdrasil as 1 or a few network groups, rather than using the normal IPv6 logic). We could do that with or without treating it as a separate network:
I have a slight preference for the first approach. |
Right!
Me too. |
Interesting... Concept ACK |
Concept ACK, will review |
PR to bips repo in bitcoin/bips#1238 |
Concept ACK Without this PR,
|
@prayank23 Moving the discussion from bitcoin/bips#1238 (comment) here, because I think it's more a question about Bitcoin Core's implemention. I'm not convinced we should add this either, because of the low maturity of the project. But I think the discussion is a bit more nuanced than just looking at that. The name of this PR is a bit misleading, for starters. This isn't adding support for yggdrasil to Bitcoin Core in the sense of having the project depend on it, or add direct integration (as was the case for tor and i2p, where significant amount of special code were needed to let Bitcoin Core interact with the specific routing software for those networks). What it does add is a small amount of code to make Bitcoin Core's network stack aware of the fact that a particular subrange of the IPv6 space corresponds to Yggdrasil, and should be treated slightly differently. Interacting with the Yggdrasil network is done independently, by the user installing an Yggdrasil router, which integrates in the OS, and transparently routes yggdrasil-compliant IP addresses over the Yggdrasil network - and this happens (and can be used) whether or not Bitcoin Core has specific support for it. The advantages are:
The disadvantages are:
I think both of the disadvantages are actually tiny. The amount of code being added here is similar to what is needed for cjdns; just making the network stack aware of the existence of this separate range. Connectivity issues could be problem in case someone is exclusively connecting through yggdrasil, but I don't think anyone is arguing for that (or should; just like you shouldn't exclusively use automatic tor or i2p connections). If yggdrasil goes down (either due to a network-wide failure, or incompatible upgrades, or individual routers crashing)... bitcoin core will make new connections; interrupted connections are nothing special. Given that Bitcoin Core is in no way directly talking to the yggdrasil router, I'm not worried about it causing bugs/crashes in Bitcoin Core itself. |
@sipa That makes sense. Thanks for explaining everything in detail. I retract my NACK and have no opinion on this pull request. Will follow the progress, research more about yggdrasil and do tests though. |
Hey everyone, I would not recommend adding Yggdrasil support, not on the basis of principle, but on the basis of the nature of the project itself, let me explain. Yggdrasil is largely an experimental academic protocol/software, aimed to research routing at scale, the intention (of its author @Arceliar) is to - eventually - wrap it up, place a v1 on it, and write a paper, but there is sofar no intention to keep up support after that. In the mean time, there is also no guarantees of minor version incompatibility, so this could be quite unstable to use. Instead, i would like to direct everyone's attention to a spin-off project, pinecone, made with the same current routing methods, but intended to be supported for a long time. Pinecone also doesn't work via ipv6 addresses, but full public key hashes, and is intended to be embeddable. However, as Bitcoin is a large project on the internet with many eyes on it, i would heavily recommend getting into dialogue with Pinecone's developers before proceeding with adding support. TL;DR: Yggdrasil is experimental and academic, while a project derivative of it, Pinecone, is aiming to be actively developed in the future. There are some caveats to my recommendation, the first one is the idea that yggdrasil wont be developed anymore after the paper has been written and published, that's an assumption, if anyone else (or bitcoin) could maybe like to pick up development after it's hit v1, then obviously this could be a good addition, but it depends on what it's authors think of the future, so i recommend conversing about that before adding this. Most of my knowledge here comes from talking with the actual Yggdrasil devs, if anyone would like to ask for themselves, they can do so via the matrix room. (also listed on the site) |
Can you please comment on that? @neilalexander @Arceliar |
@prusnak please also read my disclaimer at the bottom, it's the intention i got from the authors while talking to them (especially @Arceliar), my point being that yggdrasil is more an academic project than a continuous software one. @neilalexander works on yggdrasil on the latter basis, but has split off efforts into Pinecone, primarily inspired by Yggdrasil. |
🐙 This pull request conflicts with the target branch and needs rebase. Want to unsubscribe from rebase notifications on this pull request? Just convert this pull request to a "draft". |
i've had a full node reachable via yggdrasil for about a year ( |
I agree with the above comment. Also I am closing this PR, but anyone feel free to take it as a base to for another PR which adds overlay networks in more generic way. |
The blocking aspect here was a BIP or BIP update to allocate a BIP155 network number, to make sure there is no conflict with other networks trying to use the same number; apart from that I'd expect it to not be particularly hard to review here. I'm not sure about a single network id for all overlay networks. That's already not the case for CJDNS, and wasn't the case for IPv4 and TorV2 before (which were specially-mapped subranges of IPv6 pre-BIP155). Having separate network ids for every network also means nodes can have visibility into what they're able to connect to. Having a variety of overlay networks means all overlay-enabled nodes will be relied upon to relay all overlay IP addresses, but depending on the selection of actual networks supported by them, most such connections would fail. Network ids are cheap (there are 256), I don't think we need to worry about allocating them conservatively. |
While networks ids are cheap, getting them allocated is quite hard: see bitcoin/bips#1238 |
that is indeed the issue at hand. hence why suggesting a new network id as a catchall for "overlay network" with a peer address containing a mapping of "overlay-name" to "reachable-range/reachable-gtld" |
I also found CJDNS to be easy to install on macOS (M1 Ventura in my testing) with |
cjdns has horrible build system - you need Python 3.9 (not 3.10 or newer), Rust and NodeJS just to compile something which is mostly a C99 code 🤮 It's notoriously hard to get it working on new platforms. Huge congrats to the person who got it working on M1. I spent at least 20 hours and failed. |
Heavily inspired by #23077 + #23324 + #23175 which add CJDNS support
Yggdrasil overview
Yggdrasil is an implementation of a new name-independent routing scheme and functions as an end-to-end encrypted IPv6 network. It shares very similar goals to CJDNS. It uses an address range of
0200::/8
(as opposed tofc00::/8
used by CJDNS).Motivation
Despite Yggdrasil is being considered an alpha quality software, it seems to be much more maintained than CJDNS.
CJDNS contributions chart:
Yggdrasil contributions chart:
It is also much easier to get it Yggdrasil working on variety of systems and architectures (macOS, Windows, Android, ARM64, MIPS) because it is written in pure Go, while it is hard to get CJDNS working on anything else than x86_64 Linux.
Yggdrasil resources