Introducing Olive Oil Trust

View on GitHub

Blockchain technology is well suited to deal with a number of challenges that supply chains are facing nowadays, such as data management and data quality.

Easy-to-access, immutable and up-to-date information is key to improving both trust among consumers in the product authenticity and the visibility of members in the value chain.

In order to tackle these issues, I have developed Olive Oil Trust and this is the first post of a series of posts introducing it.

In this article

Concept

Olive Oil Trust is an olive oil traceability solution built on Ethereum that allows its members to trace and trade an ERC-1155 token representation of their own products, and end customers to trace and buy these tokens.

It is conceived to adapt the workflow of the olive oil long value chain to the blockchain through the use of smart contracts.

This can be seen as a collaboration network of olive growers, olive oil mills, bottle manufacturers, bottling plants, distributors, retailers and certifiers.

Certifiers attest to the validity of a product for a given standard through the creation of certificates.

These certificates as well as types of tokens can be used to set instructions for the creation of a dependent token of a given type.

Therefore, introducing an ontology for the creation of dependent tokens (similar to the model introduced by Westerkamp et al.).

A dependent token is a token that depends on the availability of other tokens to be minted, being the result of transforming these tokens into a new one.

Independent tokens, on the other hand, are tokens that do not require other tokens to be minted.

As we can see, there is a specificity when it comes to the types of tokens that can be used when minting a dependent token of a certain type.

However, if the required types of tokens were certified in advance, a member could set instructions using certificates instead of types of tokens.

This is, tokens of any type that is certified by the certificate listed in the instructions could be used instead of tokens of the only type indicated if no certificates were used.

Product flow

The sequence of actions needed for an end customer to own an olive oil bottle token in Olive Oil Trust is summarised below:

  1. An olive grower mints a batch of a token that represents some type of olives and deposits it in an escrow.

  2. An olive oil mill that is interested in those tokens makes an offer, therefore setting the price for these olives.

  3. If the offer is convenient, the olive grower closes the deal, otherwise, the offer may be reverted and the olive grower would have to wait for a new offer.

In theory, olive growers bring their olives to the olive oil mills themselves so that they can be cleaned, classified, sampled and weighed, thus knowing the quantity of olive and its fat, which determines its price.

  1. The olive oil mill sets instructions on how to mint olive oil of a certain type. For instance, 7 kg of olives of the variety Picual are needed to produce 1 litre of extra virgin olive oil.

  2. The mill mints a batch of olive oil and deposits an amount of olive oil tokens in an escrow.

  3. A bottle manufacturer mints a batch of bottle tokens of some type and deposit them in an escrow, setting a price in advance.

  4. A bottling plant considers the olive oil mill's and bottle manufacturers' escrows and pays the price of these tokens with the following agreement of the sellers.

  5. The bottling plant sets instructions on how to mint a certain type of olive oil bottle and, now that the bottling plant owns olive oil tokens and bottle tokens, proceeds to mint a batch of them.

  6. In order for the bottling plant to trade these olive oil bottle tokens with a distributor, it packs them (in a figurative sense, more info in the following post) into an industrial unit token, i.e. a token that represents a pallet, and deposits the pallet token in an escrow.

  7. Both buyer and seller reach an agreement and the distributor gets the ownership of that pallet in exchange for its price.

  8. Now, in order for the distributor to trade the olive oil inside the pallet it has to unpack the pallet. This will transfer the ownership of the tokens within the pallet from the industrial unit contract address to the address of the distributor and burn the token that represents the pallet.

  9. Then the process is repeated but with a retailer as the buyer. The distributor packs a number of olive oil bottle tokens and trades a pallet token that comprises these units with the retailer which then unpacks it and sells the olive oil bottle tokens to an end customer.

Repository

Three main parts, or workspaces, constitute the project monorepository: smart contracts, subgraph and front end.

In the following posts I try to explain these parts in detail:

References

  1. M. Westerkamp, F. Victor and A. Küpper, "Blockchain-Based Supply Chain Traceability: Token Recipes Model Manufacturing Processes," 2018 IEEE International Conference on Internet of Things (iThings) and IEEE Green Computing and Communications (GreenCom) and IEEE Cyber, Physical and Social Computing (CPSCom) and IEEE Smart Data (SmartData), Halifax, NS, Canada, 2018, pp. 1595-1602, doi: 10.1109/Cybermatics_2018.2018.00267. [DOI link]

Related posts

DeFi

End-to-end guide to creating an ERC-20 token-specific DApp

Decentralized application to operate with a mintable ERC-20 token

Traceability

Introducing Olive Oil Trust: subgraph

Subgraph to query data from Olive Oil Trust in an efficient way using TheGraph.

DeFi

How to build a DEXs analytics application

Introduction to obtaining and representing DEXs data using TheGraph and React.js

zk-SNARK

How to build a zero-knowledge DApp

This post offers an introduction to how to develop an application capable of generating and...

Traceability

Introducing Olive Oil Trust: smart contracts

Olive Oil Trust smart contracts are implemented in order to adopt a set of rules...

Traceability

Introducing Olive Oil Trust: front end

Next.js application that gives support to members and customers in Olive Oil Trust, and reduces...


Ready to #buidl?

Are you seeking collaboration on a Web3 project or a developer to join your team?. Then, do not hesitate to contact me by e-mail or on my LinkedIn profile. You can also find me on GitHub.