primer · onchain

Five onchain primitives, demystified.

Every idea in this repo leans on one of five Hedera primitives. Each one runs against Hedera testnet (free HBAR from the portal faucet) so you can ship a verifiable demo with fixed sub-cent fees and a HashScan receipt for every action.

Hitting a revert with no message, or a payment that "succeeded" but never landed? Read the EVM ↔ native seam rules — address forms, gas limits and revert decoding.

The four secrets

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

  • HEDERA_OPERATOR_IDTestnet account id (0.0.xxxxxx). Create and fund it free at the Hedera portal faucet.open ↗
  • HEDERA_OPERATOR_KEYECDSA private key for that account, copied from the portal dashboard.open ↗
  • REOWN_PROJECT_IDFree project id that powers the HashPack pairing modal.open ↗
  • PINATA_JWTPin media and metadata to IPFS.open ↗
  • HEDERA_RPC_URLOptional. Defaults to the public Hashio relay at https://testnet.hashio.io/api.
wallet UX

Magic Link email wallet

249 ideas use this
kernel
a Magic Link embedded wallet created from an email OTP, signing over the Hedera JSON-RPC relay (chainId 296) at fixed sub-cent fees — no seed phrase, no extension, no gas estimator
how it drives the UI
a one-tap 'Sign in with email' that drops the user in with their 0.0.x account id and EVM address already on screen, plus HBAR/USDC balances and faucet links
x402 native

Hedera testnet + x402 paywall

996 ideas use this
kernel
an x402 v2 paywall metering access at 0.01 HBAR or 0.01 HTS USDC (token 0.0.429274) per call, paid from the embedded wallet through the relay and verified by a self-hosted facilitator against the Hedera mirror node
how it drives the UI
a 'pay 0.01 HBAR or USDC to unlock' button with a live flow log and a HashScan link for every settlement
agent rails

Agentic commerce on Hedera (A2A · AP2 · UCP)

1000 ideas use this
kernel
an agent-to-agent negotiation loop — A2A 0.3 JSON-RPC tasks carrying AP2 Intent / Cart / Payment mandates, or a UCP signed checkout under RFC 9421 — settled with x402 in HBAR or HTS USDC on Hedera testnet and, where authorisation itself is on-chain state, bound by a bespoke mandate-vault contract verified on HashScan
how it drives the UI
an agent flow log that shows the offer, the counter, the signed cart, the mandate check and the settled payment, every artifact linked to HashScan