Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Possible wrong CID #13

Closed
richardschneider opened this issue Jun 26, 2018 · 6 comments
Closed

Possible wrong CID #13

richardschneider opened this issue Jun 26, 2018 · 6 comments
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@richardschneider
Copy link
Contributor

richardschneider commented Jun 26, 2018

Looking at the code for util.cid I see that the multihash is created from dagNode.header not dagNode like all the other IPLD packages.

This implies that the hash of the serialised block is not the same hash that is generated by util.cid; which BREAKS ipld/interface-ipld-format#32

@vmx any comments?

@vmx
Copy link
Member

vmx commented Jun 26, 2018

That's actually a really good point (BTW: it's the same for Bitcoin). The reason for it is, that we want to have the same hash as Zcash is generating. This violates how IPLD is supposed to work. I need to put more thought into this and play around a bit with some actual data, to see if it really is an issue.

@richardschneider
Copy link
Contributor Author

Are you sure about Bitcoin? My reading of the code says that it is okay.

@vmx
Copy link
Member

vmx commented Jun 26, 2018

@richardschneider You are right, js-ipld-bitcoin does it differently, but I think it's wrong. I really need to dig into this.

Edit: js-ipld_bitcoin also only uses the header: https://github.com/ipld/js-ipld-bitcoin/blob/77354ac7a3464d98db89bf0bc575b85265a36c32/src/util.js#L83

@richardschneider
Copy link
Contributor Author

I think ethereum might have a similar issue.

@vmx
Copy link
Member

vmx commented Jun 27, 2018

Follow up issues for this one are

Ethereum already distinguishes between the different blocks.

Thanks @richardschneider for pointing this out.

@daviddias daviddias added kind/bug A bug in existing code (including security flaws) status/ready Ready to be worked labels Aug 25, 2018
@vmx
Copy link
Member

vmx commented May 8, 2019

@vmx vmx closed this as completed May 8, 2019
@ghost ghost removed the status/ready Ready to be worked label May 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

3 participants