multiformats / multiaddr

Composable and future-proof network addresses
https://multiformats.io/multiaddr
MIT License
424 stars 84 forks source link

Where is `/ipns`? #136

Open ben221199 opened 2 years ago

ben221199 commented 2 years ago

I see that /ipfs is replaced in favour of /p2p in some way, but what about /ipns? It is different from /ipfs by the fact that it doesn't describe a file by its hash, but by something else that is encoded by some private key.

Is there some plan to merge everything under the same multiaddr? It seems that https://docs.ipfs.tech/concepts/ipns/#example-ipns-setup-with-cli is still using /ipns.

mxinden commented 2 years ago

Maybe @Stebalien or @lidel can help here?

Stebalien commented 2 years ago

multiaddrs are currently for addressing machines, not content. IPNS is currently (primarily) used for addressing content.

I'd like to merge these all into a single multipath system (https://github.com/multiformats/multiformats/pull/55) but there hasn't been sufficient motivation to move that forward.

ben221199 commented 2 years ago

I always thought that /ipfs and /ipns where multiaddrs.

image

I will take a look https://github.com/multiformats/multiformats/pull/55. Now that they have moved /ipfs to /p2p, it maybe gives the possibility to reserve /ipfs and /ipns for a new purpose.

ben221199 commented 2 years ago

@Stebalien Why not already reserve ipfs and ipns it in the codec table?

ben221199 commented 2 years ago

https://github.com/multiformats/multicodec/pull/282

Stebalien commented 2 years ago

See my comment. We already have these registered as path namespaces. We just don't have a unified path spec.

ben221199 commented 2 years ago

/ipfs-ns and /ipns-ns? 🤔

ben221199 commented 2 years ago

Isn't that ugly?

Stebalien commented 2 years ago

Ah, no. Those are just the registered names. But we should probably rename: https://github.com/multiformats/multicodec/pull/283

ben221199 commented 2 years ago

Okay, and what value have ipld and swarm added upon ipfs and ipns?

Stebalien commented 2 years ago

Different datastructures and pathing schemes:

  1. /ipfs means: interpret the following as IPFS.
  2. /ipld means: interpret the following as raw IPLD.
  3. /swarm means: interpret the following as a swarm file (not really related to IPFS at all).
aschmahmann commented 2 years ago

/ipld means: interpret the following as raw IPLD.

This seems plausible, but also I'd be careful with this one. IIUC it hasn't really been spec'd and has evolved a bit over time (e.g. IIRC within kubo it used to follow special pathing semantics for dag-pb and no longer does). I wouldn't be surprised if we wanted to (re)define what this means as part of https://github.com/ipfs/specs/pull/293.

cc @rangermauve

RangerMauve commented 2 years ago

Just to throw another wrench in the machine, there's the ipnslink spec which acts kinda like having /ipns being used in a multiaddr sense to look up an HTTP server. 😅

IMO it makes sense to separate /ipfs, /ipns, /ipld to content addressing and to leave /ip4 and the such as regular addresses. Content addressing usually gets treated more like a URL than a file path and in practice there's stuff like querystrings that are needed and stuff like matrix params for IPLD.