Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: verify attestation field #240

Merged
merged 3 commits into from
Aug 14, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 19 additions & 14 deletions docs/specs/servers/relay/relay-server-rpc.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ The following definitions are shared concepts across all JSON-RPC methods for th

- **topic** - (hex string - 32 bytes) a target topic for the message to be subscribed by the receiver.
- **message** - (utf8 string - variable) a plaintext message to be relayed to any subscribers on the topic.
- **attestation** - (utf8 string - variable) the Verify attestation JWT to be included along with the message. Not included in Verify API attestation.
- **ttl** - (uint32 - 4 bytes) a storage duration for the message to be cached server-side in **seconds** (aka time-to-live).
- **tag** - (uint32 - 4 bytes) a label that identifies what type of message is sent based on the RPC method used.
- **id** - 19 digit unique identifier. We suggest a 13 digit epoch timestamp plus 6 digit entropy
Expand All @@ -20,17 +21,18 @@ The following definitions are shared concepts across all JSON-RPC methods for th

Used when a client publishes a message to a server.

```jsonc
```typescript
// Request (client->server)
{
"id" : "1",
"jsonrpc": "2.0",
"method": "irn_publish",
"params" : {
"topic" : string,
"message" : string,
"ttl" : seconds,
"tag" : number,
id: string,
jsonrpc: "2.0",
method: "irn_publish",
params: {
topic: string,
message: string,
attestation?: string | null,
ttl: seconds,
tag: number,
}
}

Expand All @@ -46,13 +48,14 @@ Used when a client publishes a message to a server.

Used when a client publishes multiple messages to a server.

```jsonc
```typescript
// PublishedMessage
{
"topic" : string,
"message" : string,
"ttl" : seconds,
"tag" : number,
topic: string,
message: string,
attestation?: string | null,
ttl: seconds,
tag: number,
}

// Request (client->server)
Expand Down Expand Up @@ -188,6 +191,7 @@ Used when a server sends a subscription message to a client.
"data" : {
"topic": string,
"message": string,
"attestation": string | null,
"publishedAt": number,
"tag": number
}
Expand Down Expand Up @@ -372,6 +376,7 @@ Body:
"status": string, // either "accepted", "queued" or "delivered"
"topic": string,
"message": string,
"attestation": string | null,
"publishedAt": number,
"tag": number
}
Expand Down