GDBx /Api
Open API CORS enabled no keys required

API Reference

Build against the sovereign data mesh from any client. Every write is GDBx-signed (ECDSA P-256), PoW-gated and replay-protected; reads are open.

HTTP base (Pages proxy)
https://gdbx.pages.dev/api/v1
Direct edge (Worker · WS · fastest)
https://gdbx-do.xup.workers.dev

Endpoints

Identity — DID registry

POST /did register a DID document — body {addr, pubkey, pubkeyHex, ts, nonce, diff, hash, sig}
GET /did/:addr resolve a did:gdbx document
POST /identity/role superadmin-signed promote/demote (RBAC guest→superadmin)
DELETE /identity GDPR right-to-be-forgotten — cryptographic erasure of everything

Sync — signed CRDT deltas

POST /sync apply a signed LWW delta batch — body includes deltas[], ts, nonce, diff, hash, sig
GET /sync/:addr?prefix= read merged state (primary + mirror pool, newest-clock wins)
WS ws?addr=:addr real-time hub — send hello → put → receive applied + delta broadcasts

Mesh — hybrid transports

POST /relay Nostr kind-23124 ingest — GDBx envelope in content, same firewall as HTTP/WS
POST /peers presence heartbeat — {addr, transports[], name}

Analytics & ops

GET /stats global counters — dids, deltas, active peers, policy block
GET /leaderboard top active addresses + transport mix + live peers
GET /pool replication pool status — primary + mirror health
GET /health liveness probe
POST /export signed backup snapshot of an address (owner-proof required)

Quickstart

# 1 · read anything — no key needed
curl https://gdbx.pages.dev/api/v1/sync/<addr>?prefix=hello
# 2 · liveness + pool health
curl https://gdbx-do.xup.workers.dev/health
curl https://gdbx-do.xup.workers.dev/pool
# 3 · write = PoW + GDBx signature (SDK does this for you)
import { makePair, minePoW } from "gdbx";
import { sign } from "gdbx/crypto";

const sig = await sign({ addr, action:"sync.put", ts, payload }, pair);
await fetch(WORKER+"/sync", { method:"POST", body });
# 4 · real-time (Worker serves WS upgrades directly)
new WebSocket("wss://gdbx-do.xup.workers.dev/ws?addr=<addr>")