From 0a25dd524389d642ec153d9009a16fb183eb23ce Mon Sep 17 00:00:00 2001 From: DanConwayDev <114834599+DanConwayDev@users.noreply.github.com> Date: Fri, 10 Apr 2026 22:21:56 +0100 Subject: NIP-34 add `nostr://` clone urls spec (#2312) --- 34.md | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) diff --git a/34.md b/34.md index d35c0eb..be7d445 100644 --- a/34.md +++ b/34.md @@ -37,6 +37,27 @@ The `r` tag annotated with the `"euc"` marker should be the commit ID of the ear Except `d`, all tags are optional. +### Nostr Clone URL format + +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: + +``` +nostr:// +nostr:/// +nostr://// +``` + +Both `` and `` MUST be percent-encoded per [RFC 3986 ยง2.1](https://datatracker.ietf.org/doc/html/rfc3986#section-2.1). `` is a relay URL whose `wss://` scheme may be omitted for brevity. `` is the `d` tag value of the kind `30617` event. + +Examples: + +``` +nostr://npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/relay.ngit.dev/ngit +nostr://npub15qydau2hjma6ngxkl2cyar74wzyjshvl65za5k5rl69264ar2exs5cyejr/my%20%F0%9F%9A%80%20repo +nostr://danconwaydev.com/ws%3A%2F%2Flocalhost%3A7334/my-local-only-repo +nostr://danconwaydev.com/relay.ngit.dev/ngit +``` + ## Repository state announcements 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 "content": "", "tags": [ ["g", ""], // zero or more grasp sever urls - ] + ], } ``` -- cgit v1.2.3