- What is libfood?
- Portability as a design requirement
- Implementation overview
- Technology overview
- Why Free Food?
- Active research
- Screenshots
libfood is the reference implementation of Free Food, a decentralized location-aware p2p protocol to make food delivery fair again (and make Grubhub obsolete).
Free Food eliminates third party middlemen, enabling host devices to self-organize as a geosearchable peer-to-peer restaurant marketplace. Using the Free Food protocol, a hungry person can search for nearby restaurants, browse menus, and place an order directly with one click โ all through one convenient interface.
It's the "missing protocol" for local e-commerce that the internet should have shipped with, and part of the Web 3.0 movement to re-decentralize the web.
For software clients which operationalize libfood for end users, see Free Food Battlestation and Free Food Hotline (coming summer 2021).
libfood is pre-alpha and in active development. There will be bugs, security issues, missing features, etc.
Free Food was developed at Consumer Reports Digital Lab by Hacker in Residence Noah Levenson.
Ever seen those tablet devices in a restaurant kitchen? Restaurant owners are accustomed to apps that run on mobile devices. But hungry people shouldn't be expected to download a mobile app to order food. Thus, a mandatory objective of this implementation is to ensure portability across a variety of disparate JS runtimes.
JS Runtime | Compatible? | Dependencies | Notes |
---|---|---|---|
Node.js | yes | none | |
browsers | soon | none | |
React Native | yes | ~3 shims | Android only; native Java optimzations, see fnative |
libfood is a layered API:
Module | Description |
---|---|
fkad | distributed hash table |
fpht | prefix hash tree (aka distributed trie) |
fgeo | functionality for describing and transforming geographic data |
fid | identity creation, authentication, and reputation |
fdlt | generalized distributed ledger for managing arbitrary contracts |
fksrv | distributed public keyserver |
fstun | STUN implementation for NAT traversal |
flog | logging |
fcrypto | cryptography |
ftypes | elementary data structures |
futil | utility functions |
fbuy | e-commerce layer: menus, transactions, payments, sms, statuses, etc. |
ftrans | transport layer with hybrid encryption |
fnative | native platform optimizations |
fapp | public API |
Location-aware peer discovery is accomplished primarily through the use of a Morton-order curve and a prefix hash tree, a distributed data structure which enables efficient range queries over a distributed hash table.
The network is secured using several mechanisms: Resource providers participate in a distributed system of peer-signed certificates โ i.e., a "web of trust." A restaurant's trustworthiness is based on the number of signatures it has received from other restaurants and other features of the trust graph topology. This system exploits the simple observation that restaurant owners tend to know and cooperate with other local restaurant owners.
Free Food has a distributed keyserver built atop a distributed ledger; the protocol includes a generalized distributed ledger with a stack-based virtual machine for executing arbitrary contracts, based largely on the design of the Bitcoin blockchain.
Identity creation for resource providers is made costly with a computational proof-of-work mechanism based on the partial preimage discovery first employed by Hashcash. Taking inspiration from systems used to verify real world identities on messageboards like Reddit โ as well as the anti-catfishing systems employed by Tinder and Bumble โ Free Food requires resource providers to supply a photographic proof of identity which includes a unique symbol which is mathematically bound to the proof-of-work associated with their public key.
Free Food implements STUN for NAT traversal.
At identity creation time, Free Food uses OpenStreetMap's Nominatim open source geocoder to convert street address to latitude and longitude. OpenStreetMap data is ยฉ OpenStreetMap contributors, available under the Open Database License.
Third party food delivery apps like DoorDash and Grubhub are parasitic middlemen which are destroying small businesses and raising prices for everyone. They're also deeply unprofitable companies which are entirely the product of Silicon Valley speculation.
As the Wall Street Journal and others have reported, some of these platforms have recognized that offering third party delivery services as a centralized middleman is a failed business model. Consequently, there is a push to abandon delivery logistics entirely โ focusing instead on providing nothing more to consumers than an aggregated ordering interface. For this "service," which is merely to broker local restaurant orders, middlemen like Grubhub charge restaurants 30% per transaction. This far exceeds the profit margins of a typical restaurant.
The goal of Free Food is to provide this function as a protocol rather than a platform, eliminating the middleman by enabling the world's restaurants to effortlessly self-organize as a decentralized marketplace.
In other words: Free Food lets you search for nearby restaurants, view their menus, and place an order with one click โ but without paying fees to a parasitic third party delivery platform.
Free Food is not meant to replace restaurant e-commerce tools like Toast, Square, or Bentobox. Rather, Free Food aims to provide an aggregated marketplace "frontend" which can integrate with these platforms: Customers use Free Food for convenient restaurant discovery, and at checkout time, orders are processed using each restaurant's payment gateway of choice.
-
An improved trust metric based on a deep learning approach to network community detection
-
Star rating reputation system built atop the distributed ledger
-
Scalability to ~300k total restaurant peers and ~20M total diner peers
-
Fully decentralize the distributed ledger โ currently proof of authority, switch to proof of stake/proof of reputation/proof of work
-
Decentralized delivery logistics