Blocks API

Endpoints for querying block data on RougeChain.

Get Blocks

GET /api/blocks?limit=50&offset=0

Query Parameters

ParameterTypeDefaultDescription
limitnumber50Maximum blocks to return
offsetnumber0Pagination offset

Response

{
  "blocks": [
    {
      "version": 1,
      "header": {
        "version": 1,
        "chainId": "rougechain-devnet-1",
        "height": 42,
        "time": 1706745600000,
        "prevHash": "abc123...",
        "txHash": "def456...",
        "proposerPubKey": "ghi789..."
      },
      "txs": [...],
      "proposerSig": "...",
      "hash": "xyz..."
    }
  ],
  "total": 12345
}

Block Fields

FieldTypeDescription
versionnumberBlock format version
header.heightnumberBlock number
header.timenumberTimestamp (ms since epoch)
header.prevHashstringHash of previous block
header.txHashstringMerkle root of transactions
header.proposerPubKeystringValidator who proposed this block
txsarrayTransactions included in this block
proposerSigstringML-DSA-65 signature by the proposer
hashstringSHA-256 hash of this block

Block Summary

GET /api/blocks/summary

Returns a lightweight summary of recent blocks, suitable for charts and dashboards.

Response

{
  "blocks": [
    {
      "height": 42,
      "time": 1706745600000,
      "txCount": 5,
      "proposer": "abc123..."
    }
  ]
}

Import Block (P2P)

Used by peer nodes to propagate blocks.

POST /api/blocks/import
Content-Type: application/json

See Peers API for details.


Block Verification

Every block is verified by receiving nodes:

  1. Hash check — Recompute the block hash and compare
  2. Signature check — Verify ML-DSA-65 signature against the proposer's public key
  3. Height check — Must extend the current chain tip by exactly 1
  4. Previous hash — Must reference the current tip's hash
  5. Transaction validity — All transactions must have valid signatures and sufficient balances