API Reference
The RougeChain node exposes a REST API on the configured --api-port (default: 5101).
Important: All write operations (POST/PUT/DELETE) require v2 signed requests using ML-DSA-65 client-side signing. Legacy unsigned v1 write endpoints return
410 GONEin production. Private keys never leave your application.
Base URL
Local node:
http://127.0.0.1:5101/api
Public testnet:
https://testnet.rougechain.io/api
Public mainnet:
https://api.rougechain.io/api
Both public endpoints send Access-Control-Allow-Origin: *, so browser dApps and localhost dev servers can call them directly with no per-origin allowlisting. (The API has no cookie/session auth — every write is ML-DSA-65 signed — so a wildcard is safe, the same posture as public RPC providers.)
Address Format
RougeChain uses Bech32m addresses with the rouge1 prefix (e.g., rouge1q8f3x7k2m4n9p...). These are derived from the SHA-256 hash of the raw ML-DSA-65 public key.
Accepted formats differ per endpoint:
| Endpoint | Accepts |
|---|---|
/api/balance/:publicKey, /api/balance/:publicKey/:token | hex public key or rouge1… address |
/api/address/:pubkey/transactions | hex public key or rouge1… address |
/api/resolve/:input | hex public key or rouge1… address |
/api/nft/owner/:pubkey | exact match on the owner as recorded — normally the hex public key; a rouge1… address does not match a pubkey-owned NFT |
/api/account/:pubkey/nonce | hex public key or rouge1… address (resolved via the node's address index; an address that has never sent a transaction returns 0; a malformed one returns 400) |
When in doubt, pass the hex public key.
Tip: Use
GET /api/resolve/:inputto convert betweenrouge1…addresses and hex public keys.
v2 Signed Request Format
All write endpoints use a standard signed-request envelope:
{
"payload": {
"...endpoint-specific fields...",
"from": "your-signing-public-key-hex",
"timestamp": 1706745600000,
"nonce": "random-hex-string"
},
"signature": "ml-dsa65-signature-of-payload-hex",
"public_key": "your-signing-public-key-hex"
}
The payload is JSON-serialized with keys sorted alphabetically, then signed with your ML-DSA-65 private key. The server verifies the signature, checks the timestamp (must be within ±5 minutes of the server clock), and rejects a signature it has already seen within that window. Messenger, mail and name endpoints additionally require a unique nonce of 8–128 characters. The envelope may also carry an optional payload_bytes_hex (the exact bytes that were signed); when present the node verifies those bytes and checks that they decode to payload.
Endpoints Overview
System
| Endpoint | Method | Description |
|---|---|---|
/api/health | GET | Node health check |
/api/stats | GET | Network statistics |
/api/ws | GET | WebSocket for real-time events |
/api/price/xrge | GET | Current XRGE price |
Blockchain
| Endpoint | Method | Description |
|---|---|---|
/api/blocks | GET | Get recent blocks (max 100) or a page of blocks |
/api/blocks/summary | GET | Block summary for charts |
/api/block/:height | GET | Get block by height |
/api/txs | GET | Get transactions |
/api/tx/:hash | GET | Get transaction by hash |
/api/tx/:hash/receipt | GET | Get transaction receipt |
/api/events | GET | Get all events |
Wallet & Accounts
| Endpoint | Method | Description |
|---|---|---|
/api/balance/:publicKey | GET | Get XRGE balance |
/api/balance/:publicKey/:token | GET | Get token balance |
/api/account/:pubkey/nonce | GET | Get account nonce |
/api/resolve/:input | GET | Resolve address ↔ public key |
/api/address/:pubkey/transactions | GET | Get address transactions |
/api/v2/transfer | POST | Transfer tokens (signed) |
/api/v2/faucet | POST | Request testnet tokens (signed) |
Tokens
| Endpoint | Method | Description |
|---|---|---|
/api/tokens | GET | List all tokens |
/api/token/:symbol/metadata | GET | Get token metadata |
/api/token/:symbol/holders | GET | Get token holders |
/api/token/:symbol/transactions | GET | Get token transactions |
/api/burn-address | GET | Get official burn address |
/api/burned | GET | Get burned token stats |
/api/v2/token/create | POST | Create token (signed); mintable / max_supply since TOKEN_MINTING (mainnet block 235) |
/api/v2/token/mint | POST | Mint more of a mintable token, creator only (signed); live since mainnet block 235 |
/api/v2/token/metadata/update | POST | Update token metadata (signed) |
/api/v2/token/metadata/claim | POST | Claim metadata ownership (signed) |
Token Allowances (ERC-20 Style)
| Endpoint | Method | Description |
|---|---|---|
/api/v2/token/approve | POST | Approve spender allowance (signed) |
/api/v2/token/transfer-from | POST | Transfer using allowance (signed) |
/api/v2/token/freeze | POST | Freeze/unfreeze token transfers (signed) |
/api/token/allowance | GET | Check specific allowance |
/api/token/allowances | GET | List allowances by owner/spender |
/api/allowances/:pubkey | GET | List all allowances for a key |
/api/locks/:pubkey | GET | Get token locks |
Staking & Validators
| Endpoint | Method | Description |
|---|---|---|
/api/validators | GET | List validators |
/api/validators/stats | GET | Validator vote stats |
/api/selection | GET | Proposer for the next height. Once proposer selection is active, the consensus designated proposer (rule: "designated_max_stake", same as designated_proposer_next in /api/stats; no entropy fields); before activation, the legacy QRNG lottery (rule: "legacy_qrng_lottery") |
/api/finality | GET | Finality status (legacy, informational — see Finality) |
/api/votes | GET | Vote quorum info |
/api/v2/stake | POST | Stake tokens (signed) |
/api/v2/unstake | POST | Unstake tokens (signed) |
Token Staking Pools (suspended since block 245)
create_staking_pool,token_stakeandtoken_unstakeare suspended transaction types since mainnet block 245 (testnet 1390): no block may carry them. These read routes answer with empty data on mainnet (no pool was ever created). See Status.
| Endpoint | Method | Description |
|---|---|---|
/api/staking/pools | GET | List all staking pools |
/api/staking/pool/:pool_id | GET | Get staking pool details |
/api/staking/stakes/:pubkey | GET | Get stakes by owner |
/api/staking/pool/:pool_id/stakes | GET | Get stakes in a pool |
AMM/DEX
| Endpoint | Method | Description |
|---|---|---|
/api/pools | GET | List liquidity pools |
/api/pool/:pool_id | GET | Get pool details |
/api/pool/:pool_id/prices | GET | Get price history |
/api/pool/:pool_id/events | GET | Get pool events |
/api/pool/:pool_id/stats | GET | Get pool statistics |
/api/swap/quote | POST | Get swap quote |
/api/v2/pool/create | POST | Create liquidity pool (signed) |
/api/v2/pool/add-liquidity | POST | Add liquidity (signed) |
/api/v2/pool/remove-liquidity | POST | Remove liquidity (signed) |
/api/v2/swap/execute | POST | Execute swap (signed) |
NFTs
| Endpoint | Method | Description |
|---|---|---|
/api/nft/collections | GET | List collections |
/api/nft/collection/:id | GET | Get collection |
/api/nft/collection/:id/tokens | GET | Get collection tokens |
/api/nft/token/:coll/:id | GET | Get specific NFT |
/api/nft/owner/:pubkey | GET | Get NFTs by owner |
/api/v2/nft/collection/create | POST | Create collection (signed) |
/api/v2/nft/mint | POST | Mint NFT (signed) |
/api/v2/nft/batch-mint | POST | Batch mint (signed) |
/api/v2/nft/transfer | POST | Transfer NFT (signed) |
/api/v2/nft/burn | POST | Burn NFT (signed) |
/api/v2/nft/lock | POST | Lock/unlock NFT (signed) |
/api/v2/nft/freeze-collection | POST | Freeze collection (signed) |
Smart Contracts
| Endpoint | Method | Description |
|---|---|---|
/api/v2/contract/publish | POST | Publish (deploy) WASM contract (player-signed, 10 XRGE) |
/api/v2/contract/execute | POST | Call a contract method (player-signed, fee = gasLimit × 0.000001 XRGE) |
/api/contract/:address/query | POST | Read-only call (free, not signed) |
/api/contract/:address | GET | Get contract metadata |
/api/contract/:address/state | GET | Get contract state |
/api/contract/:address/events | GET | Get contract events (limit, before, tx) |
/api/contracts | GET | List contracts |
Bridge (ETH/USDC + XRGE)
| Endpoint | Method | Description |
|---|---|---|
/api/bridge/config | GET | ETH/USDC bridge config |
/api/bridge/claim | POST | Claim bridge deposit |
/api/bridge/withdraw | POST | Withdraw to EVM |
/api/bridge/withdrawals | GET | List pending withdrawals |
/api/bridge/activity | GET | Public bridge activity (deposits + withdrawals, paginated) |
/api/bridge/activity/:txId | GET | One bridge transfer by RougeChain tx id |
/api/bridge/withdrawals/:txId | DELETE | Fulfill withdrawal |
/api/bridge/btc/deposit-address | POST | Per-recipient BTC deposit address (qBTC) |
/api/bridge/xrge/config | GET | XRGE bridge config |
/api/bridge/xrge/claim | POST | Claim XRGE deposit |
/api/bridge/xrge/withdraw | POST | Withdraw XRGE to EVM |
/api/bridge/xrge/withdrawals | GET | List XRGE withdrawals |
/api/bridge/xrge/withdrawals/:txId | DELETE | Fulfill XRGE withdrawal |
Shielded Transactions (suspended since block 245)
The V1 shielded pool is suspended:
shield,shielded_transferandunshieldare refused (this transaction type is suspended) and a block carrying them is invalid. The mainnet pool is empty (shielded_supply0). A redesigned pool (V2) is in development and unaudited — see Status.
| Endpoint | Method | Description |
|---|---|---|
/api/v2/shielded/shield | POST | Refused: suspended |
/api/v2/shielded/transfer | POST | Refused: suspended |
/api/v2/shielded/unshield | POST | Refused: suspended |
/api/shielded/stats | GET | Shielded pool statistics (pool total 0 on mainnet) |
/api/shielded/nullifier/:hash | GET | Check nullifier |
Rollup (research prototype — not part of consensus)
The rollup accumulator batches transfers in memory and proves them with a STARK, but nothing in consensus reads a batch: a submitted transfer moves no funds and enters no block.
| Endpoint | Method | Description |
|---|---|---|
/api/v2/rollup/status | GET | Rollup status |
/api/v2/rollup/batch/:id | GET | Get rollup batch |
/api/v2/rollup/submit | POST | Submit rollup transfer |
Governance (suspended since block 245)
On-chain governance (
create_proposal,cast_vote,execute_proposal,delegate,undelegate) is suspended: no block may carry these types, and none was ever used on mainnet. These read routes return empty lists on mainnet. Treasury decisions for Regenerate use the node-hosted Regenerate votes in the meantime.
| Endpoint | Method | Description |
|---|---|---|
/api/governance/proposals | GET | List all proposals |
/api/governance/proposals/:token | GET | Proposals by token |
/api/governance/proposal/:id | GET | Get proposal details |
/api/governance/proposal/:id/votes | GET | Get proposal votes |
Social
| Endpoint | Method | Description |
|---|---|---|
/api/social/track/:trackId/stats | GET | Get track stats (plays, likes, comments) |
/api/social/track/:trackId/comments | GET | Get track comments |
/api/social/artist/:pubkey/stats | GET | Get artist stats (followers, following) |
/api/social/user/:pubkey/likes | GET | Get user's liked track/post IDs |
/api/social/user/:pubkey/following | GET | Get user's followed artists |
/api/social/user/:pubkey/posts | GET | Get user's posts |
/api/social/post/:postId | GET | Get a single post with stats |
/api/social/post/:postId/stats | GET | Get post stats (likes, reposts, replies) |
/api/social/post/:postId/replies | GET | Get replies to a post |
/api/social/timeline | GET | Global timeline (newest first) |
/api/v2/social/play | POST | Record a play (signed) |
/api/v2/social/like | POST | Toggle like (signed) |
/api/v2/social/comment | POST | Post a comment (signed) |
/api/v2/social/comment/delete | POST | Delete a comment (signed) |
/api/v2/social/follow | POST | Toggle follow (signed) |
/api/v2/social/post | POST | Create a post (signed) |
/api/v2/social/post/delete | POST | Delete a post (signed) |
/api/v2/social/repost | POST | Toggle repost (signed) |
/api/v2/social/feed | POST | Get following feed (signed) |
Messenger
| Endpoint | Method | Description |
|---|---|---|
/api/messenger/wallets | GET | List messenger wallets |
/api/v2/messenger/wallets/register | POST | Register wallet (signed) |
/api/v2/messenger/conversations | POST | Create conversation (signed) |
/api/v2/messenger/conversations/list | POST | List conversations (signed) |
/api/v2/messenger/conversations/delete | POST | Delete conversation (signed) |
/api/v2/messenger/messages | POST | Send message (signed) |
/api/v2/messenger/messages/list | POST | List messages (signed) |
/api/v2/messenger/messages/read | POST | Mark as read (signed) |
/api/v2/messenger/messages/delete | POST | Delete message (signed) |
| Endpoint | Method | Description |
|---|---|---|
/api/v2/names/register | POST | Register mail name (signed) |
/api/v2/names/release | POST | Release a name (signed) |
/api/names/resolve/:name | GET | Resolve name → wallet |
/api/names/reverse/:walletId | GET | Reverse lookup → name |
/api/v2/mail/send | POST | Send encrypted mail (signed) |
/api/v2/mail/folder | POST | Get inbox/sent/trash (signed) |
/api/v2/mail/message | POST | Get single mail item (signed) |
/api/v2/mail/read | POST | Mark as read (signed) |
/api/v2/mail/move | POST | Move to folder (signed) |
/api/v2/mail/delete | POST | Delete permanently (signed) |
Push Notifications
| Endpoint | Method | Description |
|---|---|---|
/api/push/register | POST | Register push token (PQC-signed) |
/api/push/unregister | POST | Unregister push token (PQC-signed) |
P2P
| Endpoint | Method | Description |
|---|---|---|
/api/peers | GET | List known peers |
/api/peers/register | POST | Register as peer |
/api/blocks/import | POST | Import block from peer |
/api/tx/broadcast | POST | Receive broadcasted tx |
Authentication
If a node is started with --api-keys, most REST routes require a key — reads included, not just writes. Exempt are /, /api/health, /api/stats, /api/v2/*, /api/bridge/*, /api/messenger/*, /api/mail/*, /api/names/* and the faucet. Send the key as X-API-Key or Authorization: Bearer:
curl -H "X-API-Key: your-api-key" http://127.0.0.1:5101/api/blocks
The public endpoints (api.rougechain.io, testnet.rougechain.io) do not require a key.
Rate Limiting
Rate limiting is disabled by default (all limits 0 = unlimited). Limits are per minute and tiered:
- Tier 1 (Validators): Proven via
X-Validator-Key/X-Validator-Sig/X-Validator-Tsheaders (the signed timestamp must be within 30 seconds) —--rate-limit-validator - Tier 2 (Registered peers): Recognized by IP —
--rate-limit-peer - Tier 3 (Public): GET requests use
--rate-limit-read-per-minute, all other methods--rate-limit-write-per-minute
--rate-limit-per-minute is a deprecated alias: when it is set and neither read nor write limit is, it applies to both (a deprecation warning is logged); explicit read/write limits take precedence.
Clients are keyed by the connecting IP. Behind a reverse proxy on the same host, start the node with --trust-proxy (env QV_TRUST_PROXY=true): requests whose TCP peer is loopback are then keyed by X-Real-IP, else the rightmost X-Forwarded-For entry; requests from any other peer always use the socket IP. Every route is rate-limited, including the peer routes /api/finality/* (which stay API-key exempt).