ProofChain is a proof‑of‑existence dApp built on Ethereum Sepolia, letting users anchor document fingerprints (IPFS CIDs / hashes) on‑chain and verify them later via shareable links.
The frontend is a modern Next.js App Router app with a Web3 SaaS feel, and the backend logic is a simple, auditable Hardhat smart contract.
-
Proof creation
- Upload any file to IPFS (via Pinata).
- Get a CID and register it on Ethereum Sepolia with a human‑readable title.
- Transaction status + confirmations surfaced in the UI.
-
Verification
- Public verification page:
/verify/[proofId] - Shows title, owner address, timestamp, IPFS link.
- Copyable share link so anyone can independently verify proofs.
- Public verification page:
-
Dashboard
- Wallet‑gated
/dashboardpage. - Lists only proofs created by the connected wallet.
- On‑chain visualization: animated chain of blocks with Genesis block, pulsing glow, and data‑flow connectors.
- Wallet‑gated
-
UX / UI
- Modern, responsive layout (desktop + mobile).
- Navbar with routing: Home, Create, Verify, Dashboard, About.
- Wallet connect + disconnect (desktop + mobile).
- Clean dark mode‑friendly aesthetics (radial gradients, glassmorphism).
-
Smart contract
- Minimal
ProofRegistrycontract that stores:owner(address)ipfsHash(IPFS CID or hash)title(string)timestamp(uint256)
- Read helpers:
getProof(id)andgetProofs()for small datasets.
- Minimal
-
Frontend
- Next.js 16 (App Router)
- React + TypeScript
- Tailwind CSS v4 (inline
@theme) - wagmi v3 + viem + ethers v6
- WalletConnect, MetaMask / injected providers, Coinbase Wallet
-
Smart Contracts / Tooling
- Solidity
^0.8.20 - Hardhat +
@nomicfoundation/hardhat-toolbox - TypeChain
- Solidity
-
Infra
- Ethereum Sepolia network
- IPFS via Pinata
ProofChain/
contracts/
ProofRegistry.sol # Solidity contract
scripts/
deploy.ts # Hardhat deployment script
src/
app/
page.tsx # Landing page (/)
create/page.tsx # Create proof (/create)
verify/page.tsx # Verify by ID input (/verify)
verify/[id]/page.tsx # Public proof page (/verify/[id])
dashboard/page.tsx # Wallet dashboard + visualization
about/page.tsx # About + use cases
api/pinata/route.ts # IPFS upload API (Pinata)
layout.tsx # Root layout + NavBar + providers
globals.css # Tailwind + global styles
components/
NavBar.tsx
WalletStatus.tsx
FileUpload.tsx
ProofForm.tsx
ProofList.tsx
ProofChainVisualizer.tsx
lib/
abi/proofRegistry.ts # ABI + address helper
wagmi/config.ts # wagmi/viem client config
hardhat.config.ts
package.json
env.example
README.md # (this file)
- Node.js 18+
- npm
- Funded Sepolia wallet for deployment / interactions
- Pinata account (for IPFS uploads)
- Install dependencies
npm install- Configure environment variables
Copy the example file and fill in values:
cp env.example .env.localRequired values:
-
Frontend
NEXT_PUBLIC_SEPOLIA_RPC_URL– HTTPS Sepolia RPC endpointNEXT_PUBLIC_WALLETCONNECT_PROJECT_ID– WalletConnect Cloud project idNEXT_PUBLIC_PROOF_CONTRACT_ADDRESS– DeployedProofRegistryaddress
-
Hardhat / deployment
SEPOLIA_RPC_URL– Same or separate Sepolia RPC endpointPRIVATE_KEY– Deployer wallet private key (Sepolia)ETHERSCAN_API_KEY– Optional, for contract verification
-
IPFS / Pinata
PINATA_API_KEYPINATA_SECRET_API_KEY
npm run dev
# visit http://localhost:3000Changes are hot‑reloaded.
npm run test:contractsnpm run deploy:sepoliaAfter deployment, set:
NEXT_PUBLIC_PROOF_CONTRACT_ADDRESSto the printed contract address,- then restart
npm run dev.
(Optional) Verify on Etherscan:
cross-env TS_NODE_PROJECT=tsconfig.hardhat.json npx hardhat verify --network sepolia <deployed_address>- Connect a wallet via the navbar.
- Upload a file using the IPFS upload card (Pinata).
- Copy the resulting CID.
- In the proof form:
- Enter a Title (e.g., “NDA v1 PDF”).
- Paste the CID (or any hash).
- Click Register Proof to anchor it on Ethereum Sepolia.
/verify: enter a Proof ID and click Verify Proof to redirect./verify/[id]: public page that:- Validates ID using
proofCount. - Fetches proof via
getProof(id). - Displays title, owner, timestamp, IPFS link.
- Offers a Copy link button for sharing.
- Validates ID using
- Requires a connected wallet.
- Top: animated chain of cubes representing the wallet’s proofs.
- Genesis Block = first (oldest) proof.
- Pulsing glow + animated connectors to feel “on-chain”.
- Bottom: table/list of proofs filtered to the connected address.
npm run dev # Start Next.js dev server
npm run build # Build for production
npm run start # Start production server
npm run lint # Run ESLint
npm run hardhat # Run Hardhat CLI
npm run test:contracts # Run Hardhat tests
npm run deploy:sepolia # Deploy ProofRegistry to Sepolia- Only minimal metadata + hash/CID are stored on‑chain; documents themselves stay off‑chain.
- This is a demo‑grade contract and UI:
- No advanced access control.
- No gas optimizations or batching.
- For production:
- Consider multi‑network support (L2s).
- Add rate limiting & auth around the Pinata API route.
- Review and harden contract with audits.
MIT. See LICENSE (add one if not present).
Built with:
Proof-of-existence dApp built with Next.js 14 (App Router), wagmi + ethers v6, Tailwind CSS, and Hardhat. Deploys a ProofRegistry contract to Ethereum Sepolia to anchor document hashes or CIDs on-chain.
- Next.js 14 + TypeScript + App Router
- wagmi 3 + ethers v6 + React Query
- Tailwind CSS (v4, @import-based)
- Hardhat + @nomicfoundation/hardhat-toolbox
- Network: Ethereum Sepolia
src/app– UI pages and layoutsrc/components– Wallet UI and proof form/list componentssrc/lib/abi– Contract ABI + address helpersrc/lib/wagmi– wagmi client configurationcontracts– Solidity sources (ProofRegistry.sol)scripts– Hardhat deployment scriptstest– Hardhat tests
- Node.js 18+
- npm
- Funded Sepolia wallet (for deployment/interaction)
- Install dependencies
npm install- Copy env template and fill values
cp env.example .env.localRequired values:
NEXT_PUBLIC_SEPOLIA_RPC_URL– HTTPS RPC endpointNEXT_PUBLIC_WALLETCONNECT_PROJECT_ID– WalletConnect Cloud project idNEXT_PUBLIC_PROOF_CONTRACT_ADDRESS– Deployed ProofRegistry addressSEPOLIA_RPC_URL,PRIVATE_KEY,ETHERSCAN_API_KEY– used by Hardhat
- Run the web app
npm run dev
# open http://localhost:3000All Hardhat commands automatically use tsconfig.hardhat.json via cross-env.
- Run tests:
npm run test:contracts- Deploy to Sepolia:
npm run deploy:sepoliaAfter deployment, set NEXT_PUBLIC_PROOF_CONTRACT_ADDRESS to the printed address.
- Add to
.env.local:
PINATA_API_KEY=...
PINATA_SECRET_API_KEY=...
-
Use the "Upload to IPFS (Pinata)" widget in the UI to pin any file. Progress and resulting CID will be shown. Secrets stay server-side; the client only calls your
/api/pinataroute. -
Verify (optional):
cross-env TS_NODE_PROJECT=tsconfig.hardhat.json npx hardhat verify --network sepolia <address>- Ensure
NEXT_PUBLIC_PROOF_CONTRACT_ADDRESSpoints to a deployedProofRegistryon Sepolia. - Connect a wallet (injected, WalletConnect, or Coinbase Wallet).
- Submit a label and proof hash/CID; wait for confirmations.
- Recent proofs render in the list with submitter, timestamp, and stored hash.
- Contract is intentionally simple for demo purposes (stores small proof metadata on-chain).
- Tailwind v4 uses
@import "tailwindcss";and inline theme tokens; no config file is needed.