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

define a string representation for unparsable multiaddresses #155

Open
marten-seemann opened this issue Apr 18, 2023 · 2 comments
Open

define a string representation for unparsable multiaddresses #155

marten-seemann opened this issue Apr 18, 2023 · 2 comments

Comments

@marten-seemann
Copy link
Contributor

When introducing and rolling out new types, we might encounter multiaddresses that we don't understand yet. We should define a string representation so people can pass them around in JSON (for example).

One option would be to use multibase (and assuming you're using a multibase that your peer understands):

/unparsable/<multibase encoded bytes>
@MarcoPolo
Copy link
Contributor

We should probably specify that we should only serialize to a small set of multibases (e.g. only base32). Otherwise, we'll have the same problem here where I can serialize it using baseN and someone else trying to parse that string may not know baseN.

As long as producers (serializers) are strict in what they emit and consumers (deserializers/parsers) are lax (accept any known multibase) we can upgrade the small set of supported multibases. Although, my initial guess is that we probably will not expand the initial set for a while.

@aschmahmann
Copy link

aschmahmann commented May 4, 2023

a small set of multibases

There's some prior art for doing this in multiaddrs with certhashes and with libp2p peerIDs https://github.com/libp2p/specs/blob/5393c21c4f9038f2ad1cbeac3edf3d0d2c540f39/webrtc/webrtc-direct.md?plain=1#L37-L41 and https://github.com/libp2p/specs/blob/6b3d2630bb495a7a76d9d615b51212d56039c3ea/peer-ids/peer-ids.md?plain=1#L218-L221.

No particularly strong opinions on which ones should be in the MUST or SHOULD set, although I'd certainly consider using ones already in use by other multiaddr components.

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