Loop Provenance
Pin looped animations on IPFS to provide artists with immutable, reusable animation cycles.
IPFS via Pinata· decentralized storage
Section · Onchain
full primer →The primitive.
Every animation loop libraries artefact is pinned to IPFS through Pinata; filmmakers get a permanent CID and a public gateway preview instead of a fragile cloud URL.
Why this primitivePinata JWT enables permanent hosting and easy retrieval of loop animation assets.
Kernel
a Pinata JWT upload that pins images / JSON / manifests to IPFS and returns a permanent CID
Drives the UI as
a 'pinned to IPFS' chip with the CID and an ipfs.io gateway preview
Required keys.
LINEA_SEPOLIA_RPC_URL
Alchemy Linea Sepolia HTTPS endpoint. Create a free app → copy the HTTPS URL.
open ↗Add these in your Lovable project under Settings → Secrets before pasting the prompt below.
Appendix · Mega-prompt
The build prompt.
budget · 1 message
Paste into a fresh Lovable project. Make sure all five secrets above are set first. read the build strategy →
Build "Loop Provenance" in ONE Lovable message. Single-page demo.
CONCEPT
Pin looped animations on IPFS to provide artists with immutable, reusable animation cycles.
Discipline: Filmmaking & Animation (animation loop libraries).
Onchain primitive: IPFS via Pinata. Why this primitive: Pinata JWT enables permanent hosting and easy retrieval of loop animation assets.
5-CREDIT BUDGET (HARD LIMIT):
- ONE single-page app. No router, no Lovable Cloud, no database, no auth flows beyond Privy drop-in.
- ONE Solidity contract, <=80 lines, deployed to Linea Sepolia, verified on LineaScan.
- Privy is always the auth layer (Google login, embedded wallet). Users pay their own gas — Linea Sepolia gas is negligible (sub-cent), so no paymaster or sponsorship is needed.
- Pinata/IPFS only if the idea genuinely needs to store a file or metadata.
- At most ONE AI call per user action (use Lovable AI Gateway with LOVABLE_API_KEY if AI is part of the idea).
- Skip tests, skip CI, skip docs pages. Ship the demo, nothing else.
STACK
- React + Vite single page (the index route).
- SSR-safe Privy mount is mandatory. Never import @privy-io/react-auth at
module scope of a route file — it crashes SSR. Use
lazy(() => import('./privy-client-entry')) inside <ClientOnly> + <Suspense>,
and put <PrivyProvider> only inside privy-client-entry.tsx.
- PrivyProvider config MUST declare Linea Sepolia as the default AND only
supported chain — otherwise Privy defaults to Ethereum mainnet, refuses
switchChain(59141) silently, and sendTransaction hangs forever with the
button stuck on "Logging on chain…". Import lineaSepolia from viem/chains:
import { lineaSepolia } from 'viem/chains';
<PrivyProvider appId={import.meta.env.VITE_PRIVY_APP_ID}
config={{ loginMethods:['google','email'],
embeddedWallets:{ ethereum:{ createOnLogin:'users-without-wallets' } },
appearance:{ theme:'dark' },
defaultChain: lineaSepolia,
supportedChains: [lineaSepolia] }}>
- Read the embedded wallet from useWallets, not user.wallet:
const embedded = wallets.find(w => w.walletClientType === 'privy');
- Before every send, make sure the wallet is on Linea Sepolia:
if (embedded.chainId !== 'eip155:59141') await embedded.switchChain(59141);
- Send with chainId per-call. Users approve each tx and pay their own gas —
Linea Sepolia gas is negligible (sub-cent), so no sponsorship is needed:
await sendTransaction(
{ to, data, chainId: 59141 },
{ address: embedded.address }
);
- Do NOT pass `sponsor: true`, ZeroDev, SmartWalletsProvider, or a paymaster URL.
This app runs on Linea Sepolia; users pay the tiny gas themselves.
- src/lib/pinata.ts uploads via `fetch('https://api.pinata.cloud/pinning/pinFileToIPFS', { method:'POST', headers:{ Authorization: `Bearer ${import.meta.env.VITE_PINATA_JWT}` }, body: fd })`.
- Hardhat in /contracts (kept outside the Vite bundle). Install
`@nomicfoundation/hardhat-toolbox` AND `@nomicfoundation/hardhat-verify@latest`
(>=3.x — older versions still hit Etherscan v1 and fail with
"You are using a deprecated V1 endpoint, switch to Etherscan API V2").
- hardhat.config.cjs uses the Etherscan v2 shape with a customChains entry
for Linea Sepolia (LineaScan is on Etherscan Multichain — same API key):
require("@nomicfoundation/hardhat-toolbox");
require("@nomicfoundation/hardhat-verify");
module.exports = {
solidity: { version: "0.8.24", settings: { optimizer: { enabled: true, runs: 200 } } },
networks: { linea_sepolia: {
url: process.env.LINEA_SEPOLIA_RPC_URL, // Alchemy Linea Sepolia HTTPS URL, REQUIRED
accounts: [process.env.METAMASK_PRIVATE_KEY.startsWith("0x")
? process.env.METAMASK_PRIVATE_KEY : "0x" + process.env.METAMASK_PRIVATE_KEY],
chainId: 59141,
} },
etherscan: {
apiKey: { linea_sepolia: process.env.ETHERSCAN_API_KEY },
customChains: [{
network: "linea_sepolia",
chainId: 59141,
urls: {
apiURL: "https://api-sepolia.lineascan.build/api",
browserURL: "https://sepolia.lineascan.build",
},
}],
},
sourcify: { enabled: false },
};
- Deploy: `npx hardhat run scripts/deploy.cjs --network linea_sepolia`.
- Verify (run RIGHT AFTER deploy, no constructor args for these contracts):
`npx hardhat verify --network linea_sepolia <address>`
On success LineaScan returns "Successfully verified contract … on the block explorer"
and the source becomes readable at
`https://sepolia.lineascan.build/address/<address>#code`.
- Frontend reads: create a viem public client with the Alchemy URL —
`createPublicClient({ chain: lineaSepolia, transport: http(import.meta.env.VITE_LINEA_SEPOLIA_RPC_URL) })`
(import `lineaSepolia` from `viem/chains`). Expose the RPC to the client by
also setting VITE_LINEA_SEPOLIA_RPC_URL to the same value.
- Write the deployed address to `src/data/contract.json` so the UI links to
`https://sepolia.lineascan.build/address/<address>`.
CONTRACT (contracts/LoopProvenance.sol):
```solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.24;
/// @title CIDLogLoopProvenance
/// @notice Pin looped animations on IPFS to provide artists with immutable, reusable animation cycles.
/// @notice Built during the Creative AI & Quantum Hackathon organised by StreetKode Fam during Indian Krump Festival 14
contract CIDLogLoopProvenance {
event Logged(address indexed author, string cid, uint256 at);
/// @notice Built during the Creative AI & Quantum Hackathon organised by StreetKode Fam during Indian Krump Festival 14
function log(string calldata cid) external {
emit Logged(msg.sender, cid, block.timestamp);
}
}
```
USER FLOW
1. Land on page -> 'Sign in with Google' (Privy) -> embedded wallet auto-provisioned.
2. On submit, pin the animation loop libraries artefact to Pinata, then call `log(cid)` on the contract via Privy. Render the CID, IPFS gateway preview, and LineaScan tx link.
3. Footer renders: "Built during the Creative AI & Quantum Hackathon organised by StreetKode Fam during Indian Krump Festival 14"
REQUIRED SECRETS (Lovable -> Project Settings -> Secrets):
- METAMASK_PRIVATE_KEY Linea Sepolia deployer key. Fund it: https://www.hackquest.io/faucets/59141
- LINEA_SEPOLIA_RPC_URL Alchemy Linea Sepolia HTTPS endpoint (https://linea-sepolia.g.alchemy.com/v2/<key>). Create a free app at https://dashboard.alchemy.com/ -> copy the HTTPS URL. Public RPCs throttle under hackathon load — Alchemy is required.
- ETHERSCAN_API_KEY For `npx hardhat verify` — LineaScan is on Etherscan Multichain, so the same key works. Get: https://etherscan.io/myapikey
- PRIVY_APP_ID Google sign-in + embedded wallet. Docs: https://docs.privy.io/llms-full.txt
- PINATA_JWT IPFS uploads (only if app pins media). Docs: https://docs.pinata.cloud/llms-full.txt
CREDIT (must appear in UI footer AND as NatSpec on every deployed contract):
Built during the Creative AI & Quantum Hackathon organised by StreetKode Fam during Indian Krump Festival 14
Market sizing.
TAM
$250M
animation cycle marketplaces
SAM
$70M
loop library subscriptions
SOM
$8M
indie animator userbase
Indicative figures for hackathon pitches — refine with your own research before raising.
Adjacent entries.
storyboard management
FrameForge Archive
Securely store and share storyboards as immutable IPFS manifests to simplify team collaboration.
material asset libraryTextureVault
Pin and catalog textures on IPFS for reuse and verified provenance in animation projects.
scene version controlAnimScene Sync
Automatically pin scene JSON manifests to IPFS to track animation iterations and changes.
color study curationMoodboardChain
Create decentralized moodboards pinned to IPFS for collaborative color grading projects.