MVP for morechildsurgeries via Claude.ai

What I understand you’re building

Proof of Care is a verified-outcome payment system. The core mechanic:

  1. A child gets a unique ID (e.g. TZ-TON-2026-00421)
  2. Three video proofs are captured: BEFORE / DURING / AFTER
  3. Actors (outreach, surgeon, hospital, aftercare, verifier) earn tokens as steps complete
  4. Tokens only convert to real money after the full chain is verified
  5. Donors get an NFT receipt tied to the specific child they funded

Current state (MVP): Google Sheets + WhatsApp video proofs + fiat payments

Target state: Smart contracts + crypto wallets for actors + NFT donor receipts + on-chain proof anchoring + dashboard

Blockchain Recommendation: Base (Coinbase’s L2)

Here’s why Base is the right choice for Proof of Care specifically:

Cost — Gas fees are ~$0.001–$0.01 per transaction. At 1,000 children × ~10 on-chain events each, your total chain cost is under $100. Ethereum mainnet would be $5–$50 per transaction.

Stablecoin — USDC is native on Base (Coinbase is a USDC issuer). All actor payments and donor contributions stay in USD value. No volatility risk for a CSO saving for land.

Mobile wallets — Coinbase Smart Wallet lets a nurse in rural Tanzania create a wallet with just a phone number or email — no seed phrase, no technical knowledge. This is critical for your mobile-first actors.

Offramp — Coinbase has the best Africa offramp infrastructure (Yellow Card, Kotani Pay integrations) to convert USDC → mobile money (M-Pesa, MTN MoMo).

NFTs — ERC-721 is the gold standard. Donor NFTs will be compatible with every major wallet and marketplace.

Now I can see exactly how the system works. This is brilliant — the © symbol is a hash connector, and each column builds a growing chain of proof. Let me map it precisely before writing the contracts:

Col A: 11156TAN-ACH-F03-255078908780-© ← Child (ID + country + diagnosis + age/sex + phone hash)

Col B: ©-145LET-mhzNY2QZsh0-© ← Outreach (worker ID + YouTube video hash)

Column C- develops an AI marketing donor ask report

Col D: ©-234MAL-75-341-322=© ← Donor (donor ID + $ splits: outreach/surgery/aftercare)

Col E: A+B+D (×3 rows = Outreach/Hospital/Aftercare authorised)

Col G: ©-1234SEL-ELI-ACH-mhzNY2QZsh0-© ← Surgery (hospital + surgeon + procedure + video)

Col H: A+B+D+G ← Full chain through surgery

Col I: ©-221ZIL-NUR-22-mhzNY2QZsh0-© ← Aftercare (location + nurse + days + video)

Col J: Full chain including aftercare ← HOME CONFIRMED = outcome complete

Column K – Verification

Col L: POC Admin — rate, pay, star rating

What is built

ProofOfCareOutcome.sol — The heart. Every column in your spreadsheet maps to a function:

  • registerChild() → Col A (creates the first © hash)
  • submitOutreachProof() → Col B (extends hash + issues pending tokens)
  • authoriseDonor() → Col D/E (USDC into escrow, NFT minted, splits locked forever)
  • submitSurgeryProof() → Col G
  • submitAftercareProof() → Col I
  • submitHomeProof() → Col J (full chain complete)
  • verifyOutcome() → Col K (star rating + sign-off)
  • releasePayout() → Col L (all actors paid, all tokens unlock simultaneously)

The © concatenation becomes an on-chain keccak256 hash that grows identically to your spreadsheet chain.

ProofOfCareCoin.sol — Tokens stay PENDING (unspendable) until the full chain is verified. If an outcome fails or fraud is flagged, they expire to zero — never minted.

ProofOfCareNFT.sol — Donor NFT mints the moment USDC is deposited, then updates automatically at each proof stage. Fully on-chain SVG — no IPFS, no servers to go down. Shows the child ID, journey stage, star rating, and all three video links at completion.

Proof of Care — Smart Contracts

Network: Base (Coinbase L2)

Contract Overview

ProofOfCareCoin.sol    ERC-20 actor incentive tokens (POC)
ProofOfCareNFT.sol     ERC-721 donor journey receipts (POCJ)
ProofOfCareOutcome.sol Core outcome lifecycle + USDC escrow

Spreadsheet → Smart Contract Mapping

Spreadsheet ColumnFieldContract Function
Col A — Child11156TAN-ACH-F03-255078908780-©registerChild()
Col B — Outreach©-145LET-mhzNY2QZsh0-©submitOutreachProof()
Col C — POC-Donor StoryAI generated (off-chain)stored as metadata
Col D — Donor©-234MAL-75-341-322=©authoriseDonor()
Col E — Donor AuthorisingFull chain A+B+DchainHash computed
Col G — WHO Surgery©-1234SEL-ELI-ACH-mhzNY2QZsh0-©submitSurgeryProof()
Col H — Full chain+surgeryA+B+D+GchainHash updated
Col I — Aftercare Nursing©-221ZIL-NUR-22-mhzNY2QZsh0-©submitAftercareProof()
Col J — Home confirmedFull chainsubmitHomeProof()
Col K — VerifierNone / Sign-offverifyOutcome()
Col L — POC Admin PayRate and Pay ★★★★★releasePayout()

The © Hash Chain (on-chain equivalent)

In the spreadsheet, the © symbol concatenates each actor’s data into a growing proof string. On-chain, this becomes:

outcomeId        = keccak256(childId + country + diagnosis + demographics + phone + timestamp)
after outreach:  = keccak256(outcomeId + workerCode + videoId)
after donor:     = keccak256(prev + donorId + splits)
after surgery:   = keccak256(prev + hospitalCode + surgeonCode + procedure + videoId)
after aftercare: = keccak256(prev + location + nurseCode + days + videoId)
after home:      = keccak256(prev + "HOME" + videoId)

The final chainHash stored on-chain is the tamper-proof receipt of the entire journey. Anyone can verify it by replaying the events.

Outcome Stages

REGISTERED → Child ID assigned, actors set
OUTREACH_PROVEN   → BEFORE video submitted, outreach hash added
DONOR_AUTHORISED  → USDC escrowed, NFT minted, splits locked
SURGERY_PROVEN    → DURING video submitted, surgery hash added
AFTERCARE_PROVEN  → Recovery logged, aftercare hash added
HOME_CONFIRMED    → Child home, full © chain complete
VERIFIED          → Independent verifier sign-off
PAID              → All actors paid, tokens unlocked
FAILED            → Tokens expired, USDC returned to donor

Token Flow – example

Stage           Actor              Tokens (default)    Status
──────────────────────────────────────────────────────────────
Outreach        outreachWorker     200 POC     
Surgery         surgeon            1500 POC 
Hospital        hospital           600 POC 
Aftercare       aftercareNurse     300 POC 
Verifier        verifier           200 POC 
5-star bonus    surgeon            150 POC 
──────────────────────────────────────────────────────────────
                                   2750 POC 

→ All UNLOCK together when releasePayout() is called
→ All EXPIRE (worth zero) if flagOutcomeFailed() is called
→ Actors redeem POC tokens → POC sends USDC to named beneficiary
   (land seller, school, etc.) — NOT to actor directly


USDC Allocation Stack (default $600 outcome)

outreachBps:   1500  →  $90   (15%)  outreachWorker
surgeryBps:    5000  →  $150  (25%)  surgeon
                       $150  (25%)  hospital
aftercareBps:  1500  →  $90   (15%)  aftercareNurse
localAdminBps: 2000  →  $120  (20%)  hospital (admin)
─────────────────────────────────────────────────────
TOTAL:         10000 →  $600  (100%)

 

Deployment (Hardhat)

bash
# Install dependencies
npm install --save-dev hardhat @nomicfoundation/hardhat-toolbox
npm install @openzeppelin/contracts

# Deploy to Base Mainnet
npx hardhat run scripts/deploy.js --network base

deploy.js

javascript
const { ethers } = require("hardhat");

async function main() {
  const [deployer] = await ethers.getSigners();
  const POC_ADMIN = deployer.address;
  
  // Base USDC address
  const USDC_BASE = "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913";

  console.log("Deploying Proof of Care contracts...");
  console.log("Admin:", POC_ADMIN);

  // 1. Deploy POC Coin
  const Coin = await ethers.getContractFactory("ProofOfCareCoin");
  const coin = await Coin.deploy(POC_ADMIN);
  await coin.waitForDeployment();
  console.log("ProofOfCareCoin:", await coin.getAddress());

  // 2. Deploy POC NFT
  const NFT = await ethers.getContractFactory("ProofOfCareNFT");
  const nft = await NFT.deploy(POC_ADMIN);
  await nft.waitForDeployment();
  console.log("ProofOfCareNFT:", await nft.getAddress());

  // 3. Deploy Outcome (main contract)
  const Outcome = await ethers.getContractFactory("ProofOfCareOutcome");
  const outcome = await Outcome.deploy(
    POC_ADMIN,
    await coin.getAddress(),
    await nft.getAddress(),
    USDC_BASE
  );
  await outcome.waitForDeployment();
  console.log("ProofOfCareOutcome:", await outcome.getAddress());

  // 4. Grant roles — outcome contract can mint/burn coins and update NFTs
  const MINTER_ROLE = ethers.keccak256(ethers.toUtf8Bytes("MINTER_ROLE"));
  const BURNER_ROLE = ethers.keccak256(ethers.toUtf8Bytes("BURNER_ROLE"));
  const UPDATER_ROLE = ethers.keccak256(ethers.toUtf8Bytes("UPDATER_ROLE"));

  await coin.grantRole(MINTER_ROLE, await outcome.getAddress());
  await coin.grantRole(BURNER_ROLE, await outcome.getAddress());
  await nft.grantRole(MINTER_ROLE,  await outcome.getAddress());
  await nft.grantRole(UPDATER_ROLE, await outcome.getAddress());

  console.log("\n✓ All contracts deployed and roles configured");
  console.log("\nNext: Update .env with contract addresses and run verification");
}

main().catch(console.error);

 

hardhat.config.js

javascript
require("@nomicfoundation/hardhat-toolbox");
require("dotenv").config();

module.exports = {
  solidity: {
    version: "0.8.20",
    settings: { optimizer: { enabled: true, runs: 200 } }
  },
  networks: {
    base: {
      url: "https://mainnet.base.org",
      accounts: [process.env.DEPLOYER_PRIVATE_KEY],
      chainId: 8453
    },
    "base-sepolia": {   // ← test here first
      url: "https://sepolia.base.org",
      accounts: [process.env.DEPLOYER_PRIVATE_KEY],
      chainId: 84532
    }
  },
  etherscan: {
    apiKey: { base: process.env.BASESCAN_API_KEY }
  }
};

 

Wallet Setup for CSOs/Nurses (mobile-first)

Recommended: Coinbase Smart Wallet

  • Create at: wallet.coinbase.com
  • No seed phrase — uses passkey (fingerprint/face ID)
  • Works on any Android/iOS phone
  • Can receive USDC directly, convert to M-Pesa via Yellow Card

Alternative: Valora (Celo-based, Africa-focused)

 

Donor Redemption Flow (NFT purchase)

1. Donor visits POC dashboard
2. Selects child outcome to fund (or POC assigns one)
3. Donor approves USDC spend → calls authoriseDonor()
4. NFT (POCJ token) minted to donor wallet immediately
5. NFT updates automatically as child progresses through stages
6. On completion: NFT shows ★★★★★ + all 3 video links

 

Actor Token Redemption Flow

1. Actor accumulates POC tokens over multiple outcomes
2. Actor wants to buy land / pay school fees
3. Actor calls redeem(amount) on ProofOfCareCoin
4. POC admin receives notification
5. POC admin sends USDC directly to land seller / school
   (NOT to actor — mirrors whitepaper "redemption to vendor" design)
6. Transaction logged on-chain

 

Anti-Fraud Properties

Fraud AttemptWhy It Fails
Fake childMust have chain hash from Col A — no number, no work
Fake videoYouTube ID is hashed into the chain — can’t swap
Skip a stageContract enforces strict stage order
Double countoutcomeId is unique — second registration reverts
Early paymentUSDC locked until Stage.VERIFIED — no exceptions
Ghost workerTokens tied to registered wallet addresses only
Corrupt verifierPOC admin role separate from VERIFIER role

 

Next Steps

  1. Test on Base Sepolia (free testnet USDC available)
  2. Build WhatsApp webhook → POST to contract via Gelato relay (so field workers never need to touch a wallet for proof submission)
  3. Build public dashboard — React app reading on-chain events
  4. Integrate Yellow Card API for USDC → M-Pesa offramp

Step 1 — MetaMask + Base Sepolia

  1. Install MetaMask browser extension at metamask.io if you don’t have it
  2. Open MetaMask → click the network dropdown (top left) → Add network manually
  3. Fill in:
    • Network name: Base Sepolia
    • RPC URL: https://sepolia.base.org
    • Chain ID: 84532
    • Currency: ETH
    • Block explorer: https://sepolia.basescan.org

 

Step 2 — Get free testnet ETH

Go to https://faucet.quicknode.com/base/sepolia — paste your MetaMask wallet address and request ETH. You’ll get ~0.1 ETH which is more than enough for all your test transactions (each costs fractions of a cent).

 

Step 3 — Load files into Remix

  1. Go to remix.ethereum.org
  2. In the left sidebar, click the File Explorer icon (top icon)
  3. Click Upload files and upload all 3 .sol files
  4. You’ll also need OpenZeppelin — Remix handles this automatically via import. When you compile, it fetches @openzeppelin/contracts from GitHub on its own.

 

Step 4 — Compile

  1. Click the Solidity Compiler icon (second icon in sidebar)
  2. Set compiler version to 0.8.20
  3. Tick Enable optimization (runs: 200)
  4. Compile in this order: ProofOfCareCoin.solProofOfCareNFT.solProofOfCareOutcome.sol
  5. Green tick = success. If you see errors about OpenZeppelin imports, Remix may need a moment to fetch them — just try again.

 

Step 5 — Deploy in order

  1. Click the Deploy & Run icon (rocket icon)
  2. Change Environment from “Remix VM” to Injected Provider – MetaMask
  3. MetaMask will pop up asking to connect — approve it, and confirm it shows “Base Sepolia”

Deploy contract 1 — ProofOfCareCoin:

  • Select ProofOfCareCoin in the contract dropdown
  • In the constructor field, paste your MetaMask wallet address (the POC admin)
  • Click Deploy → confirm in MetaMask
  • Copy the deployed contract address from the bottom of the screen — you’ll need it shortly

Deploy contract 2 — ProofOfCareNFT:

  • Select ProofOfCareNFT
  • Paste your wallet address as the admin
  • Click Deploy → copy that address too

Deploy contract 3 — ProofOfCareOutcome:

  • Select ProofOfCareOutcome
  • It needs 4 constructor arguments:
    • _pocAdmin: your wallet address
    • _pocCoin: the ProofOfCareCoin address you copied
    • _pocNFT: the ProofOfCareNFT address you copied
    • _usdc: for testnet use a mock — paste 0x036CbD53842c5426634e7929541eC2318f3dCF7e (that’s real USDC on Base Sepolia)

 

Step 6 — Grant roles

This wires the contracts together. In the deployed contracts panel at the bottom, expand ProofOfCareCoin and find grantRole.

You need to run 4 transactions total:

On ProofOfCareCoin — call grantRole twice:

  • Role: 0x9f2df0fed2c77648de5860a4cc508cd0818c85b8b8a1ab4ceeef8d981c8956a6 (MINTER_ROLE), Account: [ProofOfCareOutcome address]
  • Role: 0x3c11d16cbaffd01df69ce1c404f6340ee057498f5f00246190ea54220576a848 (BURNER_ROLE), Account: [ProofOfCareOutcome address]

On ProofOfCareNFT — call grantRole twice:

  • MINTER_ROLE + Outcome address
  • 0x7c8999dc9a822c1f0df42023113094f984f032613c31c99a24f70d7d1c5c08d7 (UPDATER_ROLE) + Outcome address

Tip: In Remix you can compute role hashes by pasting e.g. keccak256("MINTER_ROLE") into the search — or just copy the hashes above.

 

Step 7 — Run a full test journey

Now call functions on ProofOfCareOutcome in order. Use these test values:

 
 
registerChild(
  "11156TAN-ACH-F03-255078908780",  // childId
  "TAN",                             // country
  "ACH",                             // diagnosisCode
  "F03",                             // demographics
  "255078908780",                    // phoneRemixed
  [1500, 5000, 1500, 2000],         // allocation (must sum to 10000)
  0xYOUR_ADDRESS,                    // outreachWorker (use your own for testing)
  0xYOUR_ADDRESS,                    // surgeon
  0xYOUR_ADDRESS,                    // hospital
  0xYOUR_ADDRESS,                    // aftercareNurse
  0xYOUR_ADDRESS                     // verifier
)

After each call, copy the outcomeId from the transaction logs in the Remix console — you’ll pass it into every subsequent function. Then call each step in order. After releasePayout you can check the NFT was minted and the POC tokens were unlocked.

 

The whole thing runs in about 20 minutes and costs nothing. Once that works cleanly, you’re ready to deploy to Base Mainnet with real USDC.

 

Lets walk through one real child’s journey — a 3-year-old girl in Tanzania named Amina who needs an ACH operation — told from each person’s perspective.

Amina’s journey — a real child’s surgery from start to finish
3-year-old girl, Tanzania. Diagnosis: ACH. Child ID: 11156TAN-ACH-F03

Mal — donor, Melbourne

Funds the outcome upfront. Receives NFT proof receipt.

 
He visits the POC dashboard
Mal sees a list of children waiting for surgery. He clicks on Amina — there’s already a BEFORE video from the outreach worker showing her condition, uploaded to YouTube, timestamped, linked to her ID. He can see she’s real before he spends a cent.
 
He deposits $600 USDC
He approves a USDC transfer from his wallet. The money goes directly into the smart contract — not to POC, not to a charity bank account. It’s locked in escrow. Nobody can touch it until Amina’s full journey is verified.
 
He instantly receives an NFT
A digital receipt lands in his wallet. It says: “Amina — 11156TAN-ACH-F03 — funded $600 — FUNDED: journey beginning.” It’s his proof that his money is committed to this specific child. Not a tax receipt. A live record.
 
His NFT updates as Amina progresses
Over the next few weeks, his NFT changes automatically. First it shows “IN PROGRESS — surgery underway” with the surgery video ID. Then eventually: “COMPLETED — outcome verified ★★★★★” with all three videos embedded. He watched the whole journey happen.
“I didn’t give money to a charity. I funded one specific child’s surgery and watched it happen. I could see every step. I knew my $600 paid the surgeon $150, the outreach worker $90, the hospital $120. Nothing disappeared.”
 
The chain Mal’s donation is part of:
11156TAN-ACH-F03-255078908780-©©-145LET-mhzNY2QZsh0-©©-234MAL-75-341-322
His donor segment: 234MAL (his ID) · 75 = outreach split · 341 = surgery split · 322 = aftercare split

Let — outreach worker, rural Tanzania

Finds the child. Submits the BEFORE proof. Earns $90 when Amina gets home.

 
He’s walking through his village
Let knows the signs. He’s trained. He spots Amina in the market — her condition is visible. He talks to her mother, explains the programme, gets verbal consent. This is normal Tuesday for him.
 
He films the BEFORE video on WhatsApp
He films a short video on his phone — Amina, her mother, her condition, the village location, the date. He sends it to the POC WhatsApp group. That video gets uploaded to YouTube with her ID in the title. It’s now timestamped, public, and permanent. It becomes part of her proof chain.
 
POC assigns her a number
She becomes 11156. That number is her identity in the system from this moment on. Let’s worker code (145LET) is now attached to her record. No number was assigned before this — Let couldn’t have filmed a fake child and expected to be paid.
 
He waits — and eventually gets paid
Let earns nothing yet. His POC tokens sit as “pending.” He continues finding other children. Six weeks later, when Amina is confirmed home and safe, his tokens unlock. He gets $90 USDC to his mobile wallet. He can save it, or when he wants to buy something big — like land — he requests POC to send it directly to the seller.
 
“I don’t just find a child and forget. I know that if Amina doesn’t make it home, I don’t get paid. So I follow up. I check on her. The system made me care about the whole journey, not just the first video.”

Eli — surgeon, Selian Hospital, Arusha

Performs the surgery. Submits DURING proof. Earns $150 on verified completion.

 
Amina arrives at the hospital
The hospital has pre-approved capacity for POC cases this month. Amina arrives with her number — 11156. Before anything happens, a nurse confirms her ID against the system. The donor has already authorised. Funds are in escrow. The surgery is financially guaranteed before Eli picks up a scalpel.
 
The DURING video is filmed
A second video is taken — Eli in the theatre, Amina on the table, her ID number visible, date and location confirmed. This is the “DURING” proof. It doesn’t need to show the procedure in detail. It just needs to prove: this surgeon, this child, this hospital, this date. Undeniable.
 
His tokens are issued — but locked
The moment the DURING video is logged, Eli’s 150 POC tokens appear in his account. But they say “PENDING.” He can see them. He can’t spend them. They are a promise — one that only converts to real money when Amina is home and verified safe. He has every reason to make sure the aftercare is good.
He builds a savings record over time
 
Eli does 40 POC surgeries a year. Each one earns him 150 tokens when fully verified. Over time those accumulate. His rating sits at 4.8 stars — which means he gets priority allocation for the next batch of cases. High performers win more work. Poor performers get less. The system rewards quality.
“Before POC, I sometimes operated and waited months for payment — if it came at all. Now I know exactly what I’ll earn for each case, the money is already sitting in escrow, and I get paid the moment it’s verified. No chasing invoices.”

POC admin —  (system operator)

Designs the system. Issues numbers. Validates chains. Releases payment. Never holds funds.

 
Before anything starts — he designs the unit
POC admin decides: an ACH surgery in Tanzania costs $600. The allocation is fixed before a single child is identified — $90 outreach, $300 surgery (split surgeon/hospital), $90 aftercare, $120 local admin. This is locked into the smart contract. Nobody can renegotiate it mid-journey.
 
POC via AI or he/she issues the number — and only then does work begin
When Let’s BEFORE video arrives, POC admin registers Amina on-chain. She gets number 11156. This triggers the chain. Without this step, no tokens can be issued, no donor can authorise, no payment can ever flow. The number is the permission.
 
He watches the chain build — but doesn’t touch the money
The USDC is in the smart contract — not in POC’s bank account. POC admin can see it, can verify it, but cannot spend it. AI or he/she watches each proof video arrive, checks they match the child ID, checks for duplicates, checks the timestamps are sequential. His job is validation, not custody.
He calls releasePayout() — one transaction, everyone gets paid
 
Once the full chain is complete — BEFORE, DURING, AFTER, home video, independent verifier sign-off, star rating assigned — POC admin triggers the payout. One transaction. The smart contract automatically splits the $600 and sends it simultaneously to every actor’s wallet. POC admin never held the money, never touched the money, never decided who got what in the moment. The contract did.
 
If something goes wrong — he flags it
If AI detects a duplicate video, or the DURING timestamp is before the BEFORE timestamp, or a child ID appears twice — POC admin calls flagOutcomeFailed(). All pending tokens expire instantly, worth zero. The $600 USDC returns automatically to the donor’s wallet. Full refund. No court needed.
 
“I’m not a charity. I’m a system operator. I design the outcome, issue the permission, validate the proof, and release the payment. The money was never mine. I earn my ??% fee transparently — it’s written into the contract before the donor ever commits.”
 
The complete verified chain for Amina:
11156TAN-ACH-F03-©©-145LET-mhzNY2QZsh0-©©-234MAL-75-341-322=©©-1234SEL-ELI-ACH-mhzNY2QZsh0-©©-221ZIL-NUR-22-mhzNY2QZsh0-©
This string — hashed on-chain — is the tamper-proof receipt of Amina’s entire journey. Anyone can verify it. Nobody can fake it.
 

An important thing to understand

Every person in the system is motivated by the same finish line — Amina safely home.

  • Let (outreach) doesn’t get paid until she’s home
  • Eli (surgeon) doesn’t get paid until she’s home
  • The aftercare nurse doesn’t get paid until she’s home
  • POC admin doesn’t get his 10% fee until she’s home
  • Mal (donor) can see all of it happen in real time

In the old charity model, the outreach worker gets paid for finding a child. The surgeon gets paid for doing surgery. Nobody gets paid for the outcome. So nobody’s incentive is actually the outcome.

In POC, the outcome is the only thing that releases money. That’s not a philosophy — it’s a contract that enforces it automatically.

The © chain in the spreadsheet, and the keccak256 hash in the smart contract, are both doing the same thing: building an unforgeable record that proves each person did their part, in order, for this specific child. That’s what makes it auditable to a government, trustworthy to a donor, and fair to a field worker in rural Tanzania who has never had reliable income before.