How OHTTP Works

Protocol Overview

Oblivious HTTP separates knowledge between two parties:

This separation means no single entity can link your identity to your requests.

The Flow

+---------+       +-------+       +---------+    +--------+
| Client  |       | Relay |       | Gateway |    | Target |
+---------+       +-------+       +---------+    +--------+
     |                |                |             |
     | Encapsulated   |                |             |
     | Request        |                |             |
     +--------------->| Forward        |             |
     |                +--------------->| Decrypt &   |
     |                |                | Forward     |
     |                |                +------------>|
     |                |                |             |
     |                |                |<------------+
     |                |                | Encrypt     |
     |                |<---------------+ Response    |
     |<---------------+                |             |
     | Decapsulated   |                |             |
     | Response       |                |             |

Step by Step

1. Client Encrypts Request

The client fetches the gateway’s public key from /.well-known/ohttp-gateway and uses HPKE (Hybrid Public Key Encryption) to encrypt the HTTP request.

2. Client Sends to Relay

The encrypted blob is sent to the relay as a POST request with Content-Type: message/ohttp-req. The relay sees:

3. Relay Forwards to Gateway

The relay forwards the encrypted blob to the gateway. The relay cannot:

4. Gateway Decrypts

The gateway decrypts the request using its private key and processes it. The gateway sees:

5. Response Path

The response follows the reverse path:

  1. Gateway encrypts the response
  2. Relay forwards it back
  3. Client decrypts with the context from step 1

Cryptography

OHTTP uses:

Trust Model

EntityKnows IdentityKnows Request
RelayYes (client IP)No
GatewayNoYes
Relay + Gateway colludingYesYes

For maximum privacy, the relay and gateway should be operated by different entities.

Limitations