Skip to content

Commit

Permalink
Update url-data.md
Browse files Browse the repository at this point in the history
  • Loading branch information
jimstir authored Sep 12, 2024
1 parent be1ee0c commit b105039
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions status/raw/url-data.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ contributors:

## Abstract

This document specifies serialization, compression, and encoding techniques used to transmit data within URLs in the context of Status protocols.
This document specifies serialization, compression, and
encoding techniques used to transmit data within URLs in the context of Status protocols.

## Motivation

When sharing URLs, link previews often expose metadata to the websites behind those links.
To reduce reliance on external servers for providing appropriate link previews, this specification proposes a standard method for encoding data within URLs.
When sharing URLs,
link previews often expose metadata to the websites behind those links.
To reduce reliance on external servers for providing appropriate link previews,
this specification proposes a standard method for encoding data within URLs.

## Terminology

Expand Down Expand Up @@ -80,7 +83,7 @@ message URLData {
The above wire format describes the data encoded in the URL.
The data MUST be serialized, compressed, and encoded using the following standards:

### Encoding
Encoding

- [Base64url](https://datatracker.ietf.org/doc/html/rfc4648)

Expand All @@ -94,11 +97,11 @@ The data MUST be serialized, compressed, and encoded using the following standar

### Implementation Pseudocode

#### Encoding
Encoding

Encoding the URL MUST be done in the following order:

```
```protobuf
raw_data = {User | Channel | Community}
serialized_data = protobuf_serialize(raw_data)
compressed_data = brotli_compress(serialized_data)
Expand All @@ -111,14 +114,15 @@ The `encoded_url_data` is then used to generate a signature using the private ke

Decoding the URL MUST be done in the following order:

```
```protobuf
url_data = base64url_decode(encoded_url_data)
decompressed_data = brotli_decompress(url_data)
deserialized_data = protobuf_deserialize(decompressed_data)
raw_data = deserialized_data.content
```

The `raw_data` is then used to construct the appropriate data structure (User, Channel, or Community).
The `raw_data` is then used to construct the appropriate data structure
(User, Channel, or Community).

### Example

Expand Down

0 comments on commit b105039

Please sign in to comment.