Monorepo for Aesthetic.Computer aesthetic.computer

Keeps: Current State Analysis (December 2025)#

Status: Mainnet Staging Active
Contract: KT1JEVyKjsMLts63e4CNaMUywWTPgeQ41Smi (v3)
Last Updated: December 31, 2025


Recent Changes (December 31, 2025) 🆕#

V3 Contract Deployed#

  • New contract KT1JEVyKjsMLts63e4CNaMUywWTPgeQ41Smi with owner-editable metadata
  • Contract has token_creators bigmap to track original minters
  • edit_metadata allows: admin, token owner, OR original creator

Client-Side Wallet Signing for Metadata Updates#

  • Server returns mode: "prepare" params for client to sign
  • User's wallet signs edit_metadata, preserving objkt.com "Created by" attribution
  • Fixed tokenId==0 bug (JS falsy check issue)

Token Owner Rebake Support#

  • Token owners (not just piece creators) can rebake bundles
  • Wallet connected at rebake time for ownership verification via TzKT
  • Ownership displayed in UI: "★ You own this" or "Owner: tz1abc..."

Metadata Sync Permissions#

  • Admin: Always allowed to sync
  • Original creator: Always allowed (preserves objkt attribution)
  • Token owner: Blocked by default (would change objkt "Created by")
  • Added allowOwnerEdit flag for future use (contract supports it)
  • Error explains why token owners can't sync + shows original minter address

Environment Fixes#

  • Added OVEN_URL=https://localhost:3002 to dev environment
  • Fixed TZKT_API undefined in keep-update.mjs

Recent Changes (December 30, 2025) 🆕#

Light/Dark Theme Support#

  • Added export const scheme = { dark: {...}, light: {...} } to keep.mjs
  • Created PHASE_COLORS_DARK and PHASE_COLORS_LIGHT for step indicator colors
  • paint($) now uses $.dark to select palette: pal = $.dark ? scheme.dark : scheme.light
  • Background (wipe()) adapts to theme
  • Animated progress background adapts to theme

Button Palette Thematization#

All button color schemes now use centralized palette entries with dark/light variants:

Button Purpose
btnLink IPFS links (HTML, THUMBNAIL)
btnObjkt View on objkt marketplace
btnRebake Regenerate cached bundle
btnSync Sync chain metadata
btnWallet Wallet shortcut
btnContract Contract address link
btnTx Transaction hash link
btnPreview Preview piece (pulsing)
btnConfirm Keep It action (pulsing)
btnLogin Login prompt (pulsing)
btnCached Cached media indicator
btnNet Network toggle
btnView View on objkt after mint
btnToll Fee display
btnStaging Staging contract link
btnRetry Retry after error

Pulsing buttons (btnPreview, btnConfirm, btnLogin) use normalBase property for animation calculations while hover and disabled come directly from palette.

Fee Reading from Contract#

  • keep-mint.mjs reads keep_fee from contract storage (was hardcoded 5tz)
  • UI shows actual fee from server with ?? 0 fallback

UI Polish#

  • Added "to keep on mainnet staging" text with clickable staging link
  • Fixed Sign Transaction detail text color (was too gray)

What's Already Implemented ✅#

Authentication & Authorization (keep-mint.mjs)#

  • JWT authentication via Auth0 (authorize())
  • Handle requirement - must have @handle to keep
  • Ownership verification - piece.user === user.sub check
  • Admin bypass for testing (hasAdmin())
  • Anonymous pieces blocked ("Log in and save it first")

Wallet Enforcement (keep-mint.mjs)#

  • Tezos wallet must be linked (userDoc.tezos.address)
  • Minting wallet MUST match linked wallet - prevents impersonation
  • Server-side minting with admin key for actual Tezos tx

Minting Flow (keep.mjs UI + keep-mint.mjs)#

  • 10-step timeline UI with progress feedback
  • SSE streaming for real-time updates
  • Bundle HTML generation (self-contained artifact)
  • Thumbnail WebP via oven (256×256 @ 2x = 512×512)
  • IPFS upload via Pinata
  • Duplicate prevention (content_hashes bigmap)
  • Already-minted detection with existing token info
  • Confirmation step before minting

Rebake Flow (keep.mjs + keep-mint.mjs)#

  • Regenerate bundle for already-minted piece (regenerate=true)
  • Cached IPFS media detection (skip if source unchanged)
  • ipfsMedia tracking in MongoDB
  • pendingRebake flag when bundle differs from on-chain

Metadata Update (keep-update.mjs)#

  • edit_metadata entrypoint call
  • Preserves original artist - fetches firstMinter from TzKT
  • Updates artifactUri, thumbnailUri, attributes on-chain
  • Admin-only (for now) - requires server signing key

Database Tracking (keep-confirm.mjs)#

  • Records successful mints in kidlisp collection
  • Stores kept object: tokenId, txHash, wallet, URIs, timestamps
  • Ownership verification before confirming

What's Actually Next 🎯#

✅ COMPLETED (December 31, 2025)#

  • V3 contract with owner/creator editable metadata
  • Client-side signing for edit_metadata (preserves attribution)
  • Token owner can rebake (regenerate bundle)
  • Sync restricted to original creator (protects objkt attribution)
  • Ownership display in UI

🚀 READY FOR PRODUCTION#

Before moving from staging to production contract:

  • Test full flow: mint → transfer → owner rebake → creator sync
  • Fix $roz attribution (sync with aesthetic.tez wallet)
  • Consider: Should we burn+remint test tokens or keep them?

📋 Missing Features from Plan#

  • keeps command to list user's minted tokens
  • keep $code already checks minted state and shows existing keep UI
  • Cancel button + Escape during preparation
  • Show estimated gas/fees before signing
  • Copy share link after mint

🎨 kidlisp.com Integration#

  • "Mint as Keep" button for logged-in users
  • "My Keeps" section
  • Gallery of recent keeps

🔧 Developer Experience#

  • Auto-restart site on Netlify function error
  • Better error messages in console
  • Site health monitoring in artery

Environment Variables (Already Configured)#

KEEPS_NETWORK=mainnet
KEEPS_CONTRACT=KT1EcsqR69BHekYF5mDQquxrvNg5HhPFx6NM
OVEN_URL=https://oven.aesthetic.computer
# Secrets in MongoDB 'secrets' collection:
#   pinata: { apiKey, apiSecret, jwt }
#   tezos-kidlisp: { address, publicKey, privateKey }

Files Reference#

File Purpose
system/netlify/functions/keep-mint.mjs Streaming SSE mint endpoint
system/netlify/functions/keep-update.mjs On-chain metadata update (prepare mode for client signing)
system/netlify/functions/keep-update-confirm.mjs Record successful metadata update (NEW)
system/netlify/functions/keep-confirm.mjs Record successful mint
system/public/aesthetic.computer/disks/keep.mjs Keep UI/flow (~3000 lines)
system/public/aesthetic.computer/lib/keep/tezos-wallet.mjs Beacon wallet
tezos/keeps.mjs CLI tool for admin ops