Get funding for your proof of concept blockchain application. Apply to the Lisk Builders program here.

Building the Smart Inventory Project

  • By Lemii in Apps
  • 21 Jul 2020
  • 4 min read

Smart Inventory is a decentralized application that tracks the history and life path of valuable items. Users can claim ownership of an item or transfer their owned items to another user. With each action certain metadata is supplied that populates the dataset of an item. This enables users to analyse its history.

 

Why blockchain?

Second hand markets for valuable items are often fraudulent and it can be challenging to obtain a true and verifiable history. Substantial sums of money can be both made and lost, by manipulating historical data of certain goods.

Smart Inventory tries to solve this problem by tracking the complete history of an item. This data is then stored in a decentralized manner, making it difficult to tamper with. By avoiding the dangers of a centralized database, an item’s history can now be proven and therefore its value can be more easily guaranteed.

 

Use cases

For this proof of concept I decided to go with a smaller type of network that focuses on one particular type of item. This is not a technical limitation, but rather is done to increase the probability that the existing data is populated more sufficiently.

In other words, if more of the same identical items are registered, it is easier to generate comparison data. On the other hand, if you spread the types of items too sparsely, there won't be much to compare with.

Some use cases for a network are listed below:

  • Vintage synthesizers
  • Watches
  • Art (of any kind)
  • All kinds of rare or luxury goods

These are all valuable items that have their own “community” and “enthusiasts”. Each community can run their own network, focusing only on the goods that they are excited about. 

However, as mentioned above, nothing is technically stopping you from listing everything, if that’s what you prefer.

As you can see in the front end, the network of choice for this proof of concept is vintage synthesizers.

 

How does it work?

Each item on the network is basically an `account` with a custom asset object. The properties of this object can be seen in the code snippet below:

 

Account

 

Please note that the `identifier` is used to let the frontend know what type of item it actually is. These identifiers are assigned beforehand in the client.

By sending a `RegisterItemTransaction` to an address, the custom properties of the asset object are added to the account, and the account is then transformed to an 'ItemAccount'.

 

Register item

 

The properties of this asset can then be modified by sending a `TransferItemTransaction` to the account.

 

Transfer item

 

As you can see only the owner of an asset can transfer an item.

By going through the transaction history of the account, specifically by filtering on these custom transaction types, you can analyze the history of the account (item), and in turn generate data from it.

 

Custom Modules

Smart Inventory makes use of the custom lisk-extended-api module (created by Moosty), to be able to effectively query the database. This addition makes it possible to search for values in the custom asset fields, something that is not yet supported natively.

For example, here it is being used to search the `owner` field:

 

Extended API

 

Smart Inventory In Action

Item registration

 

Register

 

 

Item transfer

 

Transfer

 

 

Item view

Item overview

You can try the proof of concept here.

 

Conclusion

I had great fun making this proof of concept and I hope this blog gave you some valuable insight as to how it was created.. I encourage everyone to take a look at the source code and play around with the app. The relevant links are provided below.

If you have any questions, feel free to reach out on Discord (user `lemii#0001`).

 

Resources

 

If you feel inspired and want to build your own proof of concept blockchain application, check out the Lisk Builders program. More information about the program and the application procedure can be found on the Lisk webpage for the Lisk Builders program.

Disclaimer: This blog post was written by our community members, Lemii (Lisk.chat username: Lemii) as part of his participation in the Lisk Builders program. 

 

Lemii

Lemii is a full-stack developer based in the Netherlands who has been active in the Lisk community since 2017. He is the author of numerous tools such as Lisk Manager, Lisk DFC, and Lisk File Manager. Previously he has created the Lisk Inviter and Chronicer proof of concepts. Lemii also runs the Lisktools.eu website where you can find additional Lisk services such as secure APIs, explorer mirrors, community programs, and more.