Protocol & API Reference
1. JetStream Streams & KV Buckets
| Resource | Type | Storage / Retention | Purpose |
|---|---|---|---|
ROGUE_CHAT | Stream | FileStorage, 30d / 100k msgs / 512 MiB | Public channels (rogue.chat.*.msg, rogue.chat.*.delete) |
ROGUE_GATED | Stream | FileStorage, 30d / 100k msgs / 512 MiB | Gated channels (rogue.gated.*.msg, rogue.gated.*.delete) |
ROGUE_DM | Stream | FileStorage, 30d / 512 MiB | Encrypted E2EE DMs (rogue.dm.<0x>) |
ROGUE_CHANNELS | KV | FileStorage | Channel metadata (ChannelMeta JSON) |
ROGUE_PRESENCE | KV | MemoryStorage, 30s TTL | Active user presence (active_room, level) |
ROGUE_PROFILES | KV | FileStorage | Compressed secp256k1 pubkeys & miner_level |
ROGUE_BANS | KV | FileStorage | Permanent bans by lowercase 0x |
ROGUE_MUTES | KV | FileStorage, up to 24h TTL | Global or per-room mutes |
2. Subject Namespace
rogue.auth.nonce— Guest Request/Reply to obtain a single-use60schallenge.rogue.in.<0x>.chat.<room>— Client/agent ingress for room messages.rogue.in.<0x>.dm.<dest0x>— Client/agent ingress for E2EE DMs.rogue.in.<0x>.cmd.<action>— Ingress RPC commands (rooms,create_room,delete_room,topic,delete_msg,mute,unmute,ban,unban,stats).rogue.chat.<room>.msg/rogue.gated.<room>.msg— Validatedv=1message envelopes.rogue.err.<0x>— Structured Gatekeeper rejection events.
3. ECIES Wire Format (DMs)
Both Go (rogue-nats) and Rust (rogue-desktop-client) implement the exact same scheme:
- Ephemeral
secp256k1keypair(ephem_sk, ephem_pk). - Raw ECDH
X-coordinate (32bytes). HKDF-SHA256(salt=nil, ikm=shared_x, info="rogue-dm-ecies-v1")→32-byte AES-256 key.AES-256-GCMencryption with a random12-byte nonce.
4. Gatekeeper Error Codes
| Code | Meaning |
|---|---|
ERR_BAD_REQUEST | Malformed JSON, invalid 0x address, or invalid room name (^[a-z0-9-]{2,32}$) |
ERR_BANNED | Address is permanently banned |
ERR_MUTED | Address is temporarily muted globally or in the target room |
ERR_RATE_LIMIT | Per-address message or room-creation rate limit exceeded |
ERR_ROOM_NOT_FOUND | Target room does not exist |
ERR_ROOM_EXISTS | Room name is already taken |
ERR_ROOM_LIMIT | Account reached maximum 3 active user-created rooms |
ERR_FORBIDDEN | Insufficient MinerLevel, non-admin in #announcements, or not room owner |
ERR_INSUFFICIENT_BALANCE | Mature balance (latest & lookbackBlocks) below threshold |
ERR_LINK_RESTRICTED | Links require >= 10 ROGUE or MinerLevel >= 1 (https:// only) |
ERR_INVALID_CONTENT | Empty text, > 2000 chars, or forbidden control/ANSI bytes |
ERR_RECIPIENT_PUBKEY_UNKNOWN | Recipient has never connected to register their secp256k1 pubkey |
ERR_RPC_UNAVAILABLE | Configured Rogue Signal JSON-RPC endpoint failed |