primer · onchain

Four onchain primitives, demystified.

Every idea in this repo leans on one of four web3 primitives. Each one runs against Avalanche Fuji (Coinbase's free L2 testnet) so you can ship a verifiable demo with zero hosting and zero gas spent by your users.

The five secrets

Add these in your Lovable project (Settings → Secrets) before pasting any mega-prompt:

  • METAMASK_PRIVATE_KEYExported from MetaMask. Fund on Avalanche Fuji via the Avalanche Fuji faucet.open ↗
  • AVALANCHE_FUJI_RPC_URLAlchemy Avalanche Fuji HTTPS endpoint (or https://api.avax-test.network/ext/bc/C/rpc).open ↗
  • ETHERSCAN_API_KEYEtherscan v2 — single key covers Snowtrace (chainId 43113).open ↗
  • PRIVY_APP_IDGoogle sign-in + sponsored Avalanche Fuji transactions.open ↗
  • PINATA_JWTPin to IPFS.open ↗
  • ChainAvalanche Fuji · chainId 43113 · explorer https://testnet.snowtrace.io

AI calls · Lovable AI Gateway

Any AI step in a mega-prompt runs through the Lovable AI Gateway using LOVABLE_API_KEY — auto-provisioned by Lovable, no signup, no key to paste. This is the primary path for every participant.

AISA_API_KEY is a personal fallback used only by the maintainer when Lovable AI credits run out. Participants can ignore it.

x402 native

Avalanche + x402 paywall

996 ideas use this
kernel
an x402 pay-per-use paywall on Avalanche Fuji — Privy embedded wallet signs EIP-3009 USDC authorizations, a same-origin proxy relays PAYMENT-SIGNATURE to a facilitator (PayAI) that settles 0.01 USDC and returns a Avalanche Fuji tx hash in PAYMENT-RESPONSE
how it drives the UI
a 4-step flow log (Challenge → Sign → Retry → Settle) that ends with a live Snowtrace tx link proving the micropayment cleared