IPIP-0421: HTTP Delegated Routing Reader Privacy Upgrade

Editors
Andrew Gillis GitHub
Ivan Schasny GitHub
Masih Derkani GitHub
Will Scott GitHub
History
Commit History
Feedback
GitHub ipfs/specs (pull requests, new issue, open issues)

1. Summary

This IPIP introduces a HTTP API designed for Privacy Preserving Delegated Content Routing provider lookups.

2. Motivation

Currently, IPFS's privacy safeguards are notably deficient, particularly regarding the Content Routing subsystem. Neither Readers (clients who access files) nor Writers (hosts that store and distribute content) can maintain significant privacy related to the content they produce or consume. Presently, a Content Router or a Passive Observer can discern the identity of a file requested by a client and the specific client making the request during the routing process. This situation allows potential adversaries to gain knowledge about the requested CID. An interested party could then request the same CID and download the corresponding file to track the user's activities. Addressing these privacy concerns has been a long-standing demand from the community.

Recent enhancements to the IPFS DHT and InterPlanetary Network Indexer (IPNI) have incorporated Double Hashing to improve Reader Privacy. With Double Hashing, Provider Records become encrypted and non-transparent to Content Routers. Given the original CID, a Content Router can decrypt the relevant Provider Records and supply them through the existing Delegated Routing API. To make use of these privacy enhancements, users must modify their interactions with Content Routers by:

Existing APIs cannot support these changes in interaction, necessitating this IPIP as a step to improve the HTTP Delegated Routing API. This proposal adds new endpoints for delivering encrypted content while maintaining the original API for non-privacy-preserving lookups. Writer Privacy, however, is not within the scope of this IPIP and will be handled separately.

3. Detailed design

Please refer to the Delegated Routing Reader Privacy Upgrade specification (http-routing-reader-privacy-v1) included with this IPIP for detailed design information.

4. Design rationale

The proposed API makes two key changes:

  1. It introduces new methods for looking up encrypted Provider Records and encrypted Metadata.
  2. It establishes Hashing and Encryption functions and structures the response payloads.

This proposal does not alter the API's idioms, upholding all data formats, design rationale, and principles established in the original [ipip-0337].

4.1 User benefit

With the proposed APIs, users can protect themselves against malicious actors who might spy on their activities by monitoring their traffic to Content Routers and subsequently downloading identical data. Additionally, this API serves as a first step towards a fully private HTTP Delegated Routing protocol, which would eliminate centralized observers like IPNI routers.

4.2 Compatibility

4.2.1 Backwards Compatibility

Users will need to deliberately activate Reader Privacy on their nodes. A new flag could be introduced into IPFS implementations such as Kubo's HTTP Delegated Content Router configuration to streamline this process. Users on older nodes can continue using the existing API and switch on Reader Privacy later.

Content Routers should maintain the same Quality of Service (QoS) for both Privacy Preserving and regular APIs, as both can be served over the same encrypted data. A shim non-encrypted content router can be implemented to encrypt regular CIDs on the fly, proxy the requests through an encrypted content router and finally decrypt the results before returning them to the user.

It is worth noting that not all Content Routers might adopt Reader Privacy. Default HTTP Delegated Routers like cid.contact should have Reader Privacy enabled by default in the latest versions of IPFS implementations such as Kubo and Helia. Users should confirm if their chosen custom router supports Reader Privacy when setting it up.

The /routing/v1/encrypted/ API will be implemented in existing libraries, such as boxo/routing/http, and will not introduce any breaking changes to existing clear text endpoints. The API will be introduced in a new minor version.

4.2.2 Forward Compatibility

Reader Privacy relies on the use of specific hashing and encryption functions. Altering these functions would require a network-wide migration. Content Routers might not be able to migrate seamlessly, as they do not possess the original values. Such function rotation should occur infrequently and necessitate network-wide efforts. When function rotation is required, the API version will be incremented.

4.3 Security

For details on security, please see the "Threat Modelling" section of http-routing-reader-privacy-v1.

4.4 Alternatives

When considering alternatives to this IPIP, two potential scenarios and their corresponding technologies are worth exploring:

  1. Oblivious HTTP (OHTTP)
  2. Onion Services

In scenario (1), /routing/v1 would be implemented behind Oblivious HTTP (OHTTP), a protocol proposed by IETF and Cloudflare. OHTTP separates the information about 'who' is making a request from 'what' they are requesting, thereby preventing routing systems such as IPNI instances from viewing both pieces of information concurrently. This would add an additional layer of privacy by obscuring metadata, such as user behavior patterns, IP addresses, and user-agents.

Scenario (2) envisages the /routing/v1 behind Onion Services. Onion Services provide another approach to concealing the origin of requests by routing them through the Tor network, further enhancing user privacy.

These two scenarios and their corresponding technologies aren't mutually exclusive to this IPIP. Instead, they could be viewed as complementary solutions that could be deployed in conjunction with Double Hashed records, as proposed in this IPIP, to create a more comprehensive privacy solution. The Double Hashing technique encrypts the content of the communication, making it opaque to passive observers. Simultaneously, OHTTP and Onion Services could provide additional privacy layers by obfuscating metadata about who is making a request.

For more information on OHTTP and Onion Services, please refer to these resources:

4.5 Resources

A. References

[ipip-0337]
IPIP-0337: Delegated Content Routing HTTP API. Gus Eggert; Marcin Rataj. 2022-10-18. URL: https://specs.ipfs.tech/ipips/ipip-0337/
2
  1. No bibliographic reference for key "http-routing-reader-privacy-v1".
  2. No bibliographic reference for key "http-routing-reader-privacy-v1".