Blog

student, typing, keyboard-849825.jpg

Blockchain Platform for Smart Automobile

In this Article covers a wide variety of subjects including, Blockchain, Ethereum, Smart contracts, Truffle framework, IIoT, Raspberry Pi and Temperature Sensors. So, Firstly I want to explain one by one. Please Follow me for latest Article and don’t forget to like comment and share.

1. INTRODUCTION

Internet of Things (IoT) comprises “Things” (or IoT devices) which have remote sensing and/or actuating capabilities, and can exchange data with other connected devices and applications (directly or indirectly). IoT devices can collect data and process the data either locally or send the data to centralized servers or cloud-based application back-ends for processing. IoT technologies are promising for industrial and manufacturing systems. Experts have forecast a trillion dollar impact of IoT on the industrial and manufacturing sectors. A recent on-demand model of manufacturing that is leveraging IoT technologies is called Cloud-Based Manufacturing (CBM) i.e our own IoT Cloud Xtrans IoT Cloud. CBM enables ubiquitous, convenient, on-demand network access to a shared pool of configurable manufacturing resources that can be rapidly provisioned and released with minimal management effort or service provider interaction. In this Article, we propose a decentralized, peer-to-peer platform called BPSA(Blockchain Platform for Smart Automobile) for Industrial Internet of Things based on Blockchain, the technology that powers the crypto-currency Ethereum. The BPSA platform will act as a key-enabler for cloud-based manufacturing, enhancing the functionality of existing Xtrans Cloud platforms, especially towards integrating legacy Vendor floor equipment into the cloud environment. While Cloud-Based Manufacturing enables on-demand access to manufacturing resources, a trusted intermediary is required for transactions between the users who wish to avail manufacturing services. With the use of Blockchain technology, the BPSA platform enables peers in a decentralized, trustless, peer-to-peer network to interact with each other without the need or a trusted intermediary.

References: https://www.scirp.org/journal/PaperInformation.aspx?PaperID=71596

IIoT:

The industrial internet of things, or IIoT, is the use of internet of things technologies to enhance manufacturing and industrial processes.

Also known as the industrial internet or Industrie 4.0, IIoT incorporates machine learning and big data technologies to harness the sensor data, machine-to-machine (M2M) communication and automation technologies that have existed in industrial settings for years.

The driving philosophy behind IIoT is that smart machines are better than humans at accurately and consistently capturing and communicating real-time data. This data enables companies to pick up on inefficiencies and problems sooner, saving time and money and supporting business intelligence (BI) efforts.

Reference: https://internetofthingsagenda.techtarget.com/definition/Industrial-Internet-of-Things-IIoT

Blockchain:

Let’s take an example of Google spreadsheet or MS Excel (Windows). This spreadsheet is shared among different networks of computer, where everyone has copy of it. The spreadsheet contains information of the transactions committed by real people.

Anyone can access that spreadsheet but no one can edit it.

This is Blockchain.

It works with Blocks, where as spreadsheet works with “rows” and “columns”.

A block in a blockchain is a collection of data. The data is added to the block in blockchain, by connecting it with other blocks in chronological others creating a chain of blocks linked together. The first block in the Blockchain is called Genesis Block.

Blockchain is a distributed ledger, which simply means that a ledger is spread across the network among all peers in the network, and each peer holds a copy of the complete ledger.

Some key attributes of Blockchain are which proves that blockchain is better than traditional systems of ledger information keeping:

  1. Peer-To-Peer: No central authority to control or manipulate it. All participant talks to each other directly. This allows for data exchange to be made directly with third-parties involvement.
  2. Distributed: The ledger is spread across the whole network which makes tampering not so easy.
  3. Cryptographically Secured: Cryptography is used for the security services to make the ledger tamper-proof .
  4. Add-Only: Data can only be added in the blockchain with time-sequential order. This property implies that once data is added to the blockchain, it is almost impossible to change that data and can be considered practically immutable. We can say it has: 
  5. The right to be forgotten or right to erasure” defined here.
  6. Consensus: This is the most critical attribute of all. This gives blockchain the ability to update the ledger via consensus. This is what gives it the power of decentralization. No central authority is in control of updating the ledger. Instead, any update made to the blockchain is validated against strict criteria defined by the blockchain protocol and added to the blockchain only after a consensus has been reached among all participating peers/nodes on the network.

Ethereum Basics:

Before diving into the project, it’s important to understand how does Ethereum works. In essence, its a public database that keeps a permanent record of digital transactions. Mainly, this platform is a decentralized, doesn’t require any central authority to maintain and secure it. Instead it operates as a “trustless” transactional system; a framework in which individuals can make peer-to-peer transactions without needing to trust a third party.

Ethereum, just like any other blockchain, can be seen as a transaction-based machine where genesis state transitions into a final state by executing transactions incrementally. The final transformation is then considered as the absolute undisputed version of the state.

The key idea of Ethereum is the development of a turing-complete langague that allows the development of arbitrary programs(smart contracts) for blockchain and decentralized applications. Where as in bitcoin, programming language is very limited and allows only basic and necessary operations.

Following are the main components of ethereum blockchain

Accounts

Ethereum uses 256-bit encryption based elliptic curve cryptography(ECC). An ethereum private or public key is a 265-bit number. As processors can’t represent such big numbers. Its encoded as a hexadecimal string of length 64.

Every account represents by an address and associate with state.

There are two types of accounts:

  • Externally owned accounts(EOAs), which are owned and controlled by users and have no code associated with ’em. All transactions on the Ethereum network are initiated by EOAs. These accounts can send transactions to other EAOs or contract account
  • Contract accounts are controlled by the associated contract code which is stored with the accountEach contract has an Ether balance associated with it. The contract code is execution is triggered by transactions sent by EOA’s or messages sent by other contacts.

Transactions

A transaction is a digitally signed data package that stores a message to be sent from an externally owned account to another externally owned account or contract account on the blockchain. Each transaction consist of following information.

Messages:

Contracts deployed on a Blockchain network can send messages to other contracts. A message contains the address of the sender, address of the recipient, value to transfer and a data field which contains the input data to the recipient contract. The difference between a transaction and a message is that a message is produced by a contract while a transaction is produced by an EOA.

Consensus

The consensus mechanism in Ethereum is based on GHOST protocol, Ethereum uses a simpler version of this protocol, where the chain has most computational effort spent on it in order to build it is identified as the definite version. You can find more details here.

Ether(ETH)

Ether is the platform native currency which is used in the Ethereum blockchain network to reward miners for their work.

The denomination table is shown as follows

Blocks

The group of transactions in a blockchain network are bundled together into blocks and executed on all the participating nodes.

Mining

The process of verifying the transaction is called mining. The participating nodes in the network are rewarded in the form of Ethers for performing mining operations. Miners from all over the world compete to do complex mathematical computations to validate the transaction and the node that wins earns a reward in ethers.

Gas

Gas is an another key concept in Ethereum, its the name of the crypto-fuel consumed for a particular computation on the network. All transactions on the network are charged a certain amount of gas. This gas is paid to the miners for validating the transaction. The gas fee paid is proportional to the amount of work that is needed to execute the transaction, in terms of the number of atomic instructions.

Ethereum Blockchain Stack

The ethereum stack consists of various components. Mainly, Ethereum P2P network, where Ethereum blockchain runs. And Ethereum Virtual Machine(EVM), is a runtime environment for smart contracts in Ethereum platform. Ethereum client (commonly used geth) that interact with nodes in the peer-to-peer Ethereum network from where blockchain is downloaded and stored locally. Another one is the web3.js library that allows interaction with geth via RPC protocol.

Ethereum Virtual Machine (EVM)

Ethereum Virtaul Machine (EVM) is a byte-code execution environment for smart contract in the Ethereum platform. Every node in the Ethereum network runs EVM.

Smart Contracts

Smart Contract is a piece of code that resides on a blockchain and is identitifed by a unique address. A smart contract includes a set of executable functions and state variables. Smart contracts can be written using various high-level languages such as Solidity, Serpent. Solidity, which is identical to Javascript is used as main language in Etheruem.

Geth

Geth is a Ethereum golang client that allow us to setup an ethereum node in our local machine and interact with Ethereum network. It can perform tasks such as creating an account and contracts, sending Ether to other accounts, sending transactions to contracts, mining and other tasks related to the Ethereum blockchain. Though they are various clients developed using different langauges, geth is widely used client.

Following are currently available ethereum clients

Web3.js

Web3 is a JavaScript API created by the Ethereum which provides methods to interact with Ethereum network thru geth. It uses JSON-RPC internally to communicate with geth. Web3 provides a JavaScript object web3 which includes following sub-objects.

eth: Ethereum blockchain related methods),

shh: whisper protocol), currentProvider

currentProvider: contains methods related to the current provider.

miner: mining related methods

version: information about node version.

And other sub-objects include dbdebugpersonalproviders and txpool.

Following outlines the various components used in Ethereum Blockchain Stack.

Logic : Smart contracts 

DatabaseIPDBBigchainDBMediachain Labs

BrowsermetamaskuPort

ComputeGeth, Golem Project

Filesystem : IPFSEthereum Swarm / FileCoin

FrameworksDappleTruffleEmbarkMonax

IDEsSolidity browser compilerhack.ether.camp

Name resolutionENS