Inspiration
In several sub-Saharan African countries, roughly one in four teachers is absent on a given school day. Paying teachers for each day they can prove they were in class works: a randomized trial in India (Duflo, Hanna & Ryan, 2012) cut absence by 21 percentage points. But the proof gets faked, and photo-attendance apps are gamed with old photos. We wanted proof that's cheap on any phone and hard to fake.
What it does
- The app turns a Solana block hash only seconds old into three words.
- The teacher chalks them on the board and photographs the class.
- Our Solana program rejects the photo if it was sealed more than 90 seconds after the words existed.
- A vision service checks the words, the head count and that the photo isn't of a screen. Hashing catches reused photos.
- Each verified photo earns a USDC bonus at the end of the day.
Surprise re-checks, timed by future block hashes, make the teacher add new words under the old ones. Each set depends on the previous photo, so the board becomes a hash chain written in chalk. Teachers never see a wallet or pay a fee.
How we built it
- Program: Anchor 1.1.2 (Rust). Checks Solana's recent block hashes on-chain to enforce the time window, and pays USDC from a program-owned vault.
- Backend: Hono relayer that pays transaction fees, but only for our own instructions.
- Vision: FastAPI + Claude, with decoy words to catch misreadings, plus perceptual hashing (PDQ) to catch reused photos.
- App: React + Vite installable web app.
- Shared library: @solana/kit 8. The word derivation matches byte for byte in Rust, TypeScript and Python.
Challenges we ran into
- Anchor 1.x and Kit 8 are newer than most tutorials.
- The list of recent block hashes is too big to decode normally on-chain, so we parse it by hand.
- Reading chalk handwriting is unreliable, so we made it multiple choice with decoys.
- A fee-paying relayer is a wallet anyone can call, so we locked it to our instructions.
Accomplishments that we're proud of
- The full loop runs on a real Solana validator: check-in, verify, re-check and payout.
- Late photos, reused photos and forged transactions all fail.
- 111 unit tests plus a 39-check end-to-end run.
What we learned
Solana's most underrated feature may be its clock: a fresh, unpredictable, verifiable value every few hundred milliseconds. We also learned that asking a model "which of these words do you see?" works much better than asking "what does this say?"
What's next for Chalk Chain: Proof-of-Presence Pay for Teachers
A 10–20 school pilot with an NGO, SMS check-in for weak connections, cash-out to mobile money, face blurring on the phone, and the same proof for community health workers.
Built With
- .env
- .log
- blockchain
- claude
- computers
- crypto
- json
- math
- openai
- png
- programming
- python
- rust
- solana
- technology
- typescript
Log in or sign up for Devpost to join the conversation.