---
name: Badge NFT process
description: >-
  Use when the user wants a reproducible run of spinning digital badge videos
  (standard and premium tiers), with edition numbers, a contact sheet, and QA,
  and nothing is to be minted, uploaded, published or paid for until they say so.
---
# Badge NFT process

A method for rendering a numbered run of short, looping 3D spinning badge videos. In all copy, call them **badges**, never "coins."

Nothing in this skill mints, uploads, publishes, lists, or pays for anything. Never put a wallet address, seed, secret, or mint key in this file, in chat, or in metadata. The candidate reviews sample videos before a full run, and nothing goes live without their yes. Before any mint or sale of campaign badges, check whether they need a "Paid for by" disclaimer or count as contributions or merchandise under FEC rules; that is a compliance question, not a design call.

## What you fill in for this project
- A slogan, a candidate or cause line, brand colors, fonts you have the right to use, and the art for each tier's rim.
- Run number, edition sizes (for example a standard tier and a smaller premium tier), frame size, frame rate, and spin length.
- A project folder on the operator's computer (do not publish that path). Suggested layout: `art/`, `tools/`, one folder per tier, and a scratch `_qa/` folder.

## Standing rules
1. Wherever a format allows motion, a moving background (for example a looping neon horizon and grid) should run for the whole spin, not freeze. Stills can only show one frame, so the mp4 is the hero asset (`animation_url`). Stills are the flat face at the first frame.
2. The candidate signs off on a sample of each tier before you render the full run.
3. Re-rendering into a folder that already has pieces overwrites them. Clear the tier folders yourself before a fresh run.
4. Metadata should use relative file names for `image` and `animation_url` until real URLs exist at upload time — and upload only happens later, with the candidate's go.

## One-command shape
A wrapper script should: build any missing derived art (for example a dithered back-plate portrait, horizon frames), render every piece of every tier, make a contact sheet and a preview mp4 for each tier, and run automated QA.

Keep counts, colors, slogan, spin length, frame rate and parallelism as parameters, not hard-coded campaign values.

## Suggested tools in the project folder
- A script that turns a portrait photo into a crisp two-tone dithered bust (so dots stay sharp when scaled).
- A seamless looping background (size and frame count as parameters).
- A library for textures, text, rims, lighting and a real perspective projection (not a simple squash).
- A renderer, a contact-sheet script, a preview script, a QA script, and the wrapper.

You can write these in Python with ordinary image and video tools (for example NumPy, OpenCV or Pillow, and ffmpeg). A 3D suite is not required if a perspective warp is enough.

## How a piece is built
1. **Front texture** (rebuilt every frame): the current loop frame of the moving background fills the inner disc. On top go a static overlay, the rim, and the text: an arc slogan, a support line, a ribbon (tier name), and a number plate such as `#n OF N`. A premium tier can add a distinctive rim (for example a multi-color neon ring with a chasing light) and extra marks such as stars.
2. **Back texture**: a brand-color disc, the dithered portrait, the same rim, and the edition/run plate (for example `No. 001 / 100` and `RUN 01 • STANDARD`).
3. **Spin**: a perspective projection. The badge has thickness; the back texture is mirrored so it reads correctly from behind; only the face pointing at the camera is drawn; the edge is drawn as lit stacked slices (reeding, metal color by tier). Typical timing: a short hold on the front, an eased half turn, a short hold on the back, then an eased half turn, adding up to a seamless loop. The background loop should close on the same cycle. Add a sheen that moves with the angle, and a dark background with a soft glow.
4. Pipe frames into ffmpeg (H.264, square, for example 1080×1080, `yuv420p`, `+faststart`). Keep each file under a conservative cap (for example 25 MiB).
5. **JSON**: OpenSea-style metadata (`name`, `description`, `image`, `animation_url`, `attributes[]`) plus `edition`, `edition_size`, `run` and `tier`. No wallet fields.

## Art
Generate or supply rim art and a back-plate portrait once, then reuse them for every piece in the run. If you generate rims, use only the rim annulus and measure its centre; generated medallions are often off-centre. Write down the prompts and keep the files; re-running a generation will not match.

If the back plate uses a public-domain sculpture or other artwork, say so, and do not use a random found graphic you do not have rights to.

## QA checks
Automated, for every piece:
- All expected files exist (video, stills, JSON).
- JSON edition matches the file name.
- Video is the agreed codec, size and pixel format, with the faststart flag, and under the size cap.

Manual, on samples of each tier and on the widest numbers in the run:
- Frames across the spin: text reads correctly (not mirrored) on both faces; the edge is visible at 90°; nothing is left over at the edge-on frame.
- Full-resolution crops of front and back text are legible, with no garbled glyphs.
- The portrait looks right: dithered, face intact, no extra features.
- Frame 0 against the last frame shows a seamless loop.
- A contact sheet for each tier.

## Pitfalls already hit, and fixes
- Generated rims were not centred. Measure bounds with a non-black mask and a radial brightness profile, then set the rim radii from that.
- Thin neon read as pinstripes. Thicken the tubes, add a bright core and a soft bloom.
- Chrome text went low-contrast over a bright background. Put a dark blurred backing under each text layer.
- A colour regrade of the moving background looked cheap; keep it optional and off by default.
- A glow baked into a "plain" text alpha cannot be used as a body mask; rebuild the fill mask the same way the text layer is built.
- Watch out for shell builtin names when you pass duration in the environment (for example don't use `$SECONDS` as a variable name).
- Holding the background frames as high-precision floats burns RAM; store them as 8-bit.

## Hand off
Give the candidate the sample videos and contact sheets first. After they approve, render the full run and hand over the tier folders, previews and QA notes. Stop there until they give a separate go for any mint, upload, listing or sale.
