Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.generalmarket.io/llms.txt

Use this file to discover all available pages before exploring further.

Bitmap Submission

Reveal what you committed to. Submit your prediction bitmap to the oracle node. The bitmap must match the keccak256 hash you sealed on-chain — the moment where commitment becomes confession.

Submit Bitmap

POST /vision/bitmap Submits a player’s prediction bitmap off-chain. The oracle verifies that:
  1. The player is registered in the specified batch.
  2. keccak256(bitmap_bytes) matches the expected_hash.
  3. The expected_hash matches the player’s on-chain bitmap commitment.
If all checks pass, the bitmap is stored in memory and used during the next tick resolution.
player
string
required
The player’s Ethereum address (checksummed, with 0x prefix).
batch_id
number
required
The batch ID this bitmap is for. The player must have already joined this batch on-chain.
bitmap_hex
string
required
The raw prediction bitmap encoded as a hex string (with 0x prefix). Each bit represents a UP (1) or DOWN (0) prediction for the corresponding market in the batch. See Bitmap Encoding for the full format.
expected_hash
string
required
The keccak256 hash of the bitmap bytes (0x-prefixed, 66 characters). This must match the hash the player committed on-chain via joinBatch or updateBitmapHash.
curl -X POST https://generalmarket.io/api/vision/bitmap \
  -H "Content-Type: application/json" \
  -d '{
    "player": "0xAbC123...def",
    "batch_id": 1,
    "bitmap_hex": "0xff00ab",
    "expected_hash": "0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"
  }'

Response Fields

FieldTypeDescription
acceptedbooleanWhether the bitmap was accepted and stored
batch_idnumberThe batch ID the bitmap was stored for
playerstringThe player’s Ethereum address

Errors

StatusCondition
400Invalid player address, malformed bitmap hex, or invalid expected_hash format
400expected_hash does not match the player’s on-chain commitment
400keccak256(bitmap_bytes) does not match expected_hash
404Player is not registered in the specified batch
You must commit your bitmap hash on-chain before submitting the actual bitmap to this endpoint. The typical flow is:
  1. Encode your predictions into a bitmap (see Bitmap Encoding)
  2. Call joinBatch(batchId, deposit, stakePerTick, keccak256(bitmap)) on-chain
  3. Submit the raw bitmap to POST /vision/bitmap
If you need to update your predictions, call updateBitmapHash(batchId, newHash) on-chain first, then resubmit.