ipfs / go-cid

Content ID v1 implemented in go
MIT License
156 stars 47 forks source link

protobuf vs dag-pb #75

Closed alanshaw closed 6 months ago

alanshaw commented 6 years ago

The name for 0x70 here is "protobuf": https://github.com/ipfs/go-cid/blob/6e296c5c49ad84dc6a44af69fa1fe4e1245cd0cf/cid.go#L88

In the multicodec table the name for 0x70 is defined as "dag-pb": https://github.com/multiformats/multicodec/blob/master/table.csv#L408

"protobuf" exists in the table but is mapped to 0x50: https://github.com/multiformats/multicodec/blob/master/table.csv#L30

This is creating an interop issue with /api/v0/block/put?format=dag-pb - it's not understood by go-ipfs.

Can this be fixed?

Stebalien commented 6 years ago

It doesn't look like these names map to that table. Other issues:

  1. "v0" is dag-pb with v0 CIDs (I think?)
  2. cbor should be dag-cbor.

We'll probably need to add aliases (like we do with "v0" and "protobuf").

lidel commented 6 months ago

I believe this was handled in https://github.com/ipfs/go-cid/pull/137 and https://github.com/ipfs/go-cid/releases/tag/v0.2.0