-
Notifications
You must be signed in to change notification settings - Fork 108
Spec refining: Multiple links in the link object #5
Comments
I don't think this should be added to the spec as it increases complexity without actually giving much more benefit. If you want to provide multiple links, e.g. in different hashes you can do that one level higher like this: {
"name": [
{"/": "SHA2-Hash/test"},
{"/": "SHA3-Hash/test"}
]
} and handle it in userland |
That works if the resolution is in userland, however this would turn into /name/0 and /name/1. I personally don't see it adding too much complexity: (1) the check for a link is just looking at a tag and the choice of the pointer in the list is just a matter of re-ordering and picking one, (2) if hash functions do break, (2) links are not broken. However, this can add complexity if there are cases for which developers need to read the link object - in that case they cannot assume that it is a string, but if could be an array. |
We might be able cope with the complexity, but we will not be able to cope with the uncertainty that the two links might be totally different, which gives much less guarantees to the user. In addition, if sha2 is actually broken the links are not immediately broken, they are just vulnerable to attacks. But this vulnerability does not go away if you have multiple links as it will still be the first one and might resolve to the content of the attacker. |
Great to point out that links are actually not broken, they will still resolve - if you have multiple links, if sha2 breaks and it is known to be broken, your parser will just not resolve sha2 but fallback on sha3. (if it is not known to be broken - you are in troubles) |
The only way to make this work the way you want it to is to force the tool to resolve all objects and verify all paths are exactly the same. Note that this is hard because i could do:
So i would have to resolve both and make sure it's the exact same datastruct. This seems impossible in some cases, actually. Maybe a further restriction is to enforce the paths must be the same and only the hash can be different:
therefore can verify the object simply.
|
What if this were built into the multihash spec? That is, given However, IMO, the overhead just isn't worth it... |
( @Stebalien that's a good idea, and achievable with a multihash function code too -- the multimultihash function? hahaha). but yeah dont think it's that useful. |
Just to repeat my comment from the meeting here, hashes (and crypto in general) usually don't break all at once so we'll have time to migrate. Also, due to the structured nature of IPLD, this can be done programmatically. It would make it harder to compare object equality but, IMO, that's an inherent issue in transitioning from one hash to another. |
@Stebalien are you then advocating for having
and give no guarantee about the two hashes being equal? |
No! I'm advocating for never linking with two hashes in the same object. When migrating to a new hash algorithm, just convert all known objects to the new hash algorithm all at once (as much as possible at least). If you're worried about breaking links (and don't just want to keep the old objects around) the IPFS datastore can store two merkeldags (one for each hash algorithm) behind the scenes (but it doesn't have to store the actual data twice). Again, hashes don't usually break overnight. There will likely be a period where the old hash algorithm is slightly broken and not recommended but still secure enough to trust long enough to transition to a new algorithm. |
The problem you are describing is transitioning after the breakage. I think we have all agreed that this should be handled in user-space (or at least to do some research if this is what the user is fine with) |
My point is that this just isn't worth designing for at the spec level. Basically, there are three cases:
This proposal only applies to case 2 which, personally, I find a highly unlikely case. So, given that:
We might as well just assume that we'll eventually have to transition from one hash function to another and deal with it when we get to it. Basically, this proposal doesn't fix the problem, it just postpones it. |
🎉 Perfect, we are all on the same page to not support multiple links |
+1 (Someone will complain about this eventually, so let's make sure to have a
|
Closing due to staleness as per team agreement to clean up the issue tracker a bit (ipld/team-mgmt#28). This doesn't mean this issue is off the table entirely, it's just not on the current active stack but may be revisited in the near future. If you feel there is something pertinent here, please speak up, reopen, or open a new issue. [/boilerplate] |
In my original design I had the possibility to have a set pointers that can be used in the link object.
The reason for this is for example: link using multiple hash functions (in case one breaks)
Pro:
Cons:
cc @dignifiedquire, @mildred, @Stebalien
The text was updated successfully, but these errors were encountered: