diff --git a/public/md/NIP-39802.md b/public/md/NIP-39802.md index 56b45e22..03ecb405 100644 --- a/public/md/NIP-39802.md +++ b/public/md/NIP-39802.md @@ -21,6 +21,7 @@ Reading progress events use NIP-33 parameterized replaceable semantics. The `d` - For external URLs: `url:` - `a` (optional but recommended for Nostr articles): Article coordinate `30023::` - `r` (optional but recommended for URLs): Raw URL of the external content + - Clients SHOULD clean URLs from tracking parameters and non-essential query strings before tagging - `client` (optional): Client application identifier ### Content @@ -163,6 +164,14 @@ While NIP-78 (kind 30078) can store arbitrary application data, a dedicated kind - For URLs, the base64url encoding in the `d` tag MUST use URL-safe characters (replace `+` with `-`, `/` with `_`, remove padding `=`) - Clients SHOULD validate that `progress` is between 0 and 1 +### URL Handling + +When generating events for external URLs: + +- Clients SHOULD clean URLs by removing tracking parameters (e.g., `utm_*`, `fbclid`, etc.) and other non-essential query strings +- The cleaned URL should be used for both the `r` tag and the base64url encoding in the `d` tag +- This ensures that the same article from different sources (with different tracking params) maps to the same reading progress event + ## References - [NIP-01: Basic protocol flow](https://github.com/nostr-protocol/nips/blob/master/01.md)