client <-https-> ohttp-relay <-https-> nostr-ohttp-gateway <-websocket-> nostr-relay
the client connects to the ohttp relay and POSTs OHTTP encapsulated requests encrypted to the nostr ohttp gateway.
the ohttp target resource is a REST nostr bridge, which maps NIP-01 functionality to HTTP.
client messages from NIP-01 all map to POST requests. publishing an event waits for an OK message which becomes the response. a new SUBSCRIBE message allocates a globally unique subscription ID for the OHTTP client, and begins streaming it using chunked OHTTP. REQ requests must use a bridge provided subscription id.
relay responses work as if clients used multiple websockets connections, with each connection either posting a single event or subscribing to a single request, but otherwise behave unchanged.
to simplify serialization, event data can be serialized on the wire in the format used for signing instead of as JSON objects, with a JSON object only included for any remaining NIP-24 fields as necessary.
anonymous credentials for rate limiting and paid usage
multihop + async OHTTP,
PIR subscriptions