3 ms·
This patch makes curl utilize a gateway for ipfs:// addresses. It prefers a local one but can also use public gateways. It makes no effort to verify that the fi
by coppsilgold 3y ago
This patch makes curl utilize a gateway for ipfs:// addresses. It prefers a local one but can also use public gateways. It makes no effort to verify that the final product's cryptographic hash corresponds to the one in the address.
This lack of verification is expected with HTTP, but not with IPFS. curl should verify that the resultant output conforms with the IPFS address or else just have users input the gateway/ipfs HTTP address as you always could.
curl can operate in a pipe mode and that adds additional complexity in respect to verification.
IPFS gateways can serve you in a manner that allows continuous(?) verification: <https://docs.ipfs.tech/reference/http/gateway/#trusted-vs-trustless https://docs.ipfs.tech/reference/http/gateway/#trusted-vs-tr...>
This would in theory allow curl to block the pipe until it is able to confirm that a piece that arrived is verified or abort a tampered-with file early. This would take quite a bit of work to implement however - since it seems like there is no maintained IPFS implementation in C: <https://docs.ipfs.tech/concepts/ipfs-implementations https://docs.ipfs.tech/concepts/ipfs-implementations>
- hardwaresofton 3y agoThis sounds like an excellent issue/feature request to file…
- runeks 3y agoQuestion: is the in-URL hash some form of Merkle tree root hash? Or is another method used to avoid having to download all the data before the hash can be verified? Searching for “Merkle” on https://ipld.io/specs/transport/car/carv2/ https://ipld.io/specs/transport/car/carv2/ gives no results.
- kimburgess 3y agoSimilar. It’s a Merkle DAG. There’s an intro to IPFS content identifiers here: https://docs.ipfs.tech/concepts/content-addressing/ https://docs.ipfs.tech/concepts/content-addressing/.
- runeks 3y agoThanks! Why a DAG rather than a tree, though? I can't seem to find an explanation for why a DAG is needed — I would think a tree should suffice.
- cutemonster 3y agoIt's content addressable: the same file can be linked to, from many places. So then it can't be a tree (But I'm new to IPFS) From https://ipfs.tech https://ipfs.tech: > the innovation of content addressing: store, retrieve, and locate data based on the fingerprint of its actual content