🎨 Express yourself on the blockchain, one pixel at a time.
pXiel is a decentralized collaborative pixel art canvas built on the Xian blockchain. Paint pixels, create art, and leave your mark forever on an immutable, shared canvas.
- Decentralized Canvas: Every pixel is recorded on-chain
- Real-time Collaboration: See pixels appear as transactions land
- Smooth Controls: Zoom, pan, and paint with a simple UI
- Wallet Integration: Connect your Xian wallet to participate
- 1 XIAN per pixel: Frontend passes value; contract enforces the fee
- Frontend: Next.js 14, React 18
- Styling: Bulma
- State: Zustand
- Indexing: Apollo Client (GraphQL)
- Blockchain: Xian Network + Wallet Extension
- Node.js 18+
- Xian Wallet Extension installed
- Access to Xian testnet funds
Create .env.local in the project root (values shown are sensible defaults):
# RPC and WebSocket
NEXT_PUBLIC_XIAN_RPC=https://testnet.xian.org
NEXT_PUBLIC_XIAN_WS_URL=wss://devnet.xian.org/websocket
# Canvas contract + settings
NEXT_PUBLIC_CANVAS_CONTRACT=con_pixel_canvas4
NEXT_PUBLIC_CANVAS_SIZE=500 # default is 32 if unset
NEXT_PUBLIC_PIXEL_PRICE_WEI=1000000000000000000 # 1 XIAN in weiNotes:
- The app has built-in defaults; env vars let you point to custom endpoints/contracts.
- The WebSocket monitor subscribes to
tm.event='Tx'and filters bycontractto stream paint events.
- Install dependencies
npm install- Start the dev server (port 4545)
npm run devOpen http://localhost:4545.
- Connect your Xian wallet
- Choose a color
- Click a pixel to paint (wallet will prompt; 1 XIAN per pixel)
- Navigate the board:
Ctrl + Scrollto zoomCtrl + Dragto pan
Painted pixels appear in near real-time as transactions are observed via WebSocket.
- Contract name from
NEXT_PUBLIC_CANVAS_CONTRACT(default:con_pixel_canvas4) - Exposes a
paintmethod accepting coordinates and color - Enforces a 1 XIAN fee per pixel (frontend also sends
value)
npm run dev— Next.js dev server on port 4545npm run build— Production buildnpm run start— Start production server on port 4545npm run lint— Lint the project
MIT