Skip to content

flothjl/pow-draw

Repository files navigation

Nostr Paint

https://powdraw.nostronomy.com/

A collaborative pixel art web application powered by the Nostr protocol and proof-of-work!

What is this?

Nostr Paint is a decentralized, real-time pixel art canvas. Anyone can place a pixel on the board using their Nostr key, with each pixel's "ownership" protected by proof-of-work (PoW). Outwork someone's pixel by publishing a new pixel with higher difficulty!

Features

  • Collaborative Canvas: 40x40 grid, everyone shares the same board.
  • Nostr Integration: Each pixel change is a Nostr event, relayed and stored across public relay servers.
  • Proof-of-Work Game: Only the pixel with the highest PoW at a coordinate prevails.
  • NIP-07 Support: Use your browser Nostr extension (like Alby or Nos2x) to publish pixels.
  • Pixel Details: Hover over any pixel to see owner, PoW, and a link to the Nostr note.
  • Advanced Mode: Increase PoW difficulty manually to outbid others.
  • Open Source, Minimal, Fast: Built with React, Vite, and TypeScript.

Development

  1. Clone the repo:

    git clone https://github.com/flothjl/nostr-paint.git
    cd nostr-paint
  2. Install dependencies:

    pnpm install
  3. Run the app:

    pnpm dev
  4. Open your browser at http://localhost:5173

Usage

  • Connect Nostr: Ensure you have a NIP-07 compatible extension installed/enabled.
  • Pick a Pixel: Click any square, choose a color, write an optional message.
  • Publish: Optionally enable advanced mode to add extra proof-of-work.
  • See Live Updates: Pixels from all users appear in realtime.

How it Works

  • Event Format: Each pixel update is a Nostr event tagged with coordinates and color.
  • Relays: Uses popular Nostr relays like wss://relay.damus.io, wss://nos.lol, etc.
  • PoW Rules: A pixel can only be replaced by a new event with a higher proof-of-work nonce.
  • Persistence: The board state is reconstructed from live relay events.

Tech Stack

  • React + TypeScript + Vite
  • Tailwind CSS UI
  • nostr-tools

License

MIT

About

Stupid game built on nostr that allows users to fight for pixel ownership via proof of work. Highest work wins!

Topics

Resources

Stars

Watchers

Forks

Contributors