Consider creating our own IPLD format
Problem
Encrypted DAG nodes are not dag-pb/dag-cbor formatted. They may be formatted as such under the hood but you won't be able to do file paths like Qm.../path/to/file.
Solution
We could define our own IPLD format for encrypted folders/files. This would also eliminate the need for a header subdir on every folder (thereby decreasing the # of objects needed to fetch by 2x)
Relevant discussion: https://github.com/ipld/ipld/issues/64
Would it make sense to have a general IPLD encryption format where you take a block + a key and encrypt it, then need the key to decrypt it?
The block itself could then contain dag-pb or dag-cbor or whatever else.
This is a pretty old issue. With the new version of WNFS we don't actually have this issue anymore:
This would also eliminate the need for a header subdir on every folder (thereby decreasing the # of objects needed to fetch by 2x)
We can probably close this?
Would it make sense to have a general IPLD encryption format where you take a block + a key and encrypt it, then need the key to decrypt it?
The block itself could then contain dag-pb or dag-cbor or whatever else.
That's technically what happens in rs-wnfs today. We construct some dag-cbor encoded bytes, then encrypt them, and treat that ciphertext as raw, as you can't follow any further links inside that anyway.
Generalizing IPLD so it supports encryption is interesting and we've thought a little about this, specifically there's a bunch of different ways in which you could essentially take a "cleartext" IPLD graph and encrypt it. These different ways have trade-offs. E.g. some allow you to share parts of the encrypted graph without sharing everything, some don't. Some allow third-party verification of write access via cryptographic accumulators or signatures and some don't. Some allow "editing" parts of the DAG without having to re-encrypt the whole DAG, some don't.
A big question I still have with that is: What is the developer experience for working with this? Is this just building a small library that makes it easy for you to en/decrypt dag-cbor encoded byte strings? Is it a library that allows you to easily move from encrypted DAG <-> decrypted DAG? Or is it just one concrete use case that is something like rs-wnfs which is still very "concrete" in where it applies these patterns.