IPLD: precisions about canonical format #63
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.
Child of PR #37
Add precisions about the canonical format.
There was another solutions discussed: put a
@codec
key within the IPLD object when converting for instance a protocol buffer to JSON representation. There are problematic consequences:@codec
key set to a format we know, we must decode and re-encode to this format to be sure that the hash is correct. Can be done.@codec
key: we could document it as a limitation of the IPLD model@codec
key set to something we don't know.It would be possible to escape the
@codec
key but:@codec
key containing the codec removed, and the\@codec
escaped key in its unescaped form, it will be impossible to put the file back in the system because we loose the codec information.It's best for application authors to deal with the multicodec header, or only deal with CBOR formatted objects and not with legacy protocol buffer objects.