How to use blockchain for your business ?
Ever tried to use blockchain for your business? Find out here, how to use blockchain features, map them to a business data layer – and ultimately, operate safely, transparently and more cost efficiently!
Following topics will be discussed in this article:
- Business use cases
- How to use blockchain for your business?
- Using Symbol from NEM for your business
- Conclusion and References
Business use cases
Using blockchain does not always mean that you increased the security or transparency of your business, or that you are running more cost efficiently.
When you make use of blockchain, it is important to model your data carefully. If you are going to use any blockchain datasets to store data related to your software, it is recommended that you know about scaling characteristics of this dataset.
Common characteristics of scalability can be questioned with the following:
- Is a record of this dataset persisted across all network nodes?
- Is a record of this dataset available for retrieval by API?
- How many requests to the API does it need to retrieve a collection of this dataset?
- How many requests to the API does it need to retrieve a singular entity of this dataset?
- What is the response time (e.g.: in milliseconds) for one API request on the network?
- Is this record related to sensitive information? Never send those over a network of any type.
Ask yourself these questions before any of your business layer data gets stored on a blockchain network. It will save you a lot of time.
[articles4us-section id=”how-to-use-blockchain-in-your-supply-chain”]How to use blockchain in your supply chain?[/articles4us-section]
How to use blockchain in your supply chain?
In terms of finding an implementation of a blockchain that will fit for how to use blockchain to tokenise your supply chain, I propose to consider Symbol from NEM for which you can find the [research4us-embed href=”https://nemtech.github.io/catapult-whitepaper/main.pdf” mode=”link”]Whitepaper here[research4us-embed].
As to what exactly needs to be done to map supply chain business logic to a blockchain project, it will defer from one distributed ledger technology to the other. As such, illustrating how this can be done with Symbol from NEM is my personal opinion, other contributors and participants may advise or require to do this differently.
Mapping your business logic
One of the important steps in integrating blockchain in your supply chain will be to define mappings for your business logic that will be represented by one or more entities on said blockchain implementation.
As an example, let us look at how accounts on Symbol from NEM can be mapped to Identities for your business. It is in fact quite simple, as we will be using the symbol-hd-wallets library available at NPM.
[article4us href=”https://github.com/UsingBlockchain/Article4Us/tree/master/posts/662-snippet-1-accounts_identities.ts” class=”incentive-link”]View Source Code[/article4us]
Another interesting example would be to have a look at how mosaics on Symbol from NEM can be mapped to Products for your business. We will be using the symbol-sdk for those matters as it permits to create transactions more easily, which is available at NPM.
[article4us href=”https://github.com/UsingBlockchain/Article4Us/tree/master/posts/662-snippet-2-mosaics_products.ts” class=”incentive-link”]View Source Code[/article4us]
And as a third example, we may want to have a look at how metadata for accounts and mosaics on Symbol from NEM can be mapped to State Changes in your supply chain business logic. Say, for example, that a product’s shipping status should move from Ordered to Sent and later changed to Delivered.
In terms of mosaic metadata, shipping statuses can be represented as one mosaic metadata entry with the name Delivery Status. And with transactions, it is easy enough to create and persist a track record of these shipping status changes with symbol-sdk.
[article4us href=”https://github.com/UsingBlockchain/Article4Us/tree/master/posts/662-snippet-3-metadata_shipping_status.ts” class=”incentive-link”]View Source Code[/article4us]
Event streaming with blockchain
The term “streaming” is defined as continuous, never-ending data streams with no specific beginning or end, which offer a constant feed of data that can be used/acted upon without needing to be downloaded first.
A simple analogy is how water flows through a river or creek. The streams come from various sources, in varying speed and volumes and flow into a single, continuous, combined stream.
Similarly, data streams are created by multiple types of sources, in various formats and volumes. From software, networking devices, and server log files, to website activity, location data, and app activity they can all be aggregated to seamlessly gather real-time information and analytics from one source of truth.
How does this combine with blockchain, you are asking? – Blockchain technology uses cryptography to sign data and publish proofs on a peers network. Events that are generated from a blockchain network can be of multiple formats: most blockchain network, as tells the name, will produce blocks of data – but also validate transactions and/or change account states and/or change token states.
An example? Yes, it is time. Let us take a look at Symbol from NEM which publishes Merkle Proofs about account state changes – basically, anytime anything would happen to the account of Alice, a new merkle hash will be created that is verifiable to make sure about the integrity of the retrieved data.
Explaining the technical principles of Merkle Trees is done very well in [article4us-embed href=”https://www.lifewire.com/introduction-to-peer-to-peer-networks-817421″ mode=”link”]this article[/article4us-embed] and in the Whitepaper for Symbol from NEM [research4us-embed href=”https://www.lifewire.com/introduction-to-peer-to-peer-networks-817421″ mode=”link”]here[/research4us-embed]. What we can take as granted in order to keep this article clear and concise is that merkle trees permit to verify the presence of entities without actually querying the collection [of all entities].
With that said, Symbol from NEM makes use of merkle trees and cryptographic hashes thereof to publish proofs about said state and/or state changes – be it relative to an account, a collection of tokens (mosaics), a namespace and/or a transaction on the network.
In our business logic mapping, we defined entity mappings for identities, products and for shipping statuses. As such, we will be interested only in state changes related to those mappings: Accounts, Mosaics and Mosaics Metadata. Yet, when we want to be using / be generating event streams, we will encapsulate state changes – which will be in varying formats – in our stream and with this, make these streams available through a Websocket and/or REST interface.
[article4us href=”https://github.com/UsingBlockchain/Article4Us/tree/master/posts/662-snippet-3-event_stream_supply_chain.ts” class=”incentive-link”]View Source Code[/article4us]
[articles4us-section id=”dictionary4us-tokenise”]Dictionary4Us definition for “Tokenise”[/articles4us-section]
Dictionary4Us definition for “Tokenise”
[dictionary4us-term term=”tokenise” class=”dictionary4us-term”][/dictionary4us-term]
[articles4us-section id=”conclusion”]Conclusion and References[/articles4us-section]
Conclusion and References
Distributed ledger technology introduces many innovative practices for the digital era to adopt such that processes and workflows are optimised, become more transparent and verifiable.
Making good use of blockchain requires technical knowledge about multiple sector of the software development industry. Following links may be useful to fill you in on several topics related to blockchain technology:
- Peer communications through a [dictionary4us-term term=”gossip+protocol” class=”dictionary4us-term”]Gossip protocol[/dictionary4us-term]
- [article4us-embed href=”https://www.lifewire.com/introduction-to-peer-to-peer-networks-817421″ mode=”link”]Lifewire article about Peer-to-Peer networks[/article4us-embed]
- [research4us-embed href=”https://nemtech.github.io/catapult-whitepaper/main.pdf” mode=”link”]Whitepaper for Symbol from NEM[research4us-embed]
Don’t forget to give us your feedback on all this! We are looking forward to more interactive community engagement about blockchain protocols, open source projects and open standard definitions.
[question4us type=”rating” input=”stars”]Was this article useful? How likely would you recommend it to others?[/question4us]