65 lines
1.6 KiB
Markdown
65 lines
1.6 KiB
Markdown
# HTTP Messages
|
|
|
|
A specification for exchanging data using remote HTTP messages on a trusted server
|
|
|
|

|
|
|
|
## Overview
|
|
|
|
Enables a local client to make and receive http requests from a remote computer. Requires:
|
|
|
|
* A trusted machine to process the messages (can be a home PC or Raspberry Pi)
|
|
* A relay (can be untrusted)
|
|
* A blossom server (can be untrusted)
|
|
|
|
|
|
## Architecture
|
|
|
|
```mermaid
|
|
architecture-beta
|
|
group user(internet)[Nostr Client]
|
|
group cloud(cloud)[Untrusted Servers]
|
|
group home(server)[Trusted Server]
|
|
service client(internet) in user
|
|
service blossom(database)[Blossom Storage] in cloud
|
|
service relay(logos:aws-ec2)[Relays] in cloud
|
|
service pc(logos:aws-elb) in home
|
|
service bbi[Big Bad Internet]
|
|
|
|
client:R -- L:blossom
|
|
client:B -- L:relay
|
|
pc:L -- R:blossom
|
|
pc:L -- R:relay
|
|
pc:B <--> T:bbi
|
|
|
|
|
|
```
|
|
|
|
## Event Structure
|
|
|
|
```jsonc
|
|
{
|
|
"kind": 1120,
|
|
"pubkey": "<pubkey>",
|
|
"content": "nip44Encrypt({'url':'blossom.one','decrypt':'password123'})",
|
|
"tags": [
|
|
["x", "<hash of encrypted message blob>"]
|
|
["E", "<request event id>"], // (RES) Request ID (mandatory)
|
|
["r", "https://relay.one"] // (REQ) Response Relay (optional)
|
|
],
|
|
// other fields...
|
|
}
|
|
```
|
|
|
|
Explanations:
|
|
|
|
* `kind:1120` - BIP39 word #1120 ([message](https://github.com/bitcoin/bips/blob/master/bip-0039/english.txt#L1120)).
|
|
* `"content"` - encrypted (NIP-44) JSON with location of blob and decryption key
|
|
* `"x"` - Blossom file hash of the encrypted request or response
|
|
* `"E"` - ID of the request event. Enables a response to be easily identified.
|
|
* `"r"` - (optional) relay on which the response should be sent. For Requests only.
|
|
|
|
|
|
|
|
|