build strategy · onchain

Real onchain, four secrets, one build.

Every mega-prompt in this repo uses the same pattern, because it's the only pattern that lets a Lovable account ship a verifiable Sei Testnet demo in one shot.

Why Sei Testnet?

Sei is a parallelized EVM Layer 1 with 400ms finality and full Ethereum tooling compatibility. Sei Testnet (atlantic-2, chainId 1328) is free, funded by a public faucet, and inspectable on Seiscan. Gas costs a fraction of a cent, so users pay for their own transactions from the embedded wallet — send them to the faucet on first run. Standard Solidity, standard viem, standard Hardhat — just point the RPC at https://evm-rpc-testnet.sei-apis.com.

The recipe

recipe
# 1. In your Lovable project, add four secrets (Settings -> Secrets):
METAMASK_PRIVATE_KEY=0x...
SEI_TESTNET_RPC_URL=https://evm-rpc-testnet.sei-apis.com  # or Ankr/DRPC for heavy reads
PRIVY_APP_ID=...
PINATA_JWT=eyJhbGciOi...

# 2. Fund the MetaMask account on Sei Testnet (atlantic-2):
open https://sei.io/faucet
# Verify captcha -> Request SEI. One request per address per 24h.

# 3. In your Privy dashboard, add Sei Testnet (chainId 1328):
#    - RPC: https://evm-rpc-testnet.sei-apis.com
#    - Explorer: https://testnet.seiscan.io
#    - Toggle "Allow transactions from the client" ON
#    - The end user pays gas from their embedded wallet — no sponsorship policy.
#    - Direct users to https://sei.io/faucet so they can top up their embedded wallet.

# 4. Copy a mega-prompt from this repo into Lovable. One paste:
#    - scaffolds the React app
#    - writes the Solidity contract (with hackathon credit in NatSpec)
#    - deploys to Sei Testnet (atlantic-2)
#    - wires Privy social login (user-paid gas)
#    - pins generated assets to IPFS via Pinata
#    - exposes the contract address + Seiscan link in the UI

# 5. Open the live Seiscan link. Your demo is provably onchain.

1. The contract — credit baked in

Every Solidity file deployed from a Creative Blockchain prompt MUST carry the hackathon credit in NatSpec, so provenance lives onchain alongside the bytecode.

contracts/Provenance.sol
// contracts/Provenance.sol — every contract carries the hackathon credit in NatSpec
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;

/// @title Provenance
/// @notice Built during the Creative AI & Quantum Hackathon
/// @notice organised by StreetKode Fam during Indian Krump Festival 14
contract Provenance {
    event Logged(address indexed author, string cid, uint256 at);

    function log(string calldata cid) external {
        emit Logged(msg.sender, cid, block.timestamp);
    }
}

2. Hardhat config for Sei Testnet

Install @nomicfoundation/hardhat-ethers. Sei uses the standard EVM tooling — just add a network with chainId 1328 and Sei's public RPC.

hardhat.config.cjs
// hardhat.config.cjs — Sei Testnet (atlantic-2, chainId 1328)
require("@nomicfoundation/hardhat-ethers");

const pk = process.env.METAMASK_PRIVATE_KEY;

module.exports = {
  solidity: { version: "0.8.24", settings: { optimizer: { enabled: true, runs: 200 } } },
  networks: {
    seiTestnet: {
      url: process.env.SEI_TESTNET_RPC_URL || "https://evm-rpc-testnet.sei-apis.com",
      accounts: pk ? [pk.startsWith("0x") ? pk : "0x" + pk] : [],
      chainId: 1328,
    },
  },
  // Sei's Seiscan explorer does not have a Hardhat-compatible verification API.
  // Contracts are inspectable at https://testnet.seiscan.io/ without verification.
};

3. Deploy to Sei Testnet

scripts/deploy.cjs
// scripts/deploy.cjs — deploys to Sei Testnet
const hre = require("hardhat");
async function main() {
  const F = await hre.ethers.getContractFactory("Provenance");
  const c = await F.deploy();
  await c.waitForDeployment();
  const addr = await c.getAddress();
  console.log("deployed:", addr);
  // View on Seiscan: https://testnet.seiscan.io/address/<addr>
}
main().catch((e) => { console.error(e); process.exit(1); });

4. Pin assets to IPFS via Pinata

src/lib/pinata.ts
// src/lib/pinata.ts — pin a Blob to IPFS via Pinata JWT
export async function pinToIPFS(file: Blob, name = "artifact") {
  const fd = new FormData();
  fd.append("file", file, name);
  const r = await fetch("https://api.pinata.cloud/pinning/pinFileToIPFS", {
    method: "POST",
    headers: { Authorization: `Bearer ${process.env.PINATA_JWT}` },
    body: fd,
  });
  const { IpfsHash } = await r.json();
  return IpfsHash as string; // the CID
}

5. Sign in with Google via Privy

Import seiTestnet from viem/chains. Enable Sei Testnet (chainId 1328) as a supported chain in your Privy dashboard. The end user pays gas from their embedded wallet — no sponsorship policy — so link them to https://sei.io/faucet on first run.

src/main.tsx
// src/main.tsx — Privy social login on Sei Testnet (user pays gas)
import { PrivyProvider } from "@privy-io/react-auth";
import { seiTestnet } from "viem/chains";

<PrivyProvider
  appId={import.meta.env.VITE_PRIVY_APP_ID}
  config={{
    loginMethods: ["google", "email"],
    embeddedWallets: { ethereum: { createOnLogin: "users-without-wallets" } },
    defaultChain: seiTestnet,
    supportedChains: [seiTestnet],
  }}
>
  <App />
</PrivyProvider>

Hackathon rules of thumb

  • · One mega-prompt = one build message. Don't iterate the architecture, iterate the UI.
  • · Always show the live Seiscan link in the UI — that's your proof.
  • · Send new users to the Sei faucet on first run so their embedded wallet has gas.
  • · Pin every user-generated asset to IPFS the moment it's created.
  • · Add a "Built during the Creative AI & Quantum Hackathon — StreetKode Fam · Indian Krump Festival 14" line to your footer.