Image source: https://www.healthcastle.com/sustainable-sushi-good-ocean/

From fish to sushi in UTXO

Paul Sitoh
Dec 18, 2018 · 5 min read

Tracking and recording things of value from source to consumption is the heart of any supply chain activity. The complexity of this task depends on the kind of the things we would like to track.

If we wished to track a fish from where it was caught and then to the point where it is handed to a fish monger, as a whole, the task is relatively straight forward. Now, imagine a fussy sushi consumer who insists on having every ingredients comes from verifiable sources.

Consider the journey of a fish from the point where it is caught to where it ends up as a sushi. These are roughly the kind of, hypothetical, transactions the fish has to endure:

  • Bob caught a fish from his pond;
  • Bob sells the fish to sushi chef Anna;
  • Anna cuts two slices of the fish, wraps two sushi rolls, and serves them to Chrysa;
  • Anna cuts a slice of the fish and serves one sushi roll to John.

Throughout the fish’s journey to becoming a sushi, let’s imagine a technology in the form of a cellphone that has the capability of extracting a hash of the DNA and the weight of the fish in any form: whole or sliced. Bob, John, Anna and Chrysa are presented with a mobile app that enable them to take picture of the fish and update a ledger.

How would you model the state of the fish as it endures the transactions mentioned above?

How about modelling it as a series of Unspent Transaction Output (UTXO)?

Unspent Transaction Output (UTXO)

UTXO is a form of ledger used in bitcoin to record the amount of bitcoin as it is being spent in the system. As shown in the diagram below, the amount of bitcoin in the system and its distribution is recorded as a series of inputs and outputs resulting from a transaction. For detailed discussion of how bitcoin and UTXO works please refer to https://medium.com/@sunflora98/utxo-vs-account-balance-model-5e6470f4e0cf.

Image source: https://bitcoin.org

Let’s replace bitcoin with fish as the thing that we wish to track and we’ll model our fishy asset this way:

Data structure: Left (hypothetical) bitcoin, right (data structure for fish)

Next let’s see how this model is updated as a series of UTXO instances in relation to the transactions described above.

Let’s UTXO!

Assuming we are tracking the fish by DNA with a hashed value 1234.

The first thing the fish has to endure is being caught by Bob. The fish weighing 1kg was living in Bob’s pond before it was caught. This is recorded in our UTXO as shown below.

Next, Bob sells the fish to Alice and this is recorded as shown below:

Alice then decides to make two sushi rolls and offer it to Chrysa. Chrysa consumes the two sushi rolls each with 0.1kg slice of the fish that Bob sold to Anna. This transaction is recorded below.

Anna with 0.8kg of the fish left, then makes one sushi roll and offers it to John. This is recorded as shown below:

You will notice that any remainder of the fish is also recorded as an output with ownership assigned to Anna. This is useful because through the lifecycle of the fish we can track its state (i.e. ownership) accurately before and after a transaction.

What about the rice?

What if Chrysa and John are fussy consumers and also demand to have the rice from source to sushi tracked too?

No problem. The UTXO can easily be used to track multiple supply chains. Let’s revisit our sushi example again. In this case, we are tracking rice by its DNA, which has a hash value of 4567. The UTXO model for tracking rice and fish to sushi is shown below.

As can be seen from the example, adding additional lifecycle tracking is a simple case of recording as a series of inputs and outputs.

Conclusion

In this blog, I have demonstrated the use of UTXO to track two key ingredients that goes into sushi: rice and sushi.

In traditional accounting double entry model, the focus of attention is on the owners of the thing of value — i.e. fish and rice. Consider in the fish as an example, we would record flow of assets from the perspective of the fish’s owner. We would determine if the fish is credited or debited to the owner. Whilst we could use double accounting to reflect the ownership of fish by recording movement assets (e.g. fish and rice) as monetary transfer in traditional accounts, it is difficult to trace the provenance of assets with any accuracy.

The focus of UTXO is to track input and output from the perspective of transactions. For example, “Alice slicing the fish” is a transaction that we perform on the fish. UTXO records the inputs into the transactions and the output. Owner can be easily attributed without the need for complicated relational mechanism.

Admittedly, the use case is somewhat contrived, but it illustrates the capability of UTXO to model complex products such as Cars, Aeroplanes, Ships, etc.

Consider a product like a Car. It is composed of many parts. Parts are worn off and replaced over the lifecycle of a car. So a car may have the same registration number, thus legally the same car, it is actually not the same car. You won’t necessary want to offer warranty to a car as whole, when every individual part come with their own service warranties.

UTXO could, as demonstrated, help solve supply chain problems involving things that have complex lifecycles.

Click to read today’s top story

Coinmonks

Paul Sitoh

Written by

Blockchain, cloud technology, software development, lean startup, design thinking and kanban/agile enthusiast

Coinmonks

Coinmonks

Coinmonks is a non-profit Crypto educational publication. Follow us on Twitter @coinmonks Our other project — https://coincodecap.com

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade