-
Notifications
You must be signed in to change notification settings - Fork 147
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
Draft: IPLD Timestamp Proof #168
Draft: IPLD Timestamp Proof #168
Conversation
surely there's a codec for filecoin? should i ask CASA's fil rep or in the filecoin open slack? |
i also wonder if there's a link worth adding to the references section at the end pointing to info on how FVM means filecoin nodes can connect to a testnet/quorum/etc "out of the box"... |
@bumblefudge why is filecoin's codec and FVM relevant in particular here? This is a general way of representing a timestamp from any blockchain. |
Neither required nor especially relevant, just wondering if a third example would be nice. Since some ipfs gateways are also fil nodes, might be an appealing option for some users since it's one-stop shopping in that case! |
I'm not familiar enough with Filecoin to say how easy it would be to add an example from there. |
CAIPs/caip-ipld_anchor_event.md
Outdated
|
||
A Merkle proof allows verification that a given piece of data or “leaf” was included in the set of data for the given Merkle Tree. A typical proof includes a Merkle root of the tree and a subset list of tree node hashes that allow verification by reconstructing the Merkle root starting from the data or "leaf" you are interested in. | ||
|
||
In IPLD a Merkle root (CID) and a “path” are provided that allows you to traverse the tree from the root to the piece of data your interested in. Paths are strings and refer to [Pathing in IPLD](https://ipld.io/docs/data-model/pathing/). Following an IPLD path, and ultimately resolving the data or "leaf" you are interested in from the root, is equivalent to a standard proof. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is equivalent to a standard proof
Yeah, if you're willing to deal with the resolution of the intermediates. The approach of just providing a root and a path is fine if you expect the verifier to navigate through the data but the simple form of a Merkle proof provides the intermediate dependent hashes all the way up to the root so you can reconstruct it from just the data you have. You could do that here if you're just going to build a standard Merkle tree where intermediates are tuples of hashes (as you've suggested above) by providing the paired CIDs that couple with the derived CIDs of the leaf you want to prove - so leaf + CIDs of all non-relevant branches on the way up to the root. Then you can reencode those intermediates from the leaf you have and couple it with the provided CIDs to the original Merkle root which, if it matches is the "proof".
But that's not the approach being taken here, which is fine but assumes the availability and navigability of all intermediates. Is that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah roughly but the intention is to not assume anything about the network (ie just IPLD, not IPFS), this just describing the data structure in IPLD and in IPLD a natural way to verify is just to traverse the path. The data could already be local, over another network, or an implementation may not rely on any intermediaries by packing the entire proof and path subset of the tree (all necessary ipld blocks) in a CAR file if they choose. Probably makes sense to change wording a bit (ie resolving) and maybe add a note. thanks for commenting
I like this proposal, it is simple and directly addresses a common need. I think that it may be preferable to define additional multicodec values for different type of blocks even within a chain, i.e. a codec for |
@chunningham Why would using strings be prone to errors? These strings needs to be registered within the Chain namespace for this CAIP. So each string would map to a description of how to interpret it. |
For example, I'm planning to register |
If there's a registry then that's fine, I was kind of thinking that the role of discriminant would be duplicated here between codec and string, but I suppose that the string is more an indicator of which links in the block actually point to/include the root of the merkle tree than of the structure of the block? By 'errors' I meant blocks with e.g. codec is |
Todo before merge as
|
NB @benediktwoelk as per our convo last night |
Minor edits made, references to namespace, txType added, and eip155 namespace PR opened - ChainAgnostic/namespaces#42 cc @bumblefudge |
Also an implementation of validation of this CAIP can be seen here: Should address all of your points above @bumblefudge :) |
Signed-off-by: bumblefudge <[email protected]>
Hey guys! Sorry for the delay, I did an editorial pass on both CAIP and Namespaces/eip155/CAIP168. I had to open new PRs against Ceramic's fork, so if you merge those two there I'll merge this PR here and we're GTG Also note: if there's working code that works against this final version of the spec, we can skip draft and go straight to |
editorial pass
editorial pass merged |
oh sorry I didn't link this one, also needed: ceramicnetwork/namespaces#1 |
thanks, merged the namespace pass as well now |
Create and verify IPLD based blockchain timestamp proofs.