Skip to content
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

"ipfs dag get" does not have CBOR output; hence data roundtrip is not guaranteed as JSON mangles data stored by application #6239

Closed
AndreaCensi opened this issue Apr 20, 2019 · 2 comments
Labels
kind/bug A bug in existing code (including security flaws)

Comments

@AndreaCensi
Copy link

Version information:

go-ipfs version: 0.4.17-
Repo version: 7
System version: amd64/darwin
Golang version: go1.10.3

Type:

enhancement / bug

Description:

It seems that at this time there is no way to retrieve a dag in CBOR format.

Source: https://gowalker.org/github.com/ipfs/go-ipfs/core/commands/dag

dag put allows the input to be CBOR

dag get does not have the option to have the output in CBOR.

This feature is important because, as previously concluded elsewhere (ipld/ipld#65), JSON is not a robust format for data transfer, so applications that want to preserve data integrity should use CBOR.

This counts as a bug if we want it to be true that "an application can put a CBOR file, get a hash, and retrieve exactly the same file with that hash".

@AndreaCensi AndreaCensi changed the title dag get does not have CBOR output; hence data roundtrip is not guaranteed as JSON mangles data stored by application "ipfs dag get" does not have CBOR output; hence data roundtrip is not guaranteed as JSON mangles data stored by application Apr 20, 2019
@Stebalien
Copy link
Member

Unfortunately, this is an annoying limitation of the dag API because it tries to convert formats. Personally, I recommend using the ipfs block API for this reason.

@Stebalien Stebalien added the kind/bug A bug in existing code (including security flaws) label Apr 23, 2019
@Stebalien
Copy link
Member

(closing as a duplicate of #4313)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws)
Projects
None yet
Development

No branches or pull requests

2 participants