privacyMode flag offers two modes — shielded (coordinates hidden) and disclosed
(coordinates also published) — and the circuit forces the chosen mode so it cannot be
misrepresented. The contract was deployed to Midnight Preprod (address
06edca65…f11a) and verified across five test transactions covering both modes and
duplicate rejection. This is a preprod design-and-verification report; integration into the live
mainnet catch contract is deferred until after a third-party audit.
privacyMode フラグにより2モード — shielded(座標秘匿)と disclosed(座標も公開)— を選べ、回路が選択モードを強制するため偽装できない。コントラクトは Midnight Preprod(アドレス 06edca65…f11a)にデプロイされ、両モードと重複拒否を含む5件のテストトランザクションで検証された。本書は preprod の設計・検証報告であり、稼働中メインネットの catch への統合は第三者監査の後に行う。
privacyMode มีสองโหมด — shielded (ซ่อนพิกัด) และ disclosed (เปิดเผยพิกัดด้วย) — และวงจรบังคับโหมดที่เลือกจึงปลอมแปลงไม่ได้ คอนแทรกต์ deploy บน Midnight Preprod (ที่อยู่ 06edca65…f11a) และยืนยันด้วย 5 ธุรกรรมทดสอบครอบคลุมทั้งสองโหมดและการปฏิเสธรายการซ้ำ รายงานนี้เป็นการออกแบบและตรวจสอบบน preprod; การรวมเข้ากับคอนแทรกต์ catch บน mainnet จะทำหลังการตรวจสอบโดยบุคคลที่สาม
gyotak-catch (Layer 1, on Midnight mainnet) commits a hash of the registered coordinates but does not prove the coordinates lie inside the declared region — the region is a self-declared label. gyotak-komon closes that gap: it proves region-membership in zero knowledge while keeping the exact location — a genuine competitive asset — secret. KOMON's aim is broader than seafood: a QR/tag-free way to prove an item's one-of-a-kind identity and its origin from a photo alone — from an EPS foam box to agricultural produce such as durian — as an experiment toward bringing provenance to primary industry at large. It also adds a per-individual fingerprint (komonCommit) for item-level provenance.
gyotak-catch(Layer 1・Midnightメインネット)は登録座標のハッシュをコミットするが、「座標が申告エリア内にある」ことは証明しない(regionは自己申告ラベル)。gyotak-komon はその差を埋める — 正確な位置(真の競争資産)を秘匿したまま、エリア内であることをゼロ知識で証明する。KOMONの狙いは水産にとどまらない:QRコードやタグを貼らず、写真だけでモノの世界唯一性とその産地を証明する — 発泡スチロール箱から、ドリアンなどの農産物まで — 産地証明を一次産業全体へ広げるための実験である。あわせて個体単位の指紋(komonCommit)で個体レベルの来歴も付与する。
gyotak-catch (Layer 1 บน Midnight mainnet) คอมมิตแฮชของพิกัดที่ลงทะเบียนแต่ไม่พิสูจน์ว่าพิกัดอยู่ในเขตที่ประกาศ — region เป็นป้ายที่ประกาศเอง gyotak-komon ปิดช่องว่างนี้: พิสูจน์การอยู่ในเขตแบบ zero-knowledge โดยเก็บตำแหน่งที่แท้จริงเป็นความลับ เป้าหมายของ KOMON กว้างกว่าอาหารทะเล: วิธีพิสูจน์ความเป็นหนึ่งเดียวของวัตถุและแหล่งกำเนิดจากรูปภาพเพียงอย่างเดียว โดยไม่ต้องมี QR/แท็ก — ตั้งแต่กล่องโฟม EPS ไปจนถึงผลผลิตทางการเกษตรเช่นทุเรียน — เป็นการทดลองเพื่อขยายการพิสูจน์แหล่งกำเนิดสู่ภาคปฐมภูมิ และเพิ่มลายนิ้วมือรายตัว (komonCommit)
| Field項目ฟิลด์ | Value値ค่า |
|---|---|
| Contract addressコントラクトアドレスที่อยู่คอนแทรกต์ | 06edca6576e324259d62778ab2e48adf2cd3001d296856ec63fc7b2ffd5af11a |
| Network | Midnight Preprod (no mainnet deployment) |
| Deploy dateデプロイ日วันที่ deploy | 2026-06-06 |
| Deploy TX | 1c90c096… (block 1,108,512) |
| Owner pk | 5e8c984df5acc1948c6a9b969e92f6d1c237257a8cc0e4b629335ec6818dcc99 |
| compactc | 0.30.0 |
| Language version言語バージョンเวอร์ชันภาษา | 0.22.0 |
| Runtime versionランタイムバージョンเวอร์ชัน runtime | 0.15.0 |
| ledger | ^8.0.3 |
| proof-server | 8.0.3 @ localhost:6300 |
KomonRecord fields stored on-chain:
オンチェーンに格納される KomonRecord のフィールド:
ฟิลด์ของ KomonRecord ที่เก็บบนเชน:
| Field | Type型ชนิด | Note説明หมายเหตุ |
|---|---|---|
komonCommit | Bytes<32> | Per-individual fingerprint個体フィンガープリントลายนิ้วมือรายตัว |
photoHash | Bytes<32> | SHA-256 of photo写真のSHA-256SHA-256 ของรูป |
region | Bytes<32> | Region label e.g. "Pranburi"地域名 例"Pranburi"ชื่อเขต เช่น "Pranburi" |
privacyMode | Uint<8> | 0 = shielded, 1 = disclosed |
gpsHash | Bytes<32> | Hash commitment of GPSGPS座標のハッシュแฮชพิกัด GPS |
lat | Uint<32> | pm=0 → 0, pm=1 → real latitudepm=0は0, pm=1は実緯度pm=0 เป็น 0, pm=1 พิกัดจริง |
lng | Uint<32> | pm=0 → 0, pm=1 → real longitudepm=0は0, pm=1は実経度pm=0 เป็น 0, pm=1 ลองจิจูดจริง |
committedAt | Uint<64> | Timestampタイムスタンプเวลา |
recordKomon circuit arguments:
recordKomon 回路引数:
อาร์กิวเมนต์วงจร recordKomon:
batchId: Bytes<32>, region: Bytes<32>, komonCommit: Bytes<32>, photoHash: Bytes<32>, privacyMode: Uint<8>, latMin: Uint<32>, latMax: Uint<32>, lngMin: Uint<32>, lngMax: Uint<32>, timestamp: Uint<64>
Witnesses (private inputs, never published): Witness(秘密入力、公開されない): Witness (อินพุตส่วนตัว ไม่เปิดเผย):
witness getGpsCoords(batchId: Bytes<32>): Vector<2, Uint<32>>; // exact coords (private) witness localSecretKey(): Bytes<32>; // owner key (private)
The bounds (latMin/latMax/lngMin/lngMax) are public circuit parameters. The witnessed coordinates are compared against them, and disclose() exposes only the boolean outcome — which must be true — never the coordinate values.
範囲(latMin/latMax/lngMin/lngMax)は公開の回路パラメータ。witnessの座標をこれと比較し、disclose() は真偽(必ずtrueでなければならない)のみを開示する。座標値そのものは出ない。
ขอบเขต (latMin/latMax/lngMin/lngMax) เป็นพารามิเตอร์สาธารณะ พิกัดที่เป็น witness ถูกเทียบกับขอบเขต และ disclose() เปิดเผยเฉพาะผลบูลีน (ต้องเป็น true) ไม่ใช่ค่าพิกัด
assert(latMin <= latMax, "bad lat bounds"); assert(lngMin <= lngMax, "bad lng bounds"); assert(disclose(gps[0] >= latMin), "lat below range"); assert(disclose(gps[0] <= latMax), "lat above range"); assert(disclose(gps[1] >= lngMin), "lng below range"); assert(disclose(gps[1] <= lngMax), "lng above range");
Compact has no ternary operator, so mode selection uses a multiplication trick. privacyMode (0/1) is disclosed and recorded on-chain. shielded (pm=0) forces lat=lng=0; disclosed (pm=1) stores the real coordinates. The circuit enforces this, so a prover cannot claim shielded while revealing, nor claim disclosed while hiding. The range proof runs in BOTH modes.
Compactには三項演算子が無いため、モード選択は乗算トリックで行う。privacyMode(0/1)はdiscloseされオンチェーンに記録される。shielded(pm=0)はlat=lng=0を強制、disclosed(pm=1)は実座標を格納。回路がこれを強制するため、「秘匿を主張しつつ公開」も「公開を主張しつつ秘匿」も不可能。レンジ証明は両モードで常に実行される。
Compact ไม่มี ternary จึงใช้ multiplication trick เลือกโหมด privacyMode (0/1) ถูก disclose และบันทึกบนเชน shielded (pm=0) บังคับ lat=lng=0; disclosed (pm=1) เก็บพิกัดจริง วงจรบังคับ จึงอ้าง shielded แต่เปิดเผยไม่ได้ และอ้าง disclosed แต่ซ่อนไม่ได้ range proof ทำงานทั้งสองโหมด
const sel = pm as Uint<32>; const latOut = (gps[0] * sel) as Uint<32>; // pm=0 -> 0, pm=1 -> real lat const lngOut = (gps[1] * sel) as Uint<32>; // pm=0 -> 0, pm=1 -> real lng
| Modeモードโหมด | privacyMode |
lat/lng |
gpsHash |
Range proofレンジ証明Range proof |
|---|---|---|---|---|
| shielded | 0 | 0 (coordinates hidden)0(座標秘匿)0 (ซ่อนพิกัด) |
✓ | ✓ only "inside the box" is disclosed✓「範囲内」のみ開示✓ เปิดเผยเฉพาะ "อยู่ในกรอบ" |
| disclosed | 1 | real coordinates (plaintext)実座標(平文)พิกัดจริง (plaintext) | ✓ | ✓ same proof still runs✓ 同じ証明が動作✓ proof เดียวกันยังทำงาน |
| # | Function関数ฟังก์ชัน | batchId | Modeモードโหมด | TX | Block | Result結果ผลลัพธ์ |
|---|---|---|---|---|---|---|
| 1 | recordKomon |
KMN-TESTFIXTURE01 | shielded (pm=0) | 003e863a2d12ed0dd8d768d55d3e1b5232d50623f3597201123a034060cab98b4d |
1,108,580 | PASS |
| 2 | verifyKomon |
KMN-TESTFIXTURE01 | read-back読取อ่านกลับ | — | — | PASS (region=Pranburi, privacyMode=0, lat=0, lng=0, gpsHash=846d5c47…) |
| 3 | recordKomon |
KMN-TESTFIXTURE02 | disclosed (pm=1) | 00643b54338eca0edd8425b1b8e9dcf2bb01f3e26f4887768eabdc1cb9dcf8613d |
1,108,844 | PASS |
| 4 | verifyKomon |
KMN-TESTFIXTURE02 | read-back読取อ่านกลับ | — | — | PASS (privacyMode=1, lat=2273483648, lng=3144483648, gpsHash=8db21bfb…) |
| 5 | recordKomon |
KMN-TESTFIXTURE01 (dup) | shielded | — | — | REJECT as expected ("komon already exists")期待通り拒否ปฏิเสธตามที่คาด |
Coordinates are stored as scaled unsigned integers: stored = round(degrees × 1e7) + 231. The ×1e7 keeps ~cm precision; the +231 offset shifts negatives into the unsigned range. Example: lat 12.3456789 → 123456789 + 2147483648 = 2270940437.
座標はスケール済み符号なし整数で格納:stored = round(度 × 1e7) + 231。×1e7で約cm精度、+231で負値を符号なし範囲へシフト。例:緯度12.3456789 → 123456789 + 2147483648 = 2270940437。
พิกัดเก็บเป็นจำนวนเต็มไม่มีเครื่องหมาย: stored = round(องศา × 1e7) + 231 ×1e7 ให้ความละเอียดระดับ cm; +231 เลื่อนค่าลบเข้าสู่ช่วงไม่มีเครื่องหมาย ตัวอย่าง: lat 12.3456789 → 2270940437
"The object is its own label. A foam box's grain pattern, a durian's skin — each is physically one of a kind and impossible to clone, so an item can prove it is itself and where it came from, with no QR or tag to forge. KOMON secures logistics today and aims to bring photo-only provenance to primary industry at large."
「モノ自身がラベルである。発泡スチロールの粒の模様も、ドリアンの表皮も、物理的に世界に一つで複製できない — だからモノは、偽造できるQRやタグを貼らずに、"自分自身であること"と"どこから来たか"を証明できる。KOMONはまず物流のすり替えを防ぎ、やがて写真だけの産地証明を一次産業全体へ広げることを目指す。」
"วัตถุคือป้ายของตัวมันเอง ลายเม็ดของกล่องโฟม ผิวของทุเรียน — แต่ละชิ้นมีหนึ่งเดียวในเชิงกายภาพและลอกเลียนไม่ได้ ดังนั้นวัตถุจึงพิสูจน์ได้ว่ามันคือตัวมันเองและมาจากที่ใด โดยไม่มี QR หรือแท็กให้ปลอมแปลง KOMON ปกป้องโลจิสติกส์ในวันนี้ และมุ่งขยายการพิสูจน์แหล่งกำเนิดด้วยรูปภาพสู่ภาคปฐมภูมิ"
| Fieldフィールドฟิลด์ | Value値ค่า |
|---|---|
| Document ID | ECOSUS-TR-2026-009 |
| Prior Report先行報告รายงานก่อน | TR-2026-008 · gyotak-x402 |
| Teaching repo (Apache-2.0)教材リポ (Apache-2.0)Repo สอน (Apache-2.0) | github.com/ecosus-co/gyotak-compact-teaching |
| Author著者ผู้เขียน | Takuya Ogura, Chairman, ECOSUS CO., LTD. |
| Organization組織องค์กร | ECOSUS CO., LTD. · 0205562030631 · Pranburi, Thailand |
| Report date報告日วันที่ | June 6, 2026 |
| Network | Midnight Preprod |
| Contract addressコントラクトアドレスที่อยู่คอนแทรกต์ | 06edca6576e324259d62778ab2e48adf2cd3001d296856ec63fc7b2ffd5af11a |
| Licenseライセンスใบอนุญาต | CC BY 4.0 (report本書รายงาน) · code in teaching repo is Apache-2.0教材リポのコードは Apache-2.0โค้ดใน teaching repo เป็น Apache-2.0 |