BasePaint ========= BasePaint is an art project where hundreds of people from all over the world co-create pixel art together. Every day there's a new palette and theme. Artists have 24 hours to complete each canvas. After that the canvas goes on sale for another 24 hours. The profits from the sales are split fairly between the artists. Artists need brushes to participate, and each brush holds a fixed number of pixels it can contribute per day. BasePaint is powered by Base -- Ethereum L2 blockchain. Each canvas, artists and their profits are stored on chain. BasePaint.xyz is a web app that interacts with smart contracts to display the data and prepare transactions. All BasePaint artwork is released under CC0 (public domain) -- you're free to use, remix, and build on it without permission or attribution. Smart contracts =============== Source code: https://github.com/BasePaint/basepaint-contracts - BasePaint: `0xBa5e05cb26b78eDa3A2f8e3b3814726305dcAc83` -- tracks artwork and earnings - BasePaintBrush: `0xD68fe5b53e7E1AbeB5A4d0A6660667791f39263a` -- NFT required to participate and holds pixel rate limit - BasePaintWIP: `0xE6249eAfdC9C8a809fE28a5213120B1860f9a75f` -- each contribution can be minted separately - BasePaintRewards: `0xaff1A9E200000061fC3283455d8B0C7e3e728161` -- referral program - BasePaintBrushEvents: `0xb152f48F207d9D1C30Ff60d46E8cb8c1a5d00dEC` - aux contract to help with indexing brushes - BasePaintAnimation: `0xC59F475122e914aFCf31C0a9E0A2274666135e4E` -- NFT derrivative project for timelapse animations, minted by burning canvases - BasePaintMetadataRegistry: `0x5104482a2Ef3a03b6270D3e931eac890b86FaD01` -- theme names and palettes - BasePaintSubscription: `0x75CF063a65d361527180805b244bC51c1deAb075` -- canvas futures Referral program ================ Anyone can earn 50% of the protocol fee on mints they refer -- no signup required. Append `?referrer=` to any BasePaint URL (e.g. https://basepaint.xyz/?referrer=0xYourAddress). The address is remembered for 30 days, and when a visitor mints, the app routes the transaction through `BasePaintRewards.mintLatest()` with your address as the referrer, sending you half the protocol fee in ETH. Build your own client and pass the referrer directly to earn on every mint you drive. API === - https://graphql.basepaint.xyz -- GraphQL server with indexed smart contract events, themes, palettes, etc. - https://basepaint.xyz/api/theme/DAY -- JSON theme for a day (CORS-enabled): `{ theme, proposer, size, palette }` where `palette` is an array of hex colors. - https://basepaint.net/v3/XXXX.png -- final artwork image for that day (zero-padded day number) - https://basepaint.net/animations/XXXX.mp4 -- timelapse animation of painting process (zero-padded day number) - https://basepaint.xyz/api/art/image?day=painting&scale=1 -- for the current canvas state Days & canvases =============== Everything is keyed by "day", a 1-based integer. Day 1 started at Unix time `1691599315`, and each day lasts exactly 86400s (24h): `currentDay = floor((now_seconds - 1691599315) / 86400) + 1`. Each day a canvas is painted for 24h, then flips to a 24h sale window at ~16:42 UTC. Canvas dimensions depend on the day: `size` is 144x144 for days 1-365, and 256x256 from day 366 onward. Use `size` when decoding stroke coordinates or rendering. GraphQL data model ================== The indexer exposes the full onchain history. Core entities: `Canvas` (one per day: theme name, palette, size, pixel/artist/mint/burn counts, earnings), `Stroke` (individual paint actions -- the pixel firehose), `Contribution` (an artist's pixels+earnings on a given day), `Account`, `Brush`, and `Withdrawal`. Queries support `where`/`orderBy` filters and cursor pagination. Don't hardcode assumptions -- the schema is introspectable. Point your agent/tooling at GraphQL introspection on https://graphql.basepaint.xyz to discover exact fields and filters. Reference indexer implementation: https://github.com/BasePaint/basepaint-ponder Stroke format ============= A `Stroke.data` is a hex string encoding one or more pixels. Skip the leading `0x`, then read in 6-hex-char (3-byte) chunks: byte 0 = x, byte 1 = y, byte 2 = palette color index. Coordinates are 0-based from the top-left; a canvas is `size` x `size` pixels (see `Canvas.size` / the theme API). The color index maps into that day's `palette` array. Replaying all strokes for a day in order reconstructs the final artwork. Building on BasePaint? ====================== We love seeing derivative apps and would like to gauge (roughly) how much traffic they drive. If you build something, drop this 1x1 tracking pixel into your pages: Set `ref` to a short label for your app. It's completely optional, sends no personal data, and just helps us notice and celebrate what people are creating. If your site supports Webmention, you can also let us know you've linked to us: POST `source` (your page) and `target` (the basepaint.xyz URL you linked) as form-encoded fields to https://basepaint.xyz/api/webmention (also advertised via ``). Ecosystem repos =============== - https://github.com/BasePaint/basepaint-contracts -- Solidity smart contracts - https://github.com/BasePaint/basepaint-ponder -- indexing server (ponder.sh) behind the GraphQL API - https://github.com/BasePaint/basepaint-mini -- ultra-minimal onchain-only dApp client (reads directly from contracts, uses no APIs); a curiosity, not a template to fork - https://github.com/BasePaint/bpverify-cli -- CLI to verify a day's final image Design System ============= The website built for BasePaint should reflect look & feel of the BasePaint app similar to https://basepaint.xyz/gallery. The website should always have a stable header with navigation and a link back to BasePaint's main website: https://basepaint.xyz/ See https://basepaint.xyz/brand for official logos (downloadable SVGs), brand colors, and fonts. Font families used: - Roboto Mono https://fonts.google.com/specimen/Roboto+Mono - MEK Sans https://www.mek.gallery/project/font-meksans-otf - MEK Mono https://www.mek.gallery/project/mekmode-otf Primary colors - #1E2735 for background - #ffffff for foreground text - #fde047 for accent text - #073eb1 for headers