primer · onchain

Four onchain primitives, demystified.

Every idea in this repo leans on one of four web3 primitives. Each one runs against Base Sepolia (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 Base Sepolia via the Coinbase faucet.open ↗
  • BASE_SEPOLIA_RPC_URLAlchemy Base Sepolia HTTPS endpoint (or https://sepolia.base.org).open ↗
  • ETHERSCAN_API_KEYEtherscan v2 — single key covers BaseScan (chainId 84532).open ↗
  • PRIVY_APP_IDGoogle sign-in + sponsored Base Sepolia transactions.open ↗
  • PINATA_JWTPin to IPFS.open ↗
  • ChainBase Sepolia · chainId 84532 · explorer https://sepolia.basescan.org

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

Base + x402 paywall

996 ideas use this
kernel
an x402 pay-per-use paywall on Base Sepolia — 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 Base tx hash in PAYMENT-RESPONSE
how it drives the UI
a 4-step flow log (Challenge → Sign → Retry → Settle) that ends with a live BaseScan tx link proving the micropayment cleared