GithubHelp home page GithubHelp logo

benrito / libfood Goto Github PK

View Code? Open in Web Editor NEW

This project forked from noahlevenson/passerby

0.0 1.0 0.0 2.89 MB

Free Food: a decentralized open protocol to make food delivery fair again

Home Page: https://freefood.is

License: MIT License

JavaScript 93.77% Java 6.23%

libfood's Introduction

libfood

Youtube demo

๐Ÿงญ Table of contents

๐Ÿ” What is libfood?

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.

๐Ÿ‘œ Portability as a design requirement

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

๐Ÿง Implementation overview

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

๐Ÿ’พ Technology overview

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.

โ“ Why Free Food?

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.

๐Ÿง  Active research

  1. An improved trust metric based on a deep learning approach to network community detection

  2. Star rating reputation system built atop the distributed ledger

  3. Scalability to ~300k total restaurant peers and ~20M total diner peers

  4. Fully decentralize the distributed ledger โ€” currently proof of authority, switch to proof of stake/proof of reputation/proof of work

  5. Decentralized delivery logistics

๐Ÿ’ป Screenshots

libfood's People

Contributors

noahlevenson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.