-
Notifications
You must be signed in to change notification settings - Fork 3
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
DIP-273 Content Addressing #280
Conversation
bbce502
to
9332b55
Compare
* Update the definition of DSNP Content Hash to include DSNP CIDs * Change ProfileResource to use bytes, not string, for cid field, in line with Announcement usage * Update Activity Content Hash extension to include CID option * Update various example hashes to use CIDv1 * Update to pre-1.3.0 versioning and sync prerelease changelogs
9332b55
to
c571222
Compare
pages/DSNP/Identifiers.md
Outdated
@@ -69,9 +70,9 @@ In order for DSNP applications to interoperate, the required functionality is li | |||
|
|||
- CID version: MUST be version 1, in order to distinguish CIDs from simple multihash values in situations where either may be used | |||
- Hash algorithm: MUST be `sha2-256` or `blake2b-256` | |||
- Encoding: MUST be `base58btc` or `base32` | |||
- Codec: MUST be `dag-pb` for data 256*1024 bytes or longer; `raw` for data less than 256*1024 bytes |
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.
Adding backslash before *
helps markdown to disambiguate:
- Codec: MUST be
dag-pb
for data 256*1024 bytes or longer;raw
for data less than 256*1024 bytes
…ported types only. Announcements have been updated to use strings for contentHash and targetContentHash fields.
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.
Everything looks good with the exception of some of the example hashes.
|
||
```json | ||
{ | ||
"hash": [ | ||
"QmQNHNfHnbgJJ6nK4UPx2VtTUCafAKCbqZJ6ZRYUGjoeFj", | ||
"2DrjgbGgSsXRhTiBWckoVwBFC6H4qiBWWNumSsRwdUt82YnTdN" | ||
"bciqgb7tvyyqn6tw4amtdj7funn5ockup6ldrkap4o5ubd77od6awi4y", |
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.
I'm getting a different value for the hash of the dsnp_whitepaper than this is giving me.
- Perhaps it is the older version of the whitepaper the hash is of?
- Different hash setup that is reading the file differently than I did?
- I tried
sha256sum
on mac and a random online hasher.
- I tried
The digest I expected from hashing the file was 0x36d37cf984565f2151ccea050e0bcecf44801b4c89971654c7308dc2338ce7ea
However the digest from this multihash appears to be 0x60fe75c620df4edc032634fcb46b7ae12a8ff2c71501fc776811ffee1f816473
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.
Yep, my mistake. Will fix.
"QmQNHNfHnbgJJ6nK4UPx2VtTUCafAKCbqZJ6ZRYUGjoeFj", | ||
"2DrjgbGgSsXRhTiBWckoVwBFC6H4qiBWWNumSsRwdUt82YnTdN" | ||
"bciqgb7tvyyqn6tw4amtdj7funn5ockup6ldrkap4o5ubd77od6awi4y", | ||
"bdyqdua4t4pxgy37mdmjyqv3dejp5betyqsznimpneyujsur23yubzna" |
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.
Same for this one, so I think it might just be we are using different files.
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.
Looks good to me!
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.
Read through the referenced Issue thread, read through the changes, looks ok by me.
| emoji | `BYTE_ARRAY` | `STRING` | `UTF8` | | ||
| fromId | `INT64` | `INT(64, false)` | `UINT_64` | | ||
| inReplyTo | `BYTE_ARRAY` | `STRING` | `UTF8` | | ||
| targetContentHash | `BYTE_ARRAY` | `STRING` | `UTF8` | |
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.
Note: Confirming on gateway side this is already updated
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.
Re-approved
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.
This time for sure
Problem
DSNP should provide affordances for finding content that do not rely on a single DNS-based point of failure for content hosting.
More in the original discussion: #273
Solution
Enhance the specification to treat URLs in Announcements as suggestions rather than canonical locations for content.
Provide a simple and well-specified set of hashes and encodings that can be used consistently throughout the protocol.
Use IPFS CIDv1 specifically for locating profiles.
Change summary:
contentAddress
fieldcontentHash
andtargetContentHash
fields.