Add base36 support, libp2p-key codec #28
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
This PR closes #26 and brings us up to speed with the latest defaults in Kubo's Key API.
libp2p-key
(0x72) was addedgo-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.