
TURMOIL
Solving crimes by decentralizing Biodiesel production processes & logistics.
Demo
About
Biodiesel is mostly made from used cooking oil (UCO). In Europe, people pays a premium for fuel made from waste instead of crops, and that premium is why people cheat: a lot of what gets sold as "UCO" is suspected to be fresh palm oil with fake paperwork. Nobody can tell the difference by looking at it, and largely not by chemical testing either. The whole market runs on certificates — and the bodies issuing them have certified more waste oil than the world's thought to produce, and at least one refinery that doesn't exist. That's the old news. There's a deadline now. From 2027, the EU won't accept imported used cooking oil UNLESS it comes from an approved supplier, with a documented chain of custody starting at initial collection. Initial collection is the fryer. It's the one link in the chain that no certificate scheme evidences today. So we build the receipt. Restaurants throw out used frying oil by default. TURMOIL collectors recieve a pick up request. drive to the venue, and picks it up for processing into biofuel afterwards. When the driver is at the recollection point, the restaurant scans a code on his phone and signs. Neither of them can record a pickup alone. The restaurant is paid in USDC on the spot, into an account they opened with an email address — no seed phrase, no app, no gas, and not a single transaction sent from their side. When the truck reaches the plant, the plant signs for the weight that actually arrived. Every individual pickup has to add up to that weight. If it doesn't, the gap comes out of the collector's deposit — never out of the restaurants, who were paid the moment they signed and keep it. The person who can lie is the person who pays. Then we spot-check. Once a load closes, the contract asks Hedera's own randomness for a seed and samples 30% of the pickups — drawn after the load is sealed, so nobody knows in advance which ones. A sampled restaurant confirms with their own signature. Fail to answer and the collector's entire deposit is burned — and the deposit is half the value of the load it secures, so it's worth more than anything the fraud could earn. Fake 5% of a hundred-pickup load and you have an 83.9% chance of losing all of it. Cheating loses money on average, and that's the fun bit that enforces justice on the design. We can't fake our own numbers either. Every litre needs a signature from a restaurant we don't employ, and when the audit fires it asks that restaurant directly — their signature is what stops a slash, not what triggers one. They're the check on us, not the other way round. Also: the trucks are shares. Each one is issued as an ERC-3643 security token — allow-listed holders, transfer restrictions enforced on chain — so you can own a piece of a truck and get paid from what that truck actually earns. Not from a promise. From money that showed up. All of this is currently running on Hedera testnet, and every claim has a verifiable tx. We make UCO provable back to the exact fryer it came from, so buyers stop paying premium prices for fake waste Biofuel. Anyone can own a piece of the truck that collects it.
How it's made
Solidity on Hedera testnet with Foundry, a Next.js 16 frontend, viem for chain reads and writes, and Privy for wallets. One contract rather than four, given that splitting it into a registry, escrow, a lot ledger and a sampler would have bought four deploys, four verifications and cross-contract authorisation for no change in behaviour. Very open for feedback about this. For the operation to flow onchain, pickups need two EIP-712 signatures over the same struct from two distinct registered parties. Clients signs in the browser with a Privy embedded wallet created from an email address (p.e:restaurant owner), and never sends a transaction or holds HBAR. The collector is a company (Us), so our half comes from a Privy server wallet bound by a policy that permits us three things: signing Batch typed data for the TURMOIL domain on chain 296, transactions to Turmoil.sol, and approve on the settlement token with Turmoil.sol as spender. Drivers authenticates with Privy, the server verifies that access token against the app's JWKS, and checks it against the operator's driver list. Only then does the company wallet sign. Drivers never hold the key they are using. We tested the refusals instead of assuming them: a Batch carrying a different verifyingContract, an HBAR transfer to any other address, and a transfer() of the wallet's own USDC all come back policy_violation, while approve(Turmoil, ...) still passes. A leaked copy of the server's credentials therefore steals nothing :) Hedera executes three jobs: Audit sampling calls the PRNG system contract at 0x169 (HIP-351) after a lot seals, so the collector cannot know which pickups will be checked, and the operator cannot redraw until it likes the answer. HIP-904 auto-association is what makes the gasless claim facts: the contract and the embedded wallet both carry maxAutomaticTokenAssociations = -1, so clients are paid without ever signing an association tx. Since we believe in decentralizing everything, we wanted the trucks that run the operations to become ownable RWA's, opening doors to everyone that wants to attack this fraud back. The truck produces dividends proportional to the truck ownership. ERC-3643 shares issued through Asset Tokenization Studio with an allow list, internal KYC and a registered credential issuer. Ran the lifecycle through to a dividend an approved holder was actually paid. Frictions worth recording, because some of them were a pain: - Privy simulates a transaction before it evaluates policy. That made scratch a bit. - Hedera's default gas estimate is too low for ATS diamond calls. Five role revocations returned status 0 with no reason until we passed --gas-limit 1000000. - Circle's USDC faucet lists Hedera testnet, reports success, and delivers zilch. Saw the issue in Hedera discords, so created a DemoUSD for settlement to run on a 6-decimal stand-in. payToken is immutable and set from the constructor tho, so binding the real token is a config change, which is how the first deployment ran. - server-verify.hashscan.io redirects to sourcify.dev/server and forge cannot follow it, reporting only "error decoding response body". Pointing --verifier-url straight at Sourcify verified both contracts in seconds. It's worth commenting that before I knew about EU's 2025/2181 - I was hyped to realize I was resolving a high-profile crime/fraud that's been running for years. When I learnt about the resolution, I am happy to realize I'm providing a platform for solving it. An interesting 'hacky' thing that happened is that, after a mentor feedback with many links to research, I ran some OSINT on the C-levels as well DYOR'd a somewhat popular project built on VeeChain, with a similar ethos as mine. I'll let you rabbits have fun with that one - not worth expanding. Busy on TURMOIL rn.