EGG — Event Git Graph Nostr-native decentralized Git forge protocol
This document defines the Nostr event kinds and tag structures used by EGG. It extends NIP-34.
EGG maps every Git and collaboration concept to a Nostr event:
Git concept Nostr event kind
────────────── ────────────────
Repository → kind:30617
Commit/Patch → kind:30618
Pull Request → kind:30619
Release/Tag → kind:30620
Access Grant → kind:30621
Issue → kind:1621
Comment → kind:1622
All events are signed by the author's Nostr keypair. The pubkey field is the author's identity — no separate username or email is required.
Describes a Git repository hosted on an EGG instance.
The d tag combined with the pubkey forms the unique repo address: 30617:<pubkey>:myproject
Represents a Git commit or patch set.
{
"kind": 30618,
"pubkey": "<author npub hex>",
"created_at": 1700000001,
"tags": [
["d", "<commit-sha>"],
["a", "30617:<owner-pubkey>:myproject", "wss://egg.owner.com/relay"], // repo ref
["r", "main"], // branch
["parent", "<parent-sha>"],
["message", "Fix null pointer in auth handler"]
],
"content": "<patch diff content>",
"sig": "..."
}Proposes merging changes from a source branch/repo into a target.
{
"kind": 30619,
"pubkey": "<author npub hex>",
"created_at": 1700000002,
"tags": [
["d", "<uuid>"],
["a", "30617:<owner-pubkey>:myproject"], // target repo
["title", "Add WebSocket support"],
["target-branch", "main"],
["source-branch", "feat/websocket"],
["source-repo", "30617:<fork-pubkey>:myproject-fork"],
["status", "open"], // "open" | "merged" | "closed"
["r", "<latest-commit-sha>"]
],
"content": "This PR adds WebSocket support for real-time relay connections.",
"sig": "..."
}Marks a versioned release of a repository.
{
"kind": 30620,
"pubkey": "<author npub hex>",
"created_at": 1700000003,
"tags": [
["d", "v0.1.0"],
["a", "30617:<owner-pubkey>:myproject"],
["r", "<commit-sha>"],
["title", "v0.1.0 — Initial release"]
],
"content": "## Changelog\n\n- Initial public release\n- Git hosting + Nostr relay",
"sig": "..."
}Grants or revokes repository access for a specific npub.
{
"kind": 30621,
"pubkey": "<admin npub hex>",
"created_at": 1700000004,
"tags": [
["d", "<uuid>"],
["a", "30617:<owner-pubkey>:myproject"],
["p", "<grantee-npub-hex>"],
["role", "contributor"], // "viewer" | "contributor" | "maintainer" | "admin"
["action", "grant"] // "grant" | "revoke"
],
"content": "",
"sig": "..."
}For private repos, this event may be encrypted (NIP-44) so only the grantee can read it.
A bug report or feature request linked to a repository.
{
"kind": 1621,
"pubkey": "<author npub hex>",
"created_at": 1700000005,
"tags": [
["a", "30617:<owner-pubkey>:myproject"],
["subject", "Relay crashes on malformed events"],
["label", "bug"],
["label", "relay"],
["status", "open"] // "open" | "closed"
],
"content": "When sending an event without the `sig` field, the relay crashes with...",
"sig": "..."
}A threaded comment on an issue, PR, or specific commit line.
{
"kind": 1622,
"pubkey": "<author npub hex>",
"created_at": 1700000006,
"tags": [
["e", "<issue-or-pr-event-id>", "", "reply"], // parent event
["a", "30617:<owner-pubkey>:myproject"],
["r", "<commit-sha>"], // optional: links to a commit
["line", "42"] // optional: inline code comment
],
"content": "Reproduced on v0.1.0. The issue is in `relay/index.js` line 42.",
"sig": "..."
}EGG instances discover each other through Nostr relay references in event tags.
When a developer on egg.bob.com wants to contribute to a repo at egg.alice.com:
- They fetch the repo's
kind:30617event fromalice.com's relay. - They push their fork to their own instance (
egg.bob.com). - They publish a
kind:30619PR event to their relay, referencing the target repo. alice.com's relay subscribes to PRs targeting its repos and receives the event.- Alice sees the PR in her EGG web client.
No central coordination required.
| NIP | Description | Status |
|---|---|---|
| NIP-01 | Basic protocol | ✅ Required |
| NIP-09 | Event deletion | ✅ Supported |
| NIP-11 | Relay info document | ✅ Supported |
| NIP-34 | Git stuff | ✅ Extended |
| NIP-44 | Encrypted payloads | 🚧 Planned (private repos) |
| NIP-98 | HTTP Auth | ✅ Used for web client login |
This spec follows the EGG version. Breaking changes will bump the major version.
Current: v0.1 (alpha)
{ "kind": 30617, "pubkey": "<owner npub hex>", "created_at": 1700000000, "tags": [ ["d", "myproject"], // repo identifier (unique per pubkey) ["name", "myproject"], // display name ["description", "A cool project"], ["web", "https://egg.owner.com/myproject"], // web URL ["clone", "https://egg.owner.com/myproject.git"], ["clone", "git@egg.owner.com:myproject.git"], ["r", "main"], // default branch ["visibility", "public"], // "public" | "private" ["t", "nostr"], // topics/tags ["t", "git"] ], "content": "Long description or README excerpt.", "sig": "..." }