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
Handle Both Types Of Onion Service Address #65
Comments
Additional context:
|
I also have a lib. It includes some helpers that can convert keys to onion service IDs (and back for v3). Not sure it's useful to this project though. Both keys are base32'd...v2 keys are 16 chars (first 10 bytes of sha1'd rsa 1024 pub key) and v3 keys are 56 chars (32 byte ed25519 pub key + two bytes of sha3-256'd checksum + single version byte for total of 35 bytes). |
Also, when calling listen with an onion address, it should be ok to not provide the onion service ID and it should be ok to not provide the port (or port 0 to be compatible w/ net.Listen). Asking Tor to create the key pair and/or choose the port is a very normal thing. So Having said the above and noticing that you can listen on a random ID and port, |
We should probably make these separate multiaddr schemes, e.g. |
Adding the help wanted label here -- this is relatively easy to do, just duplicate some of the existing I don't think we should rename |
I'm working on doing this as part of some work for a company, and I think I have it, but can someone explain to me how the protocol argument sizes work? I'm seeing ipv4 has 32 bits, and the protocol in libp2p has 32 bits. ipv6 has 128 bits, and the protocol in libp2p has 128 bits. But onionv2 has 80 bits, and the protocol has 96 bits? I am sure I must be missing something important here. |
Ah. So, it looks like onion addresses in go-ipfs include a port. That's where the extra two bytes come from (big endian port number appended to the address). With TCP/IP, we have two components |
Potential reason we have an explicit onion-port: Onion Service (private key) can expose multiple ports. |
Could also be because, at least when specified at listen/bind time, the local port for a TCP listener can be different than the exposed port for the onion service. |
Thanks for your help, I've got a better handle on how it works now. I'm going to re-read the contributing documents and send up my changes. |
@eyedeekay has fixed this. |
Base36 byte-encoding specification
Right now it appears
/onion
is a fixed size which likely relates to Tor v2 onion service addresses. However, there is a longer v3 onion service address that is supported. Please either make a new protocol name for v3 or remove the size restriction on/onion
.The text was updated successfully, but these errors were encountered: