IoTone / BlockchainInABox

A suite of blockchain applications, completely self contained in an embedded linux AARCH64 based device
0 stars 0 forks source link

An asset tracking system based on blockchain + NFC #8

Open truedat101 opened 5 years ago

truedat101 commented 5 years ago

Concept:

Asset tracking is one of the growth applications for IoT. A goal for this would be to enable very simple zero configuration asset tracking. It only requires an NFC reader/writer, standard NFC tags, and "things" to be tracked. The advantage of this approach using blockchain is to that that (1) immutable data (2) secure/verifiable transactions (3) robust system with reliability & performance improved by number of nodes participating (4) commodity NFC devices and tags make deployment cost very low.

Ideally anyone can start using this without any configuration. It's possible specialized asset templates would be available for tag provisioning, but it should be possible to pre-provision tags with a .csv file and matching tag ids.

Draft 1

IoTone-Substrate-Coffee-Asset-Management
truedat101 commented 5 years ago

@davicitoafc let's discuss this at some point after some of the BLE work is done on the other research on Flutter.

truedat101 commented 5 years ago

@tagstand2 heads up, let's flesh out what the customer requirements are for an Open Source NFC based asset tracker. Out of that, I'll tease out blockchain specific requirements.

truedat101 commented 5 years ago

@tagstand2 bump. I'll send you a link to this one.

truedat101 commented 5 years ago

Possibly build this with cruzbit https://github.com/cruzbit/cruzbit, or finish work on the shell project.

truedat101 commented 4 years ago

Cruzbit is written in Go.

truedat101 commented 3 years ago

At this point I'm looking at IOTA to build upon. It seems they do have some official architecture for private "tangle" (node).

truedat101 commented 3 years ago

See:

https://chrysalis.docs.iota.org/one-click-private-tangle

https://hornet.docs.iota.org/getting_started/private_tangle

truedat101 commented 3 years ago

Concept wise this demo should show off a fictitious example of coffee bean "chain of custody" from harvest to delivery to a consume. Some considerations:

truedat101 commented 3 years ago

So my first attempt with IOTA required some docker stuff to set up, which I expect at least I should be able to get running on Ubuntu. But there were bugs in that. No response after 3-4 days. I'll put it aside. Not sure how active the project is at this point.

truedat101 commented 3 years ago

So here are the new candidates:

truedat101 commented 3 years ago

Will pick this up later in the week.

truedat101 commented 3 years ago

Cosmos Starport

https://docs.starport.network/getting-started/

This looks very good.

truedat101 commented 3 years ago

The cosmos sdk is good. I don't completely grasp the concepts out of the gate, but it looks like it is in use by a number of projects, including the fetch.ai project.

truedat101 commented 3 years ago

mina looks very slick . It's blockchain size is small I guess. However, I could not get it up and running on my test system. It's a complex ocaml build and it didn't build on my M1 mac.

truedat101 commented 3 years ago

Not clear that it supports other features that might be aligned with this project. Will put it aside for now.

truedat101 commented 3 years ago

Based on the goals, I think probably DOT is the best way to go, using Substrate. See the main docs:

With the Substrate Node: You can run the pre-designed Substrate Node and configure its genesis block. In this case, you just need to supply a JSON file and launch your own blockchain. The JSON file allows you to configure the genesis state of the modules that compose the Substrate Node's runtime, such as: Balances, Staking, and Sudo. You can learn more about running a Substrate node in the Create Your First Substrate Chain and Start a Private Network tutorials.

truedat101 commented 3 years ago

This is the tutorial https://substrate.dev/docs/en/tutorials/create-your-first-substrate-chain/interact

Run yarn on the frontend, and on the backend its a cargo build.

It does not allow the frontend to be accessed from a remote system because the frontend is probably pointing to a local WS.

Try to fix that.

truedat101 commented 3 years ago

Here's how to run the node without security on:

--ws-external Listen to all Websocket interfaces. Note: not all RPC methods are safe to be exposed publicly. Use an RPC proxy server to filter out dangerous methods. More details HERE. Use --unsafe-ws-external to suppress the warning if you understand the risks.

truedat101 commented 3 years ago

basically to run the backend with security on, it won't listen to all connections from all sources. And it will be trying to authenticate incoming connections that are not local. I think to get a secure node going, you'd need an SSL cert, and set up nginx or something in front. For now, punt on the security and just explore using substrate as a viable option for building the concept.

truedat101 commented 3 years ago

That works.

truedat101 commented 3 years ago

So there are a few lists to look at with some tools and various projects.

https://polkaproject.com/#/projects?cateID=0&tagID=0 https://substrate.dev/awesome-substrate/

But this one I think covers the use case:

https://github.com/substrate-developer-hub/substrate-enterprise-sample

truedat101 commented 3 years ago

Anyway, will explore more later this week and try the enterprise use case.

Key point is:

truedat101 commented 3 years ago

Cosmos SDK will be my fallback.

truedat101 commented 3 years ago

The only detail right now missing, no projects seem to be addressing is the tie in with NFC. I think for starters, I could use NFC in the most basic this is the asset + unique ID to track. So instead of a barcode, it's an NFC tag.

truedat101 commented 2 years ago

Here are follow ups on the concept:

My goal is to create a simple coffee "supply chain" example that shows the harvest -> retail progression of the beans. The asset tracking + chain of custody app would use an NFC tag to encode the data into the blockchain, with different scans of the tag carrying out actions related to the asset:

At any point in the process someone can scan a tag and get the chain of custody and track the asset, just by scanning the tag. This all lives on the blockchain (in the box that I supply for now). It could be on the greater world's blockchains, but actually the goal is to run it on a private blockchain that doesn't have fees associated with it for now, and supply chain members would run nodes as participants.

truedat101 commented 2 years ago

The code base we will start with is from our port of the substrate enterprise sample v3: https://github.com/IoTone/substrate-enterprise-sample-v3

This is in progress. I'll try to find out when we think this is done.

truedat101 commented 2 years ago

In terms of architecture, I think we need the following high level concepts as modifications to the original enterprise sample:

We will likely need:

truedat101 commented 2 years ago

Heads up @Damfortx8 I'll be writing up a spec for our requirements on this part of the project. I think we will just include the substrate v3 enterprise sample as a submodule.

truedat101 commented 2 years ago

In terms of NFC utilization, I think we just use the concept of a DID and user/roles associated with an NFC card help provide the identity or signing keys of the user in the system. On the other side, not related to the user identity but to the products, we would provide the product identifier encoded into the nfc tag, and make this be the thing that you scan when you want to pull up the chain of custody and learn of manufacturing origins .

truedat101 commented 2 years ago

I've added a design for what we want to do build towards. We will base this on the substrate v3 port we have made. I will separately be exploring how we bring NFC into the enterprise substrate v3 demo.

truedat101 commented 2 years ago

Migrating this issue to: https://github.com/IoTone/substrate-coffee-supplychain/issues/1

truedat101 commented 2 years ago

Close this out after we've completed the prototype.