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

Cidv1 support for libp2p-key #31

Merged
merged 2 commits into from
Jan 24, 2024
Merged

Cidv1 support for libp2p-key #31

merged 2 commits into from
Jan 24, 2024

Conversation

Arlodotexe
Copy link
Collaborator

Background

Since this code was written in 2019, the ipfs ecosystem has moved to using base36 Cidv1 as the default for the libp2p-key multihashes used for public peer ids and ipns public keys (see RFC0001).

Changes

Brings us up to speed with the latest defaults in Kubo's Key API.

  • Support for Multicodec libp2p-key (0x72) was added.
  • Support for Base36 was added, as it's the default used in Kubo's Key API. This was ported from the go-base36 used by Boxo and Kubo.
  • IKey.Id is now a Cid instead of a MultiHash, allowing support for both Cidv0 and Cidv1. Using MultiHash here would force dropping essential Cidv1 information, and only supports implicitly base58btc encoded Cidv0.

@Arlodotexe Arlodotexe self-assigned this Jan 24, 2024
@Arlodotexe Arlodotexe merged commit 39c4487 into main Jan 24, 2024
1 check passed
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

Successfully merging this pull request may close these issues.

1 participant