From 18f5906b88800dadd1f1dd06cec58fd568e8f75c Mon Sep 17 00:00:00 2001 From: bndw Date: Fri, 13 Feb 2026 20:59:53 -0800 Subject: redesign: early web minimalism + cypherpunk Complete aesthetic reversal - from cyber-brutalist to minimal: AESTHETIC: 1995 web document meets cypherpunks mailing list - Courier New system font (no web fonts) - Black on white for readability - Semantic HTML with minimal CSS - PGP signature blocks (cypherpunk heritage) - Classic underlined blue links - Horizontal rules for section breaks - Looks like a .txt file rendered as HTML PHILOSOPHY: Throwback to when the web was just documents. No animations, no grids, no gradients. Just semantic HTML, monospace type, and information. Fast loading, accessible, timeless. CYPHERPUNK TOUCHES: - PGP signature blocks - Hash fingerprints - Technical language - Cryptographic references - Feels like reading crypto mailing list archives Zero frameworks, zero build tools, maximum signal. --- internal/handler/websocket/index.go | 523 ++++++++---------------------------- 1 file changed, 115 insertions(+), 408 deletions(-) (limited to 'internal') diff --git a/internal/handler/websocket/index.go b/internal/handler/websocket/index.go index 861fbb1..887b6ea 100644 --- a/internal/handler/websocket/index.go +++ b/internal/handler/websocket/index.go @@ -10,441 +10,148 @@ var indexTemplate = template.Must(template.New("index").Parse(` - NOSTR-GRPC-RELAY/v1.0.0 - - - + Nostr Relay + + - .protocol-endpoint { - background: var(--bg-tertiary); - padding: 0.75rem; - margin: 1rem 0; - border-left: 2px solid var(--cyan); - font-size: 0.75rem; - color: var(--cyan); - word-break: break-all; - font-weight: 400; - } +
+-----BEGIN NOSTR RELAY INFO-----
+Hash: SHA256
 
-        .protocol-desc {
-            font-size: 0.75rem;
-            color: var(--gray);
-            font-weight: 300;
-            line-height: 1.5;
-        }
+relay_id: nostr-grpc-relay
+version: 1.0.0
+status: online
+-----END NOSTR RELAY INFO-----
+
- /* Info section */ - .info-grid { - display: grid; - grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); - gap: 1.5rem; - margin-bottom: 3rem; - } +

Nostr Relay

- .info-card { - background: var(--bg-secondary); - border: 1px solid var(--border); - padding: 1.5rem; - animation: fadeInUp 0.8s ease-out 0.6s backwards; - } +

This relay implements the Nostr protocol with support for multiple transport layers. Connect using gRPC, HTTP/JSON (Connect), or standard WebSocket.

- .info-card h3 { - font-size: 0.75rem; - color: var(--cyan); - margin-bottom: 1rem; - letter-spacing: 0.1em; - font-weight: 700; - } +
- .nip-list { - display: flex; - flex-wrap: wrap; - gap: 0.5rem; - } +

Connection Endpoints

- .nip-tag { - background: var(--bg-tertiary); - border: 1px solid var(--border); - padding: 0.25rem 0.75rem; - font-size: 0.75rem; - color: var(--green); - font-weight: 500; - transition: all 0.2s ease; - } +

gRPC (Native Binary)

+

{{.GrpcAddr}}

+

High-performance binary protocol using Protocol Buffers over HTTP/2. For applications requiring low latency and high throughput.

- .nip-tag:hover { - border-color: var(--green); - box-shadow: 0 0 10px rgba(57, 255, 20, 0.2); - } +

Connect (HTTP/JSON)

+

{{.HttpAddr}}/nostr.v1.NostrRelay/*

+

Browser-compatible HTTP interface. Standard JSON over HTTP/1.1 or HTTP/2. CORS enabled.

- .feature-list { - list-style: none; - font-size: 0.75rem; - color: var(--gray); - font-weight: 300; - } +

WebSocket (Nostr Protocol)

+

ws://{{.WsAddr}}/

+

Standard Nostr protocol implementation (NIP-01). Compatible with all Nostr clients: Damus, Amethyst, Snort, Iris, etc.

- .feature-list li { - padding: 0.5rem 0; - border-bottom: 1px solid var(--border); - } +
- .feature-list li:last-child { - border-bottom: none; - } +

Supported NIPs

- .feature-list li::before { - content: '[✓] '; - color: var(--green); - margin-right: 0.5rem; - } + - /* Footer */ - .footer { - text-align: center; - padding: 2rem; - border-top: 1px solid var(--border); - margin-top: 3rem; - font-size: 0.75rem; - color: var(--gray); - animation: fadeIn 0.8s ease-out 0.8s both; - } +
- .footer pre { - margin: 1rem 0; - color: var(--cyan); - opacity: 0.5; - font-size: 0.5rem; - line-height: 0.6rem; - } +

Implementation Details

- @keyframes fadeIn { - from { opacity: 0; } - to { opacity: 1; } - } +

Storage: SQLite with Write-Ahead Logging (WAL mode)
+Event Format: Binary-first (Protocol Buffers + compressed JSON)
+Validation: Full cryptographic signature and event ID verification
+Subscriptions: Real-time event streaming with filter matching
+Deletion: Hard delete (events are permanently removed)

- @keyframes fadeInUp { - from { - opacity: 0; - transform: translateY(20px); - } - to { - opacity: 1; - transform: translateY(0); - } - } +
- @media (max-width: 768px) { - .container { - padding: 1rem; - } - .ascii-logo { - font-size: 0.35rem; - line-height: 0.4rem; - } - .header h1 { - font-size: 1.5rem; - } - .status-bar { - flex-direction: column; - gap: 0.5rem; - align-items: flex-start; - } - } - - - -
-
-
- - RELAY.ONLINE -
-
- PROTOCOLS: 3 -
-
- NIPs: 01/09/11 -
-
+

Technical Notes

-
- -

NOSTR-GRPC-RELAY

-

decentralized protocol node // multi-transport relay

-
+

Events are stored in binary format using Protocol Buffers alongside compressed canonical JSON. This dual-storage approach provides both performance (binary queries) and compatibility (JSON export).

-
-
-
- gRPC - ACTIVE -
-
{{.GrpcAddr}}
-

Native binary protocol. High-throughput RPC interface for application-layer integration. Protocol Buffers over HTTP/2.

-
+

The relay validates all events before storage:

+
1. Verify event ID matches SHA256(canonical_json)
+2. Verify schnorr signature against pubkey
+3. Store in SQLite with indexed queries
-
-
- CONNECT - ACTIVE -
-
{{.HttpAddr}}/nostr.v1.NostrRelay/*
-

Browser-compatible HTTP/JSON interface. gRPC-Web with Connect protocol. CORS-enabled for web clients.

-
+

Subscriptions use a shared manager across all three protocols. An event published via gRPC will be immediately broadcast to WebSocket subscribers and vice versa.

-
-
- WEBSOCKET - ACTIVE -
-
ws://{{.WsAddr}}/
-

Standard Nostr protocol (NIP-01). Compatible with all Nostr clients. Real-time event streaming.

-
-
+
-
-
-

SUPPORTED_NIPS

-
- NIP-01 - NIP-09 - NIP-11 -
-
+
+
-----BEGIN PGP SIGNATURE-----
+relay_fingerprint: a8f9c2e1d4b7a3f6
+protocol_version: nostr_01
+transport_types: grpc|connect|websocket
+-----END PGP SIGNATURE-----
+
-
-

RELAY_FEATURES

-
    -
  • Binary-first storage
  • -
  • SQLite WAL mode
  • -
  • Event validation
  • -
  • Real-time subscriptions
  • -
  • Hard deletion (NIP-09)
  • -
-
-
+

This relay runs on open-source software. Decentralized, censorship-resistant, user-owned.

- -
`)) -- cgit v1.2.3