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

PeerID Encoding/Decoding is inconsistent with specs #975

Closed
aschmahmann opened this issue Jul 2, 2020 · 5 comments
Closed

PeerID Encoding/Decoding is inconsistent with specs #975

aschmahmann opened this issue Jul 2, 2020 · 5 comments
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@aschmahmann
Copy link
Collaborator

The PeerID text spec https://github.com/libp2p/specs/blob/master/RFC/0001-text-peerid-cid.md, makes no reference to allowing us to decode identity multihashes as PeerIDs and yet we do here.

Similarly, the Encode(peerID) function in go-libp2p-core is also not spec compliant since it just encodes every peerID as base58 instead of returning it as a CID (e.g. identity multihashes are returned as base58 encoded)

Is the bug in the spec or code? Are we able to keep the spec as is at this point, or do we have to change it to accommodate people already using the non-spec compliant code?

^ @Stebalien @raulk @lidel

@aschmahmann aschmahmann added the kind/bug A bug in existing code (including security flaws) label Jul 2, 2020
@Stebalien
Copy link
Member

Stebalien commented Jul 2, 2020 via email

@aschmahmann
Copy link
Collaborator Author

Ah ok. So that means we just have a bug in Encode then right?

@Stebalien
Copy link
Member

No? Encode encodes in the legacy format for now.

@aschmahmann
Copy link
Collaborator Author

You're right it is consistent with the specs as it encodes in the legacy (base58) version. There's a separate issue to be raised here about whether we should upgrade to the newer version.

@aschmahmann
Copy link
Collaborator Author

Separate issue on upgrading is #976

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

2 participants