tiftik-passport/README.md
caelum0x 2403703b9d feat(tiftik-passport): phone-camera fiber-grading demo + NEAR provenance-anchor contract
Ankara Kecisi Teknoloji ve Inovasyon Fikir Maratonu 2026 entry prototype.
Client-side heuristic fiber grading (canvas pixel analysis, no ML claim)
+ a near-sdk 5 contract adapted from Ration's live AuditAnchor pattern,
compiles clean to wasm32-unknown-unknown (not yet deployed to testnet).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
2026-11-17 15:33:40 +03:00

65 lines
3.4 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Tiftik Pasaportu (Mohair Passport)
Entry prototype for **Ankara Keçisi Teknoloji ve İnovasyon Fikir Maratonu
2026** (Ankara Kalkınma Ajansı, under the Ministry's "81 İl 81 Ürün"
program). Deadline for the idea/application round: **2026-11-20 17:00
TRT** (UTC+3), with a multi-stage process after that (ön değerlendirme →
mentorluk kampı → final sunumları, event Nov 30).
## Problem
Ankara mohair (tiftik) sells into global yarn/textile markets almost
entirely as an undifferentiated commodity. A buyer in Italy or Japan
cannot verify which herd/region a bale came from, or what its real fiber
grade (fineness/color/staple length) was at the point of shearing,
without trusting whichever intermediary re-labels it along the way. That
erases the price premium a genuinely fine, well-graded Ankara mohair
batch should command over a generic import — the exact "bölgesel etki"
(regional impact) and "sürdürülebilirlik" (sustainability) the jury
brief asks for: a real lever to raise what Ankara's own breeders earn per
kilo, not just a tech demo.
## What's actually built here (2026-11-17)
1. **`demo/grading.html`** — a real, working, client-side phone-camera
fiber-grading prototype. No server, no upload, no ML framework: pure
canvas pixel analysis (lightness/color histogram + Sobel-style edge
density as a fineness proxy) running entirely in the browser off a
photo the user picks or captures. Explicitly labeled as a **heuristic
proxy, not a trained model or a lab measurement (OFDA/laser
diffraction)** — honest about what stage this is at. Verified live:
loads with zero console errors, a real uploaded test photo runs all
the way through to a grade (`A`/`B`/`C`), a color class, and a
SHA-256 `grade_hash` of the result.
2. **`contract/`** — a NEAR smart contract (`tiftik_passport`, Rust +
near-sdk 5) that anchors that `grade_hash`, a `batch_id`, and a
`breeder_region_id` on NEAR Testnet, append-only, with the same
stale/replay-sequence guard as Ration's live `AuditAnchor` contract
(the pattern this is adapted from — see
`contracts-near/audit_anchor` in the Ration repo). It does not grade
fiber on-chain and does not move money — same "minimal, honest,
one state-changing method" discipline as the contract it's adapted
from. **Compiles clean to `wasm32-unknown-unknown` release**
(verified locally, `tiftik_passport.wasm`, 202,844 bytes); **not yet
deployed to NEAR Testnet** — that needs a funded testnet account,
an owner-identity step left for the mentorship-camp stage, where a
deploy has a real audience, rather than for a fikir-maratonu
pre-screening round that is judging the idea, not the chain.
## What this is not (yet)
- Not a trained ML model — the grading step is an explicit, labeled
heuristic proxy, step one toward one.
- Not deployed on-chain yet (compiles, not deployed — see above).
- Not a marketplace — the brief's third pillar (a direct-to-global
marketplace surfacing grade+provenance as the sales hook) is page 2 of
the mentorship-camp roadmap, not this prototype.
## Credit
Provenance-anchor pattern adapted from **Ration**'s live NEAR Hackathon
`AuditAnchor` contract (`contracts-near/audit_anchor`,
https://github.com/caelum0x/ration — separate hackathon entry, same
author). See `plans/tiftik-pasaport.md` and `plans/hackathons.md` in the
main products repo for full status and the real application-form URL.