Skip to content

Shared Bitcoin Canvas - Collaborative pixel art on Bitcoin L1 with NFT minting

Notifications You must be signed in to change notification settings

PrestoAlex/SatoshiArt

Repository files navigation

🎨 SatoshiArt β€” Bitcoin-Native Shared Pixel Canvas

Paint your mark on Bitcoin. Forever. On-chain.

SatoshiArt is a decentralized shared pixel canvas on Bitcoin Layer 1 via OP_NET.
Users pay satoshis to choose a color and paint one pixel on a global 64Γ—64 canvas.
Every pixel, every painter, every block β€” stored permanently on-chain. No bridges. No EVM.


πŸ–ΌοΈ What is it?

  • 64Γ—64 canvas = 4,096 pixels of permanent Bitcoin history
  • Pay sats β†’ get color β†’ paint forever
  • Color rarity system β€” Common / Rare / Legendary
  • Live leaderboard of top painters
  • Activity feed showing real-time canvas evolution
  • Zero centralization β€” all state lives on Bitcoin L1

🎨 Color Tiers

Tier Colors Cost Examples
Common 8 1,000 sats Snow, Void, Crimson, Ocean...
Rare 5 5,000 sats Bullion, Cyan Storm, Hot Pink...
Legendary 3 25,000 sats Satoshi (orange), Neon Pulse, Diamond

πŸš€ Quick Start (Frontend)

cd SatoshiArt
npm install
npm run dev
# β†’ http://localhost:3001

Frontend works in demo mode without a deployed contract.
Canvas state is stored in localStorage during demo.


πŸ“¦ Project Structure

SatoshiArt/
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ App.jsx                  # Root layout (left/center/right panels)
β”‚   β”œβ”€β”€ main.jsx                 # React entry point
β”‚   β”œβ”€β”€ index.css                # Tailwind + custom utilities
β”‚   β”œβ”€β”€ data/colors.js           # 16-color palette + tier definitions
β”‚   β”œβ”€β”€ hooks/
β”‚   β”‚   β”œβ”€β”€ useWallet.js         # OP_NET wallet connection hook
β”‚   β”‚   └── useCanvas.js         # Canvas state, paint logic, leaderboard
β”‚   β”œβ”€β”€ services/
β”‚   β”‚   └── contractService.js   # OP_NET SDK integration (ESM)
β”‚   └── components/
β”‚       β”œβ”€β”€ Header.jsx           # Logo, wallet button, stats badge
β”‚       β”œβ”€β”€ Canvas.jsx           # HTML5 Canvas with zoom/pan
β”‚       β”œβ”€β”€ ColorPicker.jsx      # Tiered color grid + paint button
β”‚       β”œβ”€β”€ StatsBar.jsx         # Total paints, treasury, artists
β”‚       β”œβ”€β”€ Leaderboard.jsx      # Top painters ranking
β”‚       β”œβ”€β”€ ActivityFeed.jsx     # Real-time paint event feed
β”‚       └── Toast.jsx            # Notification system
β”œβ”€β”€ contracts/
β”‚   β”œβ”€β”€ src/art/
β”‚   β”‚   β”œβ”€β”€ SatoshiArtContract.ts # AssemblyScript smart contract
β”‚   β”‚   └── index.ts              # Entry point + abort handler
β”‚   β”œβ”€β”€ asconfig.json            # Build config (opnet-transform required)
β”‚   β”œβ”€β”€ package.json             # Contract dependencies
β”‚   β”œβ”€β”€ deploy.ts                # Deployment script (tsx)
β”‚   └── .env.example             # Mnemonic + RPC config template
β”œβ”€β”€ index.html                   # App entry + contract address config
β”œβ”€β”€ package.json
β”œβ”€β”€ vite.config.js
β”œβ”€β”€ tailwind.config.js
└── README.md

πŸ”— OP_NET Contract

Contract Methods

Write:

Method Args Cost Description
paintPixel pixelIndex: u16, colorId: u8 color fee in sats Paint one pixel

View:

Method Returns Description
getPixelColor(index) colorId: u256 Color at pixel (0 = unpainted)
getPixelPainter(index) painter: u256 Last painter address
getPixelBlock(index) blockNum: u256 Block when painted
getTotalPaints() u256 Global paint count
getTreasury() u256 Total fees collected (sats)
getPaintFeeCommon() u256 1,000 sats
getPaintFeeRare() u256 5,000 sats
getPaintFeeLegendary() u256 25,000 sats

Contract Address

SatoshiArt Contract: window.SATOSHI_ART_CONTRACT

To use with a deployed contract, set the contract address in your environment:

window.SATOSHI_ART_CONTRACT = 'your-contract-address-here';

Current Status: Demo mode (no contract deployed)


Quick Start (Frontend)

cd SatoshiArt
npm install
npm run dev
# β†’ http://localhost:3001

Frontend works in demo mode without a deployed contract.
Canvas state is stored in localStorage during demo.


Deploy Contract

1. Install dependencies

cd contracts
npm install

2. Configure .env

cp .env.example .env
# Edit .env β†’ set MNEMONIC to your deployer wallet seed

3. Build WASM

npm run build
# β†’ build/SatoshiArt.wasm

4. Deploy to OP_NET Testnet

npm run deploy:ts
# Outputs: Contract address: opt1xxxxx...

5. Activate frontend

In index.html, set:

window.SATOSHI_ART_CONTRACT = 'opt1your-contract-address-here';

πŸ–±οΈ User Flow

Connect OP_NET Wallet
        ↓
Browse 16-color palette (Common / Rare / Legendary)
        ↓
Click pixel on 64Γ—64 canvas
        ↓
Click "Paint Pixel Β· X sats"
        ↓
OP_NET transaction signed in wallet
        ↓
Pixel color stored forever on Bitcoin L1
        ↓
Canvas updates Β· Leaderboard updates Β· Activity feed logs

πŸ—οΈ Roadmap

Phase 1 βœ… (MVP)

  • 64Γ—64 canvas with color tiers
  • OP_NET wallet + demo mode
  • Smart contract (paintPixel + view methods)
  • Leaderboard + activity feed
  • Zoom & pan

Phase 2 β€” DeFi Layer

  • Vault contract for collected fees
  • Reward distribution to active painters
  • Pixel = NFT-like asset (OP_20 token per coordinate)

Phase 3 β€” Social

  • History replay / timeline
  • Pixel ownership certificates
  • Twitter card preview per pixel
  • Mobile-optimized touch canvas

Phase 4 β€” Composability

  • Integration with BlockForge modules
  • Staking rewards for rare color holders
  • DAO voting on canvas rules

πŸ” Security

  • Anti-spam: each paint costs real sats (on-chain payment verification)
  • Anti-double-spend: OP_NET transaction model prevents replay
  • No centralized DB: all pixel state lives in contract storage
  • Failed TX: UI detects revert and shows error, canvas not updated

πŸ’‘ Pitch

Bitcoin has ~21M coins. SatoshiArt has 4,096 pixels.
Each one is a permanent mark on the world's most secure ledger.
Paint your name in Bitcoin history.


πŸ“œ License

MIT β€” build on top of it, fork it, remix it.


Built on OP_NET Β· Bitcoin Layer 1 Β· No bridges Β· No EVM

About

Shared Bitcoin Canvas - Collaborative pixel art on Bitcoin L1 with NFT minting

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors