go-cid icon indicating copy to clipboard operation
go-cid copied to clipboard

protobuf vs dag-pb

Open alanshaw opened this issue 7 years ago • 1 comments

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?

alanshaw avatar Sep 20 '18 13:09 alanshaw

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").

Stebalien avatar Sep 20 '18 15:09 Stebalien

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

lidel avatar Apr 04 '24 21:04 lidel