-
Notifications
You must be signed in to change notification settings - Fork 60
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
Using multihash for digests #45
Comments
Do you already have implementation that uses |
Hi @AkihiroSuda, in my proof of concept that transfers layers over IPFS we continue to use
In IPCS we continue to use OCI descriptors: https://github.com/hinshun/ipcs/blob/master/converter.go#L45-L48 However the digest isn't referring to the layer digest, but rather the wrapper object (known as IPLD) around the layer. The reason why its needed its because in IPFS, large objects needs to chunked into a DAG. The wrapper objects are the overhead of storing the structure of the DAG as well as the digest of each chunk. |
@thaJeztah Yes, I think we'll need to find another approach after Perhaps the best way to implement this is just as annotations. |
Ah, thanks; though I'd ping you just in case there was a blocker for the release 👍 |
The example referenced in the spec is just an example of an unregistered algorithm. Typically, the first part is the algorithm and the second part is some modifier describing the details of the encoding. There's no reason we couldn't store a multihash in a go-digest string. The only constraint is that the encoding has to be URL safe (https://github.com/opencontainers/go-digest/blob/master/digest.go#L63). Seems like One thing to consider here: it is not necessarily better to support a whole slew of algorithms, since it makes sets of content mutually incompatible without more intelligent backend support. Ideally, you choose one algorithm that is "canonical" then have conversions to/from that main one. Annotations, as you mentioned earlier, might be sufficient for packing images that were built by docker then pushed into the ipcs context. One other thing we might consider: the use of |
Yeah, I think the spec doesn't need to be changed. The existing implementation of
If we're going this route,
Good point. The IPFS team actually is moving away from storing content using |
The descriptors spec mentions
multihash+base58
as an example of analgorithm
that is not registered. I'm interested to use multihashes inapplication/vnd.oci.image.manifest.v1+json
, and to pull tags by multihash digest from distribution.Multihashes encode the algorithm in the digest, so
multihash+base58
itself isn't sufficient to generate digests (FromReader
,FromBytes
,FromString
) or to return the size of the hash. Perhapsmultihash+base58:encoded
are transformed to its respectivealgorithm:encoded
for validation / verifying purposes.I'm curious to hear thoughts about supporting multihash (in or out of package) in a way that projects like containerd and distribution can consume them.
The text was updated successfully, but these errors were encountered: