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.
2 THE WORK
argon2id with bits leading zero bits:
password x, y uint16 little-endian each
r g b 3 bytes
nonce uint64 little-endian
salt epoch, 16 bytes hex-decoded
t=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).
200 on the board
400 no real work in it. 20 of those in
10 s and your IP waits a minute (429).
409 epoch gone, solution reused, or the price rose
while you worked (new bits in the body). Ask again.
403 the board is closed
READING
GET /api/board gzip RGB, width*height*3, row-major
GET /api/leaders top 10 names by pixels held
GET /api/ws websocket, lines of "x,y,rrggbb,name";
"ping" keepalive, "reload" refetch board
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.