Skip to content
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

Spec vs Verify CAS file URI #927

Closed
sandrask opened this issue Nov 17, 2020 · 8 comments
Closed

Spec vs Verify CAS file URI #927

sandrask opened this issue Nov 17, 2020 · 8 comments
Assignees
Labels
documentation Update to doc files Spec v1

Comments

@sandrask
Copy link
Collaborator

sandrask commented Nov 17, 2020

Reference application is verifying CAS file URI against protocol hashing algorithm here:

const casFileUriAsHashBuffer = Encoder.decodeAsBuffer(casFileUri);

There are two issues here:

  1. this code would not work against valid v1 IPFS CID: bafkreih6ot2yfqcerzp5l2qupc77it2vdmepfhszitmswnpdtk34m4ura4

https://cid.ipfs.io/#bafkreih6ot2yfqcerzp5l2qupc77it2vdmepfhszitmswnpdtk34m4ura4

  1. reference application is assuming that IPFS CID is created using protocol's multihashing algorithm. Is this a requirement? I couldn't find any reference in the spec related to this. Is this functionality in the reference application necessary?

Also, issue 2) requires changes to write() method in CAS interface to pass multihash algorithm/code.

@sandrask
Copy link
Collaborator Author

@thehenrytsai @csuwildcat I added this issue to the agenda for today - hopefully you get a chance to look at it.

@OR13
Copy link
Contributor

OR13 commented Dec 1, 2020

@OR13
Copy link
Contributor

OR13 commented Dec 1, 2020

see also ipfs/specs#247

@OR13
Copy link
Contributor

OR13 commented Dec 1, 2020

@sandrask
Copy link
Collaborator Author

sandrask commented Dec 2, 2020

During Sidetree weekly it was agreed that reference application will:

  1. support valid v1 IPFS CID (e.g. "bafkreih6ot2yfqcerzp5l2qupc77it2vdmepfhszitmswnpdtk34m4ura4")
  2. make CAS URI validation protocol independent so there is no need to change CAS write() interface to include protocol multihash algorithm (18)

@thehenrytsai @csuwildcat @troyronda

@isaacJChen
Copy link
Contributor

isaacJChen commented Dec 4, 2020

Fixed in implementation. Awaiting documentation to reflect it.
#953

@csuwildcat
Copy link
Member

@sandrask @isaacJChen Sandra, if the spec does not correctly reflect what Isaac modified in code, can you highlight the language that needs to change and do a PR, or specifically cite it here and I will?

@sandrask
Copy link
Collaborator Author

sandrask commented Dec 8, 2020

@csuwildcat Spec and the implementation now match, thank you

@sandrask sandrask closed this as completed Dec 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Update to doc files Spec v1
Projects
None yet
Development

No branches or pull requests

5 participants