The source code for this blog is available on GitHub.

People for Food - a food health oracle

Posted by Tom Kreynin on

Intro - Food health oracle This document lays out a V1 of the process for submitting a food product to the People for Food protocol and the process for users to resolve disputes by staking PFF tokens on the highest quality submission.

The goal of People for Food is to provide the most trustworthy food information, and serve as the source of truth for food information to third parties in the food ecosystem, such as food producers, food delivery apps, health and fitness apps, etc. Importantly, PFF accomplishes this by serving 2 functions: Gives trust that the nutritional information that describes a food product is accurate. That the algorithm used to score the healthfulness of food isn't biased.

The first is accomplished through futarchy, where honest data about food products is established by individuals betting the native PFF token on the submission they believe is the most accurate at describing the food products. Based on the submission with the most PFF tokens bet on it, an official nutritional information set is published for the food product and established as truth.

The second is accomplished by subjecting the AI model used to score healthfulness to governance by a DAO. Updates to the scoring algorithm happen on the scale of months to a year. Voting power should scale with provable commitment to the long-term health of the protocol (for instance, amount of PFF bet). Votes may be delegated.

For both functions of the PFF protocol, the incentive for individuals betting PFF tokens on proposals is to preserve PFF’s credibility as the most truthful source of food information. Voting against this interest devalues PFF by disincentivizing third parties from integrating with it because its credibility as the source of truth for food information is diminished when it publishes inaccurate food information for food products.

How it works

The goal of People for Food is to be the most accurate source of food health information so that the entire food ecosystem can provide accurate health information to consumers, including on food packaging, in food apps, in health and fitness apps, and in any medical systems that integrate with People for Food and rely on the accuracy of its information.

The goal of People for Food is to provide accurate health information on as wide an array of food products as possible, without trusting on faith that anybody who submits a food product, or trusting on faith anyone who reviews the accuracy of the food product information submitted. To remove reliance on trust, economic incentives are created that reward accurate reporting of food information, and make players who report false information poorer.

People for Food has a native token PFF. Holders of the PFF token collect a % of all fees collected by the People for Food protocol. The more transactions take place on the People for Food protocol, the more fees that holders of PFF collect. Given that the value of People for Food is to provide accurate information about food, holders of PFF are incentivized to act in a way that makes the People for Food more effective at providing accurate food information.

Anyone can attempt to publish a food product to People for Food’s catalogue. Such a person is called a “publisher”. To attempt to publish a food product, a publisher must submit the minimum of the food information details required for a food’s health to be evaluated (reference), and pay a submission fee. This initiates an automatic process where it’s checked if the food product is a new entry in the catalogue, or if it matches an already existing food product in the catalogue. If a matching food product is found, the publisher is given the option to cancel the submission. If they choose to proceed, they must pay a dispute bond to initiate a dispute against the currently published food product. The dispute round is a phase during which any PFF holder has the opportunity to dispute the tentative submission. The tentative submission is the currently published food product in the case that one exists, or the newly submitted food product in the case that one doesn’t. A dispute round may last up to 7 days (with the exception of the very first dispute round, which may last up to 24 hours). At the beginning of a dispute round, the tentative winner is the submission that will become the published food product if it is not successfully disputed by PFF holders. A dispute consists of staking PFF (referred to as dispute stake in this context) on a submission other than the current tentative submission. A dispute is successful if the total amount of dispute stake on some submission meets the dispute bond size required for the current round.

Anyone with PFF can submit a different set of information for the food product in question, and thereby become a reporter. Anyone with PFF can participate in the dispute by either becoming a reporter, or by staking PFF in one of the proposed submissions.

The dispute bonds need not be paid in their entirety by a single user. The People for Food platform allows participants to crowdsource dispute bonds. Any user who sees an incorrect tentative winner can dispute that outcome by staking PFF on a submission other than the tentative outcome. If any submission (other than the tentative submission) accumulates enough dispute stake to fill its dispute bond, the current tentative submission will be successfully disputed.

In the case of a successful dispute, one of two things will happen: the market will either undergo another dispute round immediately, or the market will wait until the next dispute window begins before undergoing another dispute round.

All dispute stake is held in escrow during the dispute round. If a dispute bond is unsuccessful, then the dispute stake is returned to its owners at the end of the dispute round. If no dispute is successful during the dispute round, then the tentative submission is successfully published for the food product in question. A dispute’s final outcome is the tentative submission that passes through a dispute round without being successfully disputed. People for Food’s smart contracts treat final outcomes as the determinant of truth in regards to food health information.

Disputes can be initiated anytime by users for a food product by posting a dispute bond that passes the minimal threshold for initiating a dispute for the food product in question, and supplying a submission. The dispute bond minimum threshold is set dynamically.

All unsuccessful dispute stake is returned to the original owners at the end of every dispute round. All successful dispute stake that championed the published submission is rewarded a multiplier on their staked PFF. All dispute stake (whether successful or unsuccessful) will receive a portion of the reporting fee pool from the current dispute window.

The market may enter the waiting for window phase, before undergoing another dispute round. The purpose of this is simply to slow down the dispute process as the bonds get larger – giving honest participants more time to crowd fund the larger dispute bond. This reduces the risk of a critical failure mode: one where the most accurate submission doesn’t become the tentative submission because honest participants didn’t have time to raise the funds needed to dispute a false tentative submission.

During this phase, submitting is on hold until the end of the current dispute window.