diff options
| author | DanConwayDev <114834599+DanConwayDev@users.noreply.github.com> | 2026-04-10 22:21:56 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-10 18:21:56 -0300 |
| commit | 0a25dd524389d642ec153d9009a16fb183eb23ce (patch) | |
| tree | 1730c917ad68adfe34a2756be1d76dfdc5cf664d | |
| parent | 420f0b181434c348e487c6ffaa8fea6111c10210 (diff) | |
NIP-34 add `nostr://` clone urls spec (#2312)
| -rw-r--r-- | 34.md | 23 |
1 files changed, 22 insertions, 1 deletions
| @@ -37,6 +37,27 @@ The `r` tag annotated with the `"euc"` marker should be the commit ID of the ear | |||
| 37 | 37 | ||
| 38 | Except `d`, all tags are optional. | 38 | Except `d`, all tags are optional. |
| 39 | 39 | ||
| 40 | ### Nostr Clone URL format | ||
| 41 | |||
| 42 | A `nostr://` URL can be used to reference a repository announcement in a way that is compatible with `git clone` when a [git-remote-nostr](https://git-scm.com/docs/gitremote-helpers) helper is installed: | ||
| 43 | |||
| 44 | ``` | ||
| 45 | nostr://<naddr> | ||
| 46 | nostr://<npub|nip05>/<identifier> | ||
| 47 | nostr://<npub|nip05>/<relay-hint>/<identifier> | ||
| 48 | ``` | ||
| 49 | |||
| 50 | Both `<relay-hint>` and `<identifier>` MUST be percent-encoded per [RFC 3986 §2.1](https://datatracker.ietf.org/doc/html/rfc3986#section-2.1). `<relay-hint>` is a relay URL whose `wss://` scheme may be omitted for brevity. `<identifier>` is the `d` tag value of the kind `30617` event. | ||
| 51 | |||
| 52 | Examples: | ||
| 53 | |||
| 54 | ``` | ||
| 55 | nostr://npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/relay.ngit.dev/ngit | ||
| 56 | nostr://npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/my%20%F0%9F%9A%80%20repo | ||
| 57 | nostr://danconwaydev.com/ws%3A%2F%2Flocalhost%3A7334/my-local-only-repo | ||
| 58 | nostr://danconwaydev.com/relay.ngit.dev/ngit | ||
| 59 | ``` | ||
| 60 | |||
| 40 | ## Repository state announcements | 61 | ## Repository state announcements |
| 41 | 62 | ||
| 42 | An optional source of truth for the state of branches and tags in a repository. | 63 | An optional source of truth for the state of branches and tags in a repository. |
| @@ -239,7 +260,7 @@ The event SHOULD include a list of `g` tags with grasp service websocket URLs in | |||
| 239 | "content": "", | 260 | "content": "", |
| 240 | "tags": [ | 261 | "tags": [ |
| 241 | ["g", "<grasp-service-websocket-url>"], // zero or more grasp sever urls | 262 | ["g", "<grasp-service-websocket-url>"], // zero or more grasp sever urls |
| 242 | ] | 263 | ], |
| 243 | } | 264 | } |
| 244 | ``` | 265 | ``` |
| 245 | 266 | ||