P200 CANVAS
API
1 THE PRICE
GET /api/challenge?x=10&y=20
{"epoch":"<32 hex>","bits":20}
bits = leading zero bits you owe. Each one doubles the work.
A repaint inside heat_window_s adds a bit, up to max_extra_bits; left alone, it loses one per window.
The epoch rotates every epoch_s; the last one still pays.
Live values: /api/config
2 THE WORK
argon2id with bits leading zero bits:
passwordx, y uint16 little-endian each
r g b 3 bytes
nonce uint64 little-endian
saltepoch, 16 bytes hex-decoded
paramst=1 m=pow_kib KiB p=1 32 bytes out
Python: argon2-cffi. JS: hash-wasm. Go: x/crypto.
Bound to pixel and colour. Each solution pays once.
3 THE PAINT
POST /api/paint
{"x":10,"y":20,"color":"ff8800","epoch":"..","nonce":123,"name":"yours"}
name is optional: 1-16 of A-Z a-z 0-9 space _ . -
It puts you on the leaderboard. Slurs and obscenities are refused (400).
200on the board
400no real work in it. 20 of those in 10 s and your IP waits a minute (429).
409epoch gone, solution reused, or the price rose while you worked (new bits in the body). Ask again.
403the board is closed
READING
GET /api/boardgzip RGB, width*height*3, row-major
GET /api/leaderstop 10 names by pixels held
GET /api/wswebsocket, lines of "x,y,rrggbb,name"; "ping" keepalive, "reload" refetch board
EXTRAS
GET /api/statspaints, watching, leaders and the recent-paints feed
GET /api/heatgzip, width*height bytes: extra bits each pixel costs right now
GET /api/pixel?x=&y=colour, current owner and price of one pixel
PYTHON CLIENT ............ 300
pip install argon2-cffi
python3 client.py URL 10 20 ff8800
python3 client.py URL --image logo.png 100 100
The slow obvious version. Faster is the game. download client.py