# FoodBlock Protocol

A shared language that lets people, applications, devices, robots, and autonomous systems understand one another and coordinate across the food economy.

## The Shared Layer

Shared standards let different systems coordinate without giving one company control. FoodBlock provides that neutral layer for food: a common format anyone can implement, use, and build upon.

## The Primitive

Every FoodBlock follows the same three-part structure: what it is (type), what is true about it (state), and what it connects to (refs). That simplicity lets every participant create blocks in the same way, whether it is a multinational supply chain, a market stall trader, a robot, or an autonomous vehicle.

```
hash = SHA-256(canonical(type + state + refs))
```

## Six Base Types

- **Actor**: People, businesses, machines
- **Place**: Locations and facilities
- **Substance**: Ingredients, products, materials
- **Transform**: Processes that change substances
- **Transfer**: Movements of ownership or goods
- **Observe**: Measurements, reviews, certifications

These types can be extended with subtypes.

## Content-Addressed Identity

Each FoodBlock gets its identity from the information inside it. Change any detail and the identity changes too, so different systems can be sure they are seeing the same record.

- **Changes are visible**: A record cannot be quietly rewritten. If any detail changes, it becomes a new record with a new identity.
- **Works without a connection**: A farmer, fisher, driver, or inspector can create a record without internet access. It can be shared and checked when connectivity returns.
- **No central registry**: No company or government needs to issue the identifier. The record creates its own identity, so different systems can recognise the same information.

## Provenance

Every FoodBlock connects to the people, places, ingredients, events, and claims around it. Together, those connections create trust and transparency across the whole food economy.

## Trust Emerges

Like reputation in a social network, trust grows from signed interactions between people, businesses, inspectors, machines, and certifiers over time. Choose what you want to evaluate to see which evidence matters.

## The Network

A common format lets businesses, devices, and agents contribute to one connected record of the food economy. Bakeries write products and orders, cold-chain sensors write temperature readings, retailers write receipts and stock, customers write purchases and reviews, food banks write surplus collections, and agents write queries and decisions.

## For Developers

FoodBlock only defines the structure of a shared food record. It does not define the application around it. Each developer adds to a pool of data that other tools can use and build upon.

The specification and all reference implementations are public and permissively licensed. Start with the SDK and documentation available on GitHub. No permission is required to implement FoodBlock.

## Governance

No single entity can own the standard through which an economy records its food data.

- **Open source, MIT licence**: The specification and all reference implementations are public, permissively licensed, and available to anyone. No permission is required to implement FoodBlock.
- **Federated by design**: FoodBlock is federated like email. Operators run their own servers and exchange blocks with peers. There is no central authority that can deny access or revoke participation.
- **Participant data stays participant capital**: Producers, venues, and makers own the blocks they create. No platform intermediary accumulates a proprietary copy of an industry's operational history and uses it as leverage.
- **Natural-language entry lowers the floor**: Any AI system that understands natural language can produce standards-compliant FoodBlocks. Small producers with no technical staff are not excluded from the shared record.

## Autonomous Systems

Autonomous systems are first-class actors in the FoodBlock protocol.

- **Registration**: Autonomous systems register through signed actor FoodBlocks with Ed25519 keypairs and scoped capabilities.
- **Permissions**: Scoped by block type, amount caps, auto-approve thresholds, and rate limits.
- **Draft to Approve**: Low-value actions auto-approve. High-value actions queue for human confirmation.
- **Event Subscriptions**: Subscribe to block type patterns. New blocks trigger handlers in real-time.
- **Memory**: Preferences and learned state stored as append-only observe.preference blocks.

## Links

- Full HTML page: https://foodx.network/protocol
- FoodBlock whitepaper: https://foodx.network/foodblock.md
- FoodBlock technical spec: https://foodx.network/foodblock-technical-spec.md
- FoodOS preview: https://foodx.network/foodos.md
- GitHub SDK: https://github.com/FoodXDevelopment/foodblock
