Inspiration

StubbleTrail began with a simple question: what evidence should sit behind a claim that agricultural residue was sustainably sourced?

A farmer may declare one quantity, a collector may record another, and a processor may receive something different. Those differences need an explanation. Documents can help, but only when reviewers can connect them to the right batch and understand who recorded each observation.

I wanted to build a system that makes that investigation easier, while keeping the original records and the reviewer's reasoning visible. That became StubbleTrail, my submission for the Sustainable Supply Chains track.

What it does

StubbleTrail follows agricultural residue from farmer declaration through collection, processor intake and independent review.

Farmers register plots and declare available residue. Collectors record pickup measurements, and processors independently record intake quantities, facility information and receipts. Each participant can attach supporting evidence. An auditor then investigates findings, requests clarification and records a decision with an explanation.

The platform checks for problems such as reused receipt numbers, identical document files, inconsistent dates, missing evidence and quantity discrepancies. A finding starts an investigation; it does not automatically establish wrongdoing.

Gemini assists with reading uploaded documents and suggesting structured fields. The uploader must compare those suggestions with the original and explicitly confirm them. Extraction does not silently change custody measurements or approve a batch.

Events are linked through a SHA-256 hash chain. Approved real batches can commit their approved event root to a Solidity registry on Ethereum Sepolia. A public verification page presents a redacted record and reports local integrity separately from blockchain confirmation.

The SoilSafe advisory also asks whether proposed residue removal needs site-specific agronomic review. Tracking material is useful, but the amount left in the field matters too.

How I built it

I built the application with Next.js, React and TypeScript. Supabase handles authentication, PostgreSQL and private evidence storage. The application is deployed on Vercel.

Operational roles are checked on the server using protected user profiles. Batch updates use database transactions and version checks to prevent concurrent changes from overwriting each other. Corrections are appended to the history rather than replacing the original declaration.

Uploaded files are validated and hashed from their actual bytes. Authorized users receive short-lived links to inspect the originals. AI extraction uses a strict output schema and database-enforced usage limits.

For anchoring, I built and deployed a Solidity registry on Sepolia. The application checks both the transaction receipt and the registry proof before reporting a confirmed anchor.

I also built an isolated demo with synthetic records, so visitors can explore the workflow without credentials or access to operational data. The interface retains its earlier name, BioProof; StubbleTrail is the submission name.

Challenges I ran into

One of the hardest parts was keeping the responsibilities of the four roles clear. A collector's measurement, a processor's receipt and an auditor's decision are different kinds of records. The application needed to connect them without allowing one to quietly replace another.

AI extraction required similar care. A document field can look convincing and still be wrong, so I kept suggestions separate from recorded measurements and added explicit human confirmation.

Blockchain requests introduced uncertainty around timeouts and retries. A timed-out request may already have broadcast a transaction. I added a reservation step and separate confirmation checks to avoid treating an uncertain outcome as either a success or a reason to broadcast again.

I also worked through deployment dependency issues, request-origin validation and extraction quota handling, then added regression coverage around those fixes.

Accomplishments that I'm proud of

I'm proud of bringing the workflow together in a deployed prototype: separate participant roles, private evidence, investigation findings, documented review and public verification.

The latest local unit, API and database test run passed 93 tests. The repository also includes desktop and mobile browser workflows and local contract checks.

The demo makes the main ideas visible through concrete examples: a 600 kg pickup followed by a 560 kg intake, two batches sharing a receipt and document bytes, a residue-removal review scenario, and a tamper test that changes only a copy of an event.

These are labeled synthetic examples. They demonstrate the software without presenting them as field-pilot results or confirmed climate benefits.

What I learned

I learned that a useful evidence system needs to preserve uncertainty as carefully as it preserves data.

A matching hash does not prove that a delivery occurred. An extracted weight is still a suggestion until someone checks it. A reused receipt may have a legitimate explanation.

Those distinctions shaped the project. I focused on preserving original observations, recording the reasons behind decisions and showing exactly what each verification result can establish.

Building across authentication, storage, database transactions, AI and blockchain also taught me to test the boundaries between services, especially when a request fails halfway through.

What's next for StubbleTrail

The next step is hosted acceptance testing with separate operational accounts, followed by a small, documented field pilot with a cooperative or residue aggregator and an independent reviewer.

That would help answer practical questions: which documents participants already use, how measurements are captured, what causes discrepancies and whether the review process fits their daily work.

For wider adoption, I plan to add organization-scoped access, indexed conflict queries, pagination and direct signed uploads. Offline capture and managed signing are further improvements.

StubbleTrail does not issue carbon credits or certify emissions reductions. Its purpose is to make agricultural supply-chain claims easier to examine by showing who recorded each observation, which evidence supports it and how it was reviewed.

Built With

Share this project:

Updates

Submission history