Building Blockchain for Business

Blockchain is the underlying technology for Bitcoin, Ethereum, and other cryptocurrencies. However, cryptocurrency is far from the only application of blockchain for businesses. One of the most popular business applications of blockchain is fundraising, especially for startups. Apart from conventional ways of funding, blockchain enables alternative methods of fundraising such as ICO or STO.

In the past few years, many companies have raised an incredible amount of money via ICO. Some of the biggest and most successful ICO projects include NEO, Ethereum, Spectrecoin, and Lisk. More info about ICO can be found on the Investopedia website.

That said, I am not going to discuss ICO in this article. Instead, we shall explore blockchain applications in businesses. Though we can use blockchain for all kinds of business applications, whether or not blockchain is suitable for a particular business depends on the nature of the business, the business model, the requirements, and many other factors.

Before implementing blockchain, the C-level management team of a business organization should conduct a feasibility study to determine whether it is necessary and plausible to adopt blockchain technology. You should ask the following questions:

  • Can blockchain add value to the current business?
  • Can blockchain increase the organization’s competitiveness?
  • Do you need to deal with many trustless parties?
  • Do you need a decentralized and distributed database system?
  • Can blockchain improve workflow efficiency?
  • Can blockchain increase revenue and profit?
  • Do you have enough financial resources to implement blockchain?
  • Can blockchain technology integrate with existing systems?
  • Do you have enough talents to manage the blockchain system?

Once you’ve decided that implementing blockchain would benefit your company, you need to carry out the following steps:

  1. Identify a suitable use case.
  2. Assemble your team.
  3. Design the blockchain architecture.

Identify a suitable use case

To embark on a blockchain project, you need to identify the most suitable use case for your business. The best way is to examine use cases in an industry that is similar to your business. Generally, there are three areas in which blockchains can perform very well.

Data Authentication & Verification

This includes immutable storage, digital signatures, and encryption. Data in almost any format can be stored in the blockchain. Blockchains can create public-private key pairs and also be used for generating and verifying digital signatures. Therefore, it can be used for data authentication & verification.

One of the best usages is counterfeiting prevention. For example, Luxtag, a Malaysia-based blockchain company, has patented an anti-counterfeit technology. This technology enables businesses and their customers to protect the authenticity and ownership of their valuable assets by providing digitized certificates using blockchain technology. They have rolled out their first product, known as e-Scroll, for a consortium of Malaysian public universities to verify and validate certificates using a blockchain-powered web application.

Another area related to authentication and verification is data provenance. One of the most successful companies in this area is Everledger. This company has built the Diamond Time-Lapse Protocol, a traceability initiative built on a blockchain-based platform for the diamond and jewelry industry. The system is to ensure that there is transparency along the entire diamond’s lifetime journey, instilling consumer confidence and driving industry growth.

Another application is supply chain management. The most notable is the initiative by Walmart using blockchain technology to ensure food safety. Walmart has been working with IBM on a food safety blockchain solution requiring all suppliers of leafy green vegetables for Sam’s and Walmart to upload their data to the blockchain by September 2019. By placing a supply chain on the blockchain, it makes the process more traceable, transparent and fully digital.

Watch the following video about food safety:

Other business applications could be medical records management, insurance, KYC management for banks, and more.

Digital Asset Management

Any asset that can be digitized is considered a digital asset. Digital assets include ebooks, digital art, images, video, music, journals, newspapers, audio books, online training courses, recipes, and more. With the invention of blockchain technology, digital assets also include crypto assets. Crypto assets can be cryptocurrencies like Bitcoin, Ethereum, and other altcoins, or the tokenized version of a real-world asset such as gold, silver, oil, land titles, property, paintings, etc.

Currently, most digital assets are traded over the Internet via the centralized e-commerce marketplace. However, digital assets can be traded more efficiently over the decentralized peer-to-peer blockchain platforms.

Some real world use cases for digital assets management in blockchain include:

  • AlphaPoint. Provides enterprise-grade software that enables institutions to convert assets to securities tokens and trade those assets on an exchange.
  • Polymath. Enables trillions of dollars of securities to migrate to the blockchain.
  • Harbor. Offers a digital securities platform for compliant fundraising, investor management, and liquidity.
  • Powerledger. Provides a platform for peer-to-peer energy trading.

Smart Contracts

A smart contract is a programmable contract that enables auto execution of a contract the moment it fulfills certain terms and conditions. It is akin to a vending machine – you get your product by inserting some coins or banknotes.

According to Investopedia, smart contracts are:

“self-executing contracts with the terms of the agreement between buyer and seller being directly written into lines of code. The code and the agreements contained therein exist across a distributed, decentralized blockchain network. Smart contracts permit trusted transactions and agreements to be carried out among disparate, anonymous parties without the need for a central authority, legal system, or external enforcement mechanism. They render transactions traceable, transparent, and irreversible.”

Almost any blockchain business application involves the use of a smart contract. A famous use case is Cryptokitties. A smart contract is executed when a user acquires a unique virtual kitty from the Cryptokitties collectible marketplace via a bidding process. The highest bidder gets to own the digital asset. Other dapp transactions also make use of smart contracts.

Blockchain-powered supply chain management makes use of smart contracts to handle transactions between manufacturer, suppliers, wholesalers, and retailers.

In the insurance industry, the client who wishes to buy insurance can provide personal information including sensitive data like medical records via a smart contract to the insurance company. In the health care industry, a patient can get faster and more accurate diagnoses and treatment via a smart contract that allows them to share medical records.

Assemble your Team

After conceptualizing a business use case that is suitable for your business, you need to assemble your team to kick-start the blockchain project. Getting the right people in your team is crucial to success. Your team should comprise people with business skills and also people with technical skills. People with business skills should be able to see the overall picture of your business model and know how to execute it. They must also have good interpersonal skills, strategic thinking, good networks, and financial knowledge. The people with business skills should be assigned the posts of CEO, CFO, marketing manager, business development manager, and so on.

People with good IT skill in general and blockchain in particular are equally important. The CTO must have many years of experience in the IT and software industry and have a good grasp of blockchain. He or she must be assisted by a technical lead who has good practical experience in setting up the blockchain platform, know how to program the smart contract, sound knowledge of programming languages including Solidity, JavaScript, Goland, C++, Java, Python, and so on.

In addition, if you plan to raise funds via ICO, you need to employ a compliance officer, preferably a lawyer who understands the guidelines provided by the security commission and the central bank.

Designing the Blockchain Architecture

You need to decide whether to build the blockchain network from scratch, or use a third party blockchain solution like Azure blockchain, Oracle, or AWS blockchain. The former is time-consuming, whereas the latter could be up in as little as 30 minutes.

Each of the the aforementioned enterprise blockchains offer their own functionalities and features as well as cost advantages. Both AWS and Azure offers solutions for Ethereum, Hyperledger Fabric, Corda, and Quorum, while Oracle only caters for Hyperledger Fabric. We can compare their features in the following table:

Courtesy of 101 Blockchains


The cost of setting up Azure Blockchain Workbench is roughly $400-$500 depending on your region and usage. The main costs are three VMs and one app service. Two VMs are for the default blockchain network, and one VM is for the microservices on Workbench. For AWS Blockchain pricing, refer to: https://aws.amazon.com/managed-blockchain/pricing/

References

ETHKL #5 : Security Audits & Scaling

The meetup was at HelloGold office , KL on Friday 23, Nov.

Speakers:

  1. Petar Tsankov-Chief Scientist/co-founder of ChainSecurity AG & Senior Researcher at the ICE center. ETH Zurich. 
  2. Andras Kristof- Founder and Advisor of Akomba Labs
  3. Lai Ying Tong- Researcher at Ethereum Foundation
  4. Ken Chan

The session began with Ken Chan introducing the audience about Zero-Knowledge Proofs. I was sure many developers among the audience understand what it is but the concept sounds strange to me. Fortunately, Ken was good in demonstrating the concept by using the scenario of the American presidential election involving Trump and Clinton as well as a “live demo” with Harith of HelloGold as the co-actor.

Apparently, the Zero-knowledge proof method, or more exactly zk_SNARKS, is a consensus protocol used by Zcash to validate its shielded transactions that are fully encrypted on its blockchain. According to Zcash(https://z.cash/technology/zksnarks/), the acronym zk-SNARK stands for “Zero-Knowledge Succinct Non-Interactive Argument of Knowledge,” and refers to a proof construction where one can prove possession of certain information, e.g. a secret key, without revealing that information, and without any interaction between the prover and the verifier.

Zcash further pointed out that “Zero-knowledge” proofs allow one party (the prover) to prove to another (the verifier) that a statement is true, without revealing any information beyond the validity of the statement itself. For example, given the hash of a random number, the prover could convince the verifier that there indeed exists a number with this hash value, without revealing what it is.

Ken illustrated the process of Succinct and Non-interactive using a diagram, where the prover begins by generating a proof string and then the verifier needs to verify the proof string, as shown below:

The above process is actually more complex than illustrated in the diagram. According to Zcash,  zk-SNARKs work by first turning what you want to prove into an equivalent form about knowing a solution to an algebraic equation, as follows:

Computation → Arithmetic Circuit → R1CS → QAP → zk-SNARK

Here is an example of what an arithmetic circuit looks like for computing the expression (a+b)*(b*c) :

Diagram Adapted from Zcash

The output is then verified by the verifier. However, Ken pointed out that the process might be compromised by some malicious codes which he called toxic waste that produce false proofs. Ken concluded with the following points:

Why ZK SNARKs?

  • Strong cryptography research by Zcash team
  • Math-based- not coin joining
  • Short proofs

Why not ZK SNARKS?

  • Trusted setup for every contract
  • No transparency for counterfeiting
  • Computationally expensive

Next, Dr.Petar from ChainSecurity discussed the importance of security audit. His topic was “How Not to get Hacked”. ChainSecurity is a smart contract auditing platform. They can identify security vulnerabilities and certify the functional correctness of smart contracts and blockchain projects. 

ChainSecuity has developed an Audit platform that can perform Automated Security Check on smart contracts. This platform can test and audit both Ethereum smart contracts (Security Scanner)and the Hyperledger Fabric chaincode(Chaincode Scanner).

According to Dr.Petar,  more USD$1 billion have been stolen this year due to crypto hacks. He stressed that writing secure smart contracts is difficult.  Developers might fail to see bugs and security flaws, therefore we need to audit the smart contracts.  However, currently, most audits are done manually and tend to miss many issues. Furthermore, in the post-development stage, most anomalies are invisible. 

To work around the aforementioned issues, ChainSecurity has developed some AI-based automated tools to help in every stage of smart contract lifeline. At the developmental stage, the automated tools will assist in certifying the correctness of the code. At code audit stage, the machine-checked audit will generate the audit report by committing the smart contract onto the Audit platform which runs security auditing using the security scanner, the symbolic verifier and the AI-based Tester. Finally, in the post development stage, there are monitoring tools to help track the smart contract health.

More information on security audit can be found on ChainSecurity website.

The final topic was scaling presented by Andras Kristof and Lai Ying Tong.  This is a topic where all Ethereum enthusiasts are concerned about. According to the speakers, the solution is to develop a two-layer architecture. Layer 1 is called serenity which comprises sharding, casper, random beacon, and p2p networking. Layer 2 comprises payment channels, state channels, sidechains, and plasma. The solution also comprises succinct proofs using snarks and starks. Furthermore, there are more integrations that include swarm, light clients and client optimizations.

In more details, the layer 1(serenity) structure includes the Main Chain(provides staking and PoW), the Beacon Chain((provides random number and PoS), the Shard Chain(provides data) and VM(provides state execution result).

For the payment channels, there are two channels, the Open Channel and the Close Channel. The transactions include blockchain transactions and Off-chain payments. Besides that, Lai also spoke on payment channels on the lightning network. The layer2 solutions are to move state-modifying operations off-chain, which include payment channels and state channels.

Besides that, Lai also covered topics on sidechains, plasma mvp, morevp, swarm, light clients and more. These are heavy topics and I shall discuss them in future articles.

Solidity Data Types

Solidity is a statically typed programming language, which means that the type of each variable needs to be specified at compile-time. Solidity provides several categories of data types, as listed below:

  • Value types
  • Reference types
  • Mappings

Value Types

These types of data are called value types because variables of these types will always be passed by value. There are several value types in solidity, as listed below:

  • Boolean
  • Integer
  • Fixed Point Number
  • String
  • Address
  • Array
  • Literal
  • Enum

We shall focus on boolean, integer and string data types first and discuss other data types in future articles.

Boolean

Boolean is a data type that only produces two possible values, true or false. They can be used together with some common operators, as follows:

OperatorMeaning
!Logical negation
&&Logical conjunction  “and”
||Logical disjunction “or’
==Equality
!=Inequality

We declare a Boolean variable using the keyword bool

Integer

There are two types of integer, the signed integers, and the unsigned integers. The keyword to declare signed integers is int and the keyword to declare unsigned integers is uint. In addition, we can assign the number of bits a signed integer can hold using int8, int16 until int256. Similarly, we can use uint8 until uint256 for unsigned integers.

We declare an integer variable using the keyword int or uint

We can use various operators to deal with operations that involve integers. The operators are listed as follows:

Comparison Operators<=  < ==  != >=  >
Bit Operators&  |  ^ and   ~
Arithmetic Operators –  * /   % **  << >>

String

The string is a data type that cannot be operated arithmetically. String literals are written with either double or single-quotes, for example, “Abraham”, “007”, “abc%&$” and more.

We declare a string variable using the keyword string .

Example: This example The string two types of variables, unsigned integer and boolean. We also use the keyword if and the operator > to check whether the outcome is true or false.

The code

pragma solidity ^0.4.24;

contract myContract2 {
      uint private a;
      uint private b;
      bool ans;
   
 function getValue1(uint num1) public{
    a = num1;
 }

  function getValue2(uint num2) public{
    b = num2;
 }
 
  function checkAns() public view returns (bool){ 
      if (a>b)
          ans=true;
      else
      ans=false;
      
      return ans;
  }

 
}

After we compiled and deployed the contract, we get the following output. We can test the results by entering different values in getValue1 and getValue2. The results will be either true or false.

The output on Remix iDE

Introduction to Solidity

What is Solidity?

Solidity is a high-level programming language that is used to create and implement smart contracts in Ethereum. The smart contracts created using Solidity can be used for financial transactions, crowdfunding, voting, intelligent supply chain management, improvement of  IoT workflow, ride sharing automation, smart city administration and more.

It has Python, C++ and JavaScript influences and is used for Ethereum Virtual Machine ( EVM ). As a result, it is fairly convenient and easy to grasp for those that are already familiar with the Python, C++ or JavaScript.

The IDE for Developing Smart Contracts

The best tool to write, compile, test and deploy smart contracts is  Remix.  Remix is a browser-based IDE that provides an inbuilt compiler as a well as runtime environment without server-side components.

We can also use other code editors for Solidity. I suggest we use Visual Studio Code or Solidity Plugin for Visual Studio. For the Solidity plugin, you need to download it from https://marketplace.visualstudio.com/items?itemName=ConsenSys.Solidity
Besides that, you need to install Visual Studio 2015.

Writing Your First Smart Contract in Solidity

A smart contract is a data, that can be referred to as its state, and code, which can be referred to as its functions, collection, that resides on a specific address in the Ethereum blockchain.

The first line of the smart contract is always 

pragma solidity ^0.4.24;

pragma is a keyword which is used to instruct the compiler how the source code should be treated. In this example, the pragma specified that the source code is written for the Solidity Library version 0.4.24

To define a contract, we use the statement

contract contractName {

}


You can use any name for the contract, but any meaningful name will be better. For example

Contract  NewCoin{

}

indicates that you intend to create a contract for a new cryptocurrency.

Assigning variables

Next, we would like to introduce some variables into the contract. First of all, let’s assign some string variables and some integer variables.

To assign a string variable, the syntax is

string myName;

In Solidity, there are two types of integers, the signed integer and the unsigned integer.

A signed integer means it can store positive or negative values while an unsigned integer can only store positive values.

To specify that it will be an unsigned integer, we use the keyword uint before the name of the new variable.

To assign an unsigned integer, the syntax is as follows;

uint MyAge;

Access Modifier

You may want to add the access modifier(or visibility modifier) private or public to the variable. Most programming languages put access modifier in front of the datatype  specifier like private string name but in Solidity, we put access modifier between datatype specifier and the variable name, as follows:

string private myName; 
String public myName
uint private MyAge;
uint public  MyAge;

Writing the Smart Contract Code

Now launch Remix IDE. Create your first smart contract by clicking on the little + button on the far left corner of the Remix IDE.  A new dialog will appear and you can create a new Solidity file.

After creating the new file, a new window will appear on a new tab displaying your new file. The file will also be show on the left pane of the IDE under the browser.

Now, let’s create a new contract by entering the following code into the Remix IDE.

pragma solidity ^0.4.24;

contract myContract {
    string private name;
    uint private age;
}

The first line inside the contract itself declares a string name and an unsigned integer variable called age.

We have already created a simple smart contract though it does not do anything yet. You can compile and deploy it if you want to.

Now let’s add some functions to the smart contract

pragma solidity ^0.4.24;

contract myContract {
    string private name;
    uint private age;
   
 function setName(string newName) public{
    name = newName;
 }

  function getName() public view returns (string){ 
    return name; 
  } 
  
  function setAge(uint newAge) public{
      age=newAge;
  }
  function getAge() public view returns (uint){ 
      return age;
  }
}

We create the function setName to allow the user inputs a string value. Set the modifier to public as we want to permit everyone to see it. Otherwise, when you deploy the contract you will not be able to view the function on the Remix IDE.

To return the value of name entered by a user, we create the function getName

The view keyword in public view returns is  the replacement for constant. It indicates that the function will not alter the storage state in any way.

Next, we create the function setAge by declaring  a parameter newAge as an unsigned integer. The setAge function will allow the user input an integer value when you deploy the contract.

To return the value of age entered by the user,  we create the function getAge

Now compile and deploy the Remix IDE, the output is shown in the following figure:

Deployed Contract

When you deploy the contract, a transaction is executed from your wallet address to the contract. A gas fee is charged in the process. You can view the transaction on Etherscan, as shown below:

When you click on the setName function, a transaction will also occur. You need to wait for the transaction to complete before you click on the getName function. You can see that whatever you entered in the setName box will appear on the getName box. You can do the same for the setAge and getAge functions.

Smart Contracts

Introduction

In the blockchain network, a user can send some crypto money to another user in exchange for something of value where the transaction is executed automatically based on a smart contract. In another case, a smart contract is executed when a user acquires a unique virtual kitty from the Cryptokitties collectible marketplace via a bidding process, the highest bidder gets to own the digital asset.

On the other hand, a transaction can occur automatically between two smart devices using an integrated system of IoT technology and blockchain. For example, a smartphone A can top up data for another smartphone B after A received some money from B, the transaction occurs based purely on a smart contract without the awareness of the owners.

According to Investopedia, smart contracts are ,

“self-executing contracts with the terms of the agreement between buyer and seller being directly written into lines of code. The code and the agreements contained therein exist across a distributed, decentralized blockchain network. Smart contracts permit trusted transactions and agreements to be carried out among disparate, anonymous parties without the need for a central authority, legal system, or external enforcement mechanism. They render transactions traceable, transparent, and irreversible.”

Definition of Smart Contract

Based on the aforementioned descriptions, we can define a smart contract as a computer code that can facilitate the exchange of money, content, property, shares, digital assets or anything of value among disparate and anonymous parties without a middle entity.

When a smart contract is installed in a blockchain system, it behaves like a self-operating computer program that automatically executes when some specific terms and conditions are met. Because smart contracts run on the blockchain, they run exactly as programmed without any possibility of censorship, downtime, fraud or third-party interference.

A Brief History of Smart Contracts

In contrary to popular belief, the smart contract is not invented by Vitalik Buterin, the founder of Ethereum. In actual fact, the idea of the smart contract was first conceived by computer scientist and cryptographer Nick Szabo in 1993 as a kind of digital vending machine. In his famous example, he described how users could input data or value, and receive a finite item from a machine, in this case, a real-world snack or a soft drink. Nick Szabo is so smart that some people believe that he could be Satoshi Nakamoto who invented bitcoin.

In addition, though Ethereum is the first blockchain system that has adopted the smart contract technology, it is not the only one using smart contracts. Many Non-Ethereum blockchain platforms such as Hyperledger Fabric, Hyperledger Sawtooth and Corda implement their own versions of smart contracts. The smart contract in Hyperledger Fabric is known as Chaincode that runs in a container known as docker(I will discuss Chaincode and how to install it in Docker in a future article). 

Today, most blockchain platforms run on Ethereum Virtual Machine(EVM) implement Ethereum smart contract while a few enterprise blockchain platforms implement their own version of smart contracts. However, there could be interoperability between the Ethereum platform and the enterprise platforms. For instance, in the Sawtooth-Ethereum integration project,  EVM (Ethereum Virtual Machine) smart contracts can be deployed to Sawtooth using the Seth transaction family.  I will discuss Hyperledger technologies in another article.

Solidity

Solidity is a high-level programming language that is used to create and implement smart contracts on Ethereum platform. The smart contracts created using Solidity can be used for financial transactions, crowdfunding, voting, supply chain management, IoT implementation, ride sharing automation, smart city administration and more.

Solidity has Python, C++ and JavaScript influences. Therefore, it is fairly convenient and easy to grasp for those that are already familiar with the Python, C++ or JavaScript. 

Writing and Deploying the Smart Contract

The Integrated Development Environment (IDE)

The best tool to write, compile, test and deploy smart contracts is RemixRemix is a browser-based IDE that provides an inbuilt compiler as well as a run-time environment without server-side components. You can access Remix from the following link: https://remix.ethereum.org

We can also use other code editors for Solidity . I suggest we use Visual Studio Code or Solidity Plugin for Visual Studio. For Solidity plugin, you need to download it from https://marketplace.visualstudio.com/items?itemName=ConsenSys.Solidity

Besides that, you need to install Visual Studio 2015. I shall skip the technical details for now. (I will discuss how to use Visual Studio Code in compiling and deploying smart contracts in another article).

The Smart Contract Code

A smart contract is a data, that can be referred to as its state, and code, which can be referred to as its functions, collection, that resides on a specific address in the Ethereum blockchain. Let us begin with the most basic example. It is fine if you do not understand everything right now, we will go into more detail later. Enter the follow codes in the Remix IDE and save the file as MyStorage.sol

pragma solidity ^0.4.25;

contract MyStorage {
   uint storedData;

   function set(uint x) public {
       storedData = x;
   }

   function get() public view returns (uint) {
       return storedData;
   }
}

Understanding the Code

The first line simply tells that the source code is written for Solidity version 0.4.25 or anything newer that does not break functionality .This is to ensure that the contract does not suddenly behave differently with a new compiler version. The keyword pragma is called that way because, in general, pragmas are instructions for the compiler about how to treat the source code.

A contract in the sense of Solidity is a collection of code (its functions) and data (its state) that resides at a specific address on the Ethereum blockchain. The line uint storedData; declares a state variable called storedData of type uint(unsigned integer of 256 bits). You can think of it as a single slot in a database that can be queried and altered by calling functions of the code that manages the database. In the case of Ethereum, this is always the owning contract. And in this case, the functions set and get can be used to modify or retrieve the value of the variable.

To access a state variable, you do not need to use the prefix this that is commonly used in other programming languages. This is just a simple contract that does not do much yet apart from allowing anyone to store a single number. This number is accessible by anyone in the world without a feasible way to prevent you from publishing this number. Of course, anyone could just call set again with a different value and overwrite your number. However, the number will still be stored in the history of the blockchain. Later, we will see how you can impose access restrictions so that only you can alter the number.

The Remix IDE

Now enter the code in the Remix IDE, as shown in the following figure:

The Metamask Wallet

In addition, you need to install the Metamask wallet using the Chrome or Firefox extension plugin. After installing Metamask, create an account and connect it to Ropsten Test Network, as shown in the figure below:

Besides that, you need to get some free Ethers to run the test. You can get 1 free Ether for Rospten Testnet from  https://faucet.ropsten.be/. Upon loading the website, copy and enter your Metamask wallet address, and click the send me test Ether button, as shown in the following figure:

After a  while, you can see 1 Ether is deposited into your Metamask wallet, as shown in the figure below:

Next, in the Remix IDE, change the environment to Injected web3, the Ropsten Test Network. You can see that your wallet address appears in the account box, as shown in the first Figure. Now click on the Deploy button. After clicking this button, the Metamask wallet will pop up, prompting for confirmation, as shown in the following figure:

After clicking the CONFIRM button, you will see that some Ether had been deducted from your account which showed that the contract has been successfully deployed, as shown in the following Figure:

Besides that, you can also view the transaction on Etherscan, as shown in the following Figure:

Finally, you can also check the deployment of the smart contact in the Remix debug window, as shown in the following figure:

In addition, you can view some extra information on the right column on the Remix windows, like the name of the smart contract(Mystorage) , how much gas limit and how many transaction etc.

If you are sure the smart contract is bugs free, you may want to deploy it to the Ethereum Mainnet. In that case, change the Environment to Web3 Provider. You will be prompted with the following dialog:

Wait, you need to install Go Ethereum, the client commonly referred to as geth, which is the command line interface for running a full Ethereum node implemented in Go. Install Go Ethereum from the following link: https://geth.ethereum.org/downloads/

After installing Go Ethereum, there a few more windows system set up before you can run geth. I will not go through the steps here, a bit tedious, I have documented them in another document. If you are keen I can share it with you in the future. Let’s say your environment is ready, you can key in the following command in the command line:

geth --rpc --rpccorsdomain "https://remix.ethereum.org" console

Your computer will now link to the Ethereum mainnet via Remix, as shown in the following figure:

Now click OK on the Remix dialog and bring up the next dialog that prompts you to connect to the Web3 Provider Endpoint, as shown in the figure below:

Click OK and now you can deploy the contract to the Ethereum Main Network. Notice that now the Environment is Web3 Provider, which is the Ethereum Mainnet, as shown in the following Figure:

Before you can deploy the smart contract to the Ethereum mainnet ,you need to have the actual Ether to deploy the contract. I suggest you don’t do it here unless you have developed the actual use case and ready to go for ICO.

Happy Learning!