{"id":42626763,"url":"https://github.com/letdown2491/nip46-relay","last_synced_at":"2026-01-29T05:02:34.408Z","repository":{"id":333405012,"uuid":"1124382749","full_name":"Letdown2491/nip46-relay","owner":"Letdown2491","description":"A NIP-46 relay anyone can host.","archived":false,"fork":false,"pushed_at":"2026-01-19T02:27:47.000Z","size":16,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-19T11:55:07.680Z","etag":null,"topics":["bunker","nip46","nostr","nsec","remote","signer"],"latest_commit_sha":null,"homepage":"https://relay.nip46.com","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Letdown2491.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-28T23:28:53.000Z","updated_at":"2026-01-19T02:27:51.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/Letdown2491/nip46-relay","commit_stats":null,"previous_names":["letdown2491/nip46-relay"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/Letdown2491/nip46-relay","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Letdown2491%2Fnip46-relay","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Letdown2491%2Fnip46-relay/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Letdown2491%2Fnip46-relay/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Letdown2491%2Fnip46-relay/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Letdown2491","download_url":"https://codeload.github.com/Letdown2491/nip46-relay/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Letdown2491%2Fnip46-relay/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28863009,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T22:56:21.783Z","status":"online","status_checked_at":"2026-01-29T02:00:06.714Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bunker","nip46","nostr","nsec","remote","signer"],"created_at":"2026-01-29T05:01:24.666Z","updated_at":"2026-01-29T05:02:34.402Z","avatar_url":"https://github.com/Letdown2491.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# nip46-relay\n\nA lightweight [NIP-46](https://github.com/nostr-protocol/nips/blob/master/46.md) relay for Nostr remote signing. Use it with self-hosted signers like [nsec.app](https://nsec.app), [Signet](https://github.com/letdown2491/signet), or any NIP-46 compatible application.\n\nBased on [Bunklay](https://github.com/dezh-tech/ddsr) from dezh-tech.\n\n## Features\n\n- **NIP-46 only** - Accepts only kind 24133 and 24135 events\n- **Ephemeral storage** - Events auto-expire (default: 10 minutes)\n- **Timestamp validation** - Rejects events outside time window\n- **Lightweight** - Single binary, minimal dependencies\n- **BadgerDB** - Embedded database, no external services needed\n\n## Quick Start\n\n### Build and Run\n\n```bash\ngo build -o nip46-relay .\n./nip46-relay\n```\n\nRelay runs on `http://localhost:3334` by default.\n\n### With Docker\n\n```bash\ndocker compose up -d\n```\n\n## Configuration\n\nCopy `.env.example` to `.env` and customize:\n\n```bash\ncp .env.example .env\n```\n\n### Environment Variables\n\n| Variable | Default | Description |\n|----------|---------|-------------|\n| `RELAY_NAME` | `NIP-46 Relay` | Display name in NIP-11 info |\n| `RELAY_DESCRIPTION` | `A NIP-46 remote signing relay` | Relay description |\n| `RELAY_URL` | | Public WebSocket URL (e.g., `wss://nip46.example.com`) |\n| `RELAY_PUBKEY` | | Operator pubkey (hex format) |\n| `RELAY_CONTACT` | | Contact info |\n| `RELAY_ICON` | | URL to relay icon |\n| `RELAY_BANNER` | | URL to relay banner |\n| `RELAY_PORT` | `:3334` | Port to listen on |\n| `WORKING_DIR` | `./nip46-relay-data` | Data directory for BadgerDB |\n| `KEEP_IN_MINUTES` | `10` | Event retention time |\n| `ACCEPT_WINDOW_IN_MINUTES` | `1` | Timestamp validation window |\n| `RATE_LIMIT_PER_MINUTE` | `100` | Max events per minute per pubkey |\n\n## Systemd Service\n\nInstall as a system service for auto-start and restart on failure:\n\n```bash\n# From ~/nip46-relay\ncp .env.example .env\nnano .env  # configure\n\n# Edit service file to match your username/path\nnano nip46-relay.service\n\n# Install service\nsudo cp nip46-relay.service /etc/systemd/system/\nsudo systemctl daemon-reload\nsudo systemctl enable nip46-relay\nsudo systemctl start nip46-relay\n\n# Check status\nsudo systemctl status nip46-relay\nsudo journalctl -u nip46-relay -f\n```\n\n## Reverse Proxy with Caddy\n\nCreate or edit your Caddyfile:\n\n```caddyfile\nnip46.example.com {\n    reverse_proxy localhost:3334\n}\n```\n\nReload Caddy:\n\n```bash\nsudo systemctl reload caddy\n```\n\nCaddy automatically provisions TLS certificates and handles WebSocket upgrades.\n\n## How It Works\n\nNIP-46 enables remote signing where a client app requests signatures from a remote signer (like a hardware device or mobile app). This relay acts as the communication channel:\n\n1. Client publishes encrypted request (kind 24133) tagged to signer's pubkey\n2. Relay stores and forwards to signer\n3. Signer publishes encrypted response tagged to client's pubkey\n4. Relay stores and forwards to client\n\nAll messages are NIP-44 encrypted end-to-end. The relay only sees opaque blobs.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletdown2491%2Fnip46-relay","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fletdown2491%2Fnip46-relay","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fletdown2491%2Fnip46-relay/lists"}