CommP CID generation (official & correct!) #1
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.
/cc @hannahhoward @pfac
multicodec table now has new entries for Filecoin, wrapup @ multiformats/multicodec#161 (comment) so the older CommP->CID generation methods should probably be removed (or at least updated) as they are not generating using official codes.
multiformats/go-multihash now has
SHA2_256_TRUNC254_PADDED
@ multiformats/go-multihash#128, although this is not yet released, so you need to grab the HEAD.ipfs/go-cid has a pending PR for the two codecs, including
FilecoinCommitmentUnsealed
@ ipfs/go-cid#104, so a fork and redirect is needed for now.In practice, given a commp
faeba569cafd5c144328f8dbb1873c6c0da4ce3a2136a8e2e9b1966bcaa68f0e
:Then verify:
So we can extract the original commp, the codec for
fil-commitment-unsealed
:0xf101
and the multihash forsha2-256-trunc254-padded
:0x1012
.