ipld / specs

Content-addressed, authenticated, immutable data structures
Other
592 stars 108 forks source link

car: hack for no root CID? #255

Closed rvagg closed 3 years ago

rvagg commented 4 years ago

We have 3 options here:

  1. Tell users that you can't make a CARv1 without a proper CID and let them figure out what to do
  2. Document one potential hack for use-cases where a root CID is difficult or impossible (streaming data where you don't know roots up-front)
  3. Fix go-car to accept zero roots but leave the caveat in this document that there may be use-cases in the wild where the assumption of >1 root is in-built.

I've done option 2 here, but it really just puts you in the position of having to accept another trade-off in that there may be applications using CAR files that assume the CID makes sense so this could break something else! So I'm now wondering if it'd just be easier and more sensible to wind back go-car's limitation to allow an empty root array.

Thoughts?