-
Notifications
You must be signed in to change notification settings - Fork 204
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
Merkle reference multiformat #357
base: master
Are you sure you want to change the base?
Conversation
44163fd
to
bafe3c9
Compare
I like the idea. I don't know the process to have codes accepted here, do we require at least one implementation? |
I have an implementation that currently lives here https://github.com/Gozala/merkle-reference |
See Robin's process doc - Another thing that would help would be if the current spec were formatted as a complete, linter-passing IETF internet-draft (example from a multibase registration in progress) or W3C CG respec doc with test-vectors and all that, rather than an open PR with unresolved comments on the web3.storage IP process repo... not technically a requirement at DRAFT status but maybe one that would help allay concerns of single-byte squatting from the least-generous possible readers 😉 |
Ah I was not aware of the new process, thanks for pointing it out.
Sounds reasonable, yet seems like a double standard when I see Lines 4 to 5 in 352d05a
CIDv2 had being discussed forever and I would be very surprised if there are multiple implementations two production implementations. I have not even heard of CIDv3 probably something new that happened since I fell of the inter planetary space 😅 I won't even mention that most of the codes in that table would fail to meet new criteria. As of second implementation, there is one in development in Rust and I can update the thread here when it's ready.
Most up to date spec lives here https://github.com/Gozala/merkle-reference/blob/main/docs/spec.md. There is also interactive version https://observablehq.com/@gozala/merkle-references that anyone can test with various data sets. Some test fixtures are available here and they'll likely move into more portable form once Rust implementation is there. Trying to reformat it into IETF / W3C spec format is plausible, but as one man show I got to be pragmatic with where I spend time and it seemed a lot more reasonable to budget it after code is in the table as opposed to before. |
I should mention that presence on multicodec table is nice to have mostly for backwards compatibility with IPLD addressing scheme. In practice I don't expect multiformat prefixes to be used beyond bridging with legacy (IPLD) system. |
This PR proposes addition of the code for the merkle-references multiformat, described here. Allocating a code would enable use to format them as IPLD links and seamlessly integrate them into the rest of the IPLD ecosystem.
Format
Merkle reference could be viewed as a hashing algorithm defined for all of the IPLD types (as opposed to just bytes). However, just like with CIDs it may use different underlying hashing algorithms (ℹ️ Although same algorithm across full DAG is implied).
Therefor merkle-reference is proposed as a standalone multiformat with a following format
Integration
There is a nice duality to the merkle-references as they could also be viewed as a lossy IPLD codec where bytes are derived through merkle-folding process (described in the linked spec).
By prefixing merkle-reference with
0x01
varint they can be formatted as valid CIDv1, in which case0x07
code could be treated as IPLD codec.This could be utilized to integrate merkle-reference's into rest of the IPLD ecosystem by formatting them IPLD links.