A sensor signs the cold chain, and a proven breach freezes the tokenized warehouse receipt
Pinky Promise lets a buyer check how goods were actually stored before buying a warehouse receipt for them. Today that confidence comes from paperwork and the reputation of whoever issued the receipt.
A pocket device travels with the lot (our demo is a pharma pallet with a 2–8 °C limit) and signs every temperature and humidity reading with a key rooted in a secure element. At each custody handoff it records the seal with a photo, an NFC tag and a case switch, gets a co-signature from a second microcontroller at the venue, and signs a checkpoint covering every reading since the last one.
A vision model on 0G then answers ACCEPT_CUSTODY, REJECT or ESCALATE, based on the seal photo and the readings. The full episode goes encrypted to 0G Storage, so anyone with the lot's view key can replay it and re-verify its signatures. If 0G can't be reached, the handoff stays PENDING: no decision is made up and the token isn't touched.
The public evidence lives on Arkiv as read-only entities. The device's own wallet creates the readings and checkpoints, so the gateway relaying them can't forge them, and a reading it withholds shows up as a gap. Raw temperatures and positions stay private: the public record says only whether a reading was in range, plus a zero-knowledge proof that it was taken inside a venue's boundary. The one exception is a confirmed breach, which discloses the single reading that proves it. Evidence expires when the dispute window closes.
Each lot is a security token issued through Hedera's Asset Tokenization Studio. Units trade only while a venue holds the goods and are locked in transit. They freeze when a REJECT is backed by a device-signed out-of-range reading, which the contract verifies itself, so the party relaying 0G's answer can't freeze a lot alone. Only an inspector can release a frozen lot, and holders redeem after delivery.
A buyer page reads Arkiv and Hedera directly and checks every signature and proof in the browser before the buyer commits.
Current status: the full journey runs end to end on one machine, with a simulated device and local stand-ins for the networks. The stand-ins run the unmodified Arkiv SDK and the real ATS contract bytecode, and decisions come from a mock model that is labelled as a mock everywhere it appears. The testnet adapters are written but haven't sent a transaction yet, and the firmware is written but hasn't run on a board.
It's a TypeScript pnpm monorepo with Solidity contracts (Foundry), a Noir circuit and ESP32-S3 firmware, all sharing one protocol package. The hardware design is an SHT31 sensor, GPS, a camera, a PN532 NFC reader and an ATECC608B secure element, plus a second ESP32-S3 as the venue anchor. The gateway uses Hono and the buyer page uses React and Vite.
Readings are 144-byte fixed-width binary payloads hashed with SHA-256, because the same bytes have to be handled by firmware, Solidity and a Noir circuit. SHA-256 is hardware-accelerated on the ESP32, a precompile on the EVM and affordable in a circuit, while keccak fails on the first and third.
How the partner technologies helped:
0G is the decision layer. The gateway calls the Compute Router's OpenAI-compatible endpoint with the seal photo and a summary of the readings, and anything other than a clean JSON decision counts as no decision. There is no fallback model. Encrypted episode logs go to 0G Storage, and their root is recorded on Arkiv and inside the attestation sent to Hedera.
Arkiv gave us a verifiable data layer without building an indexer. "All out-of-range readings for this lot from this device" is a single query the browser runs directly, scoped by who created the entity. The device isn't online itself, so we gave the Arkiv SDK a viem account whose signTransaction hands the transaction to the device. The device decodes the calldata and signs only read-only creates of its own readings and checkpoints. Per-entity lifetimes make data expiry part of the write.
Hedera's Asset Tokenization Studio gave us compliant issuance, an allowlist and KYC. ATS has no warehouse-receipt type, so each lot is an equity token with only the redemption right and zero decimals. Our CustodyOracle contract is the token's ERC-3643 compliance module, so every transfer asks it for the lot's custody state. It holds the freeze role and verifies the breach reading itself using the SHA-256 precompile and ecrecover. Freezing an address in ATS would undo the holder's onboarding, so we freeze each holder's units instead, 50 holders at a time with continuation calls so a large lot can't run out of gas.
Noir with UltraHonk proves a device-signed reading was inside a venue's bounding box without revealing the position. Proofs are about 8.8 kB, take about two seconds to generate, and verify in the buyer's browser with bb.js. A proof gives privacy, not authenticity, since a spoofed GPS proves just as well. Authenticity comes from the venue anchor's co-signature, and the page says so.
The hacky parts:
We wrote a local Arkiv node, with its own lexer and parser for the query language, that emulates the entity precompile closely enough for the unmodified SDK to run on it, and we checked it against real testnet responses. For Hedera, we load an anvil chain with a snapshot of the real ATS contracts from testnet, both bytecode and storage. The firmware is a USB serial bridge rather than a standalone device: the device logic runs on the host, and every part has a simulated twin, so hardware can be connected one piece at a time without code changes.
The custody rules exist in both TypeScript and Solidity, so we generate all 384 state combinations from the TypeScript and check them against the contract.
The code, tests, firmware and docs were written with an AI coding assistant (Claude), working from our architecture plan and under our direction.

