Our Articles

Creating a Self-Sustaining School Ecosystem with Blockchain

Abstract

The current school system is too structured, rigid, and inhibits creativity. The current school curriculum inadequately prepares the students to survive the fast-changing world of the 21st century. While schools need to comply with the national education policy to teach designated subjects, schools should include other programs that could help to resolve the aforementioned issue. Therefore, our school proposes building an ecosystem using blockchain technology where students can freely create and share their contents. We believe that the blockchain ecosystem will nurture young children in developing creative minds and entrepreneurial skills.

I have written this white paper for a hypothetical blockchain project. This blockchain project is to build a private blockchain ecosystem for an international school. 

First, we need to conduct a feasibility study before we start planning any blockchain project. Here, I am using a methodology called the CATWOE analysis. It can be applied to any new project.

CATWOE Analysis of  Building a Blockchain School

CATWOE is an acronym that stands for Customers – Actors – Transformation process – Worldview – Owners – Environmental constraints. It’s a simple analytical approach to find solutions to problems. The CATWOE Analysis makes it possible to identify problem areas, look at what an organization wants to achieve, and which solutions can influence the stakeholders. The analysis uses thought methodology from multiple perspectives. It is especially useful for an organization that wants to implement a new project that involves a drastic transformation process. The implementation of the blockchain technologies in a school curriculum qualifies for such transformation. Therefore, there is a need to understand the problems and try to find solutions before we proceed with the project implementation

C – Clients

They are the users and stakeholders of a system. In this case, they are the students, teachers, parents, the management staff, the education department, and others. They will benefit if the change is positive and the problems are solved. However, they may stand to lose or suffer if the change is negative and new problems are created. Therefore, we need to find out whether the blockchain technologies can solve current problems and bring positive changes in the school system. If the outcome could be negative or even damaging, we need to abort the project.

A-Actors

They are usually the employees within an organization, in this case, teachers and support staff. They are responsible for carrying out work and involved with the implementation of the blockchain system. Therefore, we need to conduct an inventory analysis to know their qualities, capabilities, and interests to get a clear picture of their impact on the organization. We may need to hire new employees or retrain the current ones to ensure competency with respect to blockchain implementation. We also need to conduct training for the employees.

T – Transformation Process

Transformation is the change that a system or process leads to. It’s the process in which input (including raw materials, man-hours, knowledge) is transformed by an organization into output (such as a final product or solution to a problem).

To implement the blockchain system, we need to know in advance what kinds of input requires and forecast what the end result (output) will be. Besides that,  we have to carefully consider the intermediate steps. In this case, the input is the blockchain technologies and the output could be a system that churns out an intelligent pool of young entrepreneurs that thrive on co-creating and co-sharing.

W – Worldview

Stakeholders often have different ideas and approaches to the same issue, with other conflicting interests. The goal of the CATWOE analysis is to make their different viewpoint explicit and try to achieve a methodology stand. In this project, we need to achieve consensus among the stakeholders that involve the students themselves, we don’t want to force the ideas on them. Besides that, some teachers might have fear in carrying out the transformation as they have to learn new technologies. Parents would be very concern about the implementation of the blockchain technologies because it will bring profound impacts on their children, either positively or negatively.

In addition, the government might want to regulate the project to ensure it complies with the national education policies and philosophies. On the other hand, business leaders may want to look for financial gains by sponsoring the project or they may refuse to support the project at all. Therefore, there is an urgent need to conduct surveys and research to figure out how to secure agreement from most stakeholders to implement the project.

O – Owners

This usually refers to the owner, entrepreneur or investor of an organisation, who wants to make changes and who decides whether a project should start or stop. As decision makers, they have the highest authorities.  Commitment and support from the aforementioned parties are important to ensure successful implementation of the blockchain project and also long term sustainability of the project.

E – Environmental Constraints

This is the actual environmental elements that may influence the organization and can limit or restrict the implementation of the blockchain technologies in the school system. Examples include political influence, ethical boundaries, regulations from the government, financial constraints and social factors. There is a need to work closely to overcome the constraints via negotiations and other means with the regulators and other parties

After conducted the CATWOE analysis, I have identified the following problems where most schools are facing.

Problems

  • The Current school system is too structured and too rigid, inhibiting creativity
  • The Curriculum methodology too centered on academics and examinations
  • Teacher-centered, lack of peer learning
  • The Administration is centralized and autocratic
  • Does not prepare children for the future
  • Lack of participation from stakeholders

The proposed solution

  • Create a self-perpetuating and self-sustaining ecosystem where students can create and share digital content. It can also include tangible things like arts and craft, scientific inventions, or intangible things like music, song, new ideas, games, and so on. These tangible assets can be digitized and shared among the students.
  • Not only they can share digital content, but they can also buy and sell them. It is akin to an autonomous economic system where students can self-fund their projects by trading their digital assets.
  • The latest technology that can power this system is blockchain, a subset of decentralized ledger technologies.
  • The ecosystem should be enlarged to include the actors of the system – the teachers, coaches, supporting staff and the administrators.
  • The ecosystem must also be connected to stakeholders, including the business owners (who can provide financial support and sponsorship), the government (who may want to regulate the activities in the system), parents (who are concerned with their children development), etc.
  • The ecosystem can be extended to include students from around the world in the future.

† The Architecture

  • Create a permissioned private blockchain platform for the students. The students can interact freely in their own close-loop decentralized and distributed ecosystem.
  • Content or assets can be created and tokenized and shared among the students. They can trade their assets using the tokens, creating a token economic system.
  • Develop APIs so that the stakeholders can interact with the blockchain. Administrators and teachers should be allowed to monitor and delete certain contents that are inappropriate like pornographic materials etc via the API. On the other hand, parents can monitor their children progress but may not be allowed to delete the contents or add comments. In addition, business owners and investors can monitor the progress of the project and provide support and advice if necessary (for example if the system crashed or stalled). In addition, regulators might want to monitor the blockchain for compliance.
  • Proposed using Ethereum Proof of Authority(PoA) protocol known as Clique. The benefits of using PoA are as follows:
    • Saves electricity power
    • Eliminates the need to invest into large numbers of ‘Miners’ servers
    • Increase the transaction speed tremendous compared to Proof-of-Work(PoW)
    • Better security since only members can access the network
  • The ecosystem can be hosted on a cloud server like AWS and Microsoft Azure but you can set up your own servers.  The conceptual model is illustrated in the figure below:

The Legal Framework

Obviously transforming a school into a blockchain school needs to obtain approval from the Ministry of Education. It has to comply with national education policies. Therefore, we need to design the blockchain platform as a new approach in teaching and learning, keeping content within the requirements of the curriculum imposed by the MOE.

**You may use my ideas to write a paper if you are embarking on a similar project, but prior consent from me is necessary.

Gas, Gas Price and Gas Limit

What is Gas?

By definition, gas is a unit that measures the amount of computational effort that it will take to execute certain operations on the Ethereum blockchain. The operations include sending tokens, deploying a smart contract, interacting with a contract, sending some ETH, launching an ICO, or anything else on the blockchain. Gas is needed to power the Ethereum Ecosystem, just like fuel is needed to power a car.

What is Gas Price?

As I have mentioned earlier, we need to use gas for every operation made on ethereum, regardless of whether your transaction succeeds or fails. Gas does not come free, we need to pay for it, just like paying for the gasoline in order to drive our cars. How much transaction fee we need to pay depends on the gas price and the gas limit.

Gas price is the amount of Ether you need to pay per unit of gas. It is measured in Gwei (1Gwei=0.0000000001 ETH).  Its value is determined by the miners, who can refuse to process the transaction with less than a certain gas price. The transaction fee is paid to the successful miner as a form of incentive that motivates the miners to maintain the nodes. Therefore, they have the controlling power over the gas price. We must have enough ether in our wallet to pay for the gas fees.

The transaction fee is calculated using the following formula

Transaction fee= Gas unit used x Gas price

For example, for a certain transaction,

gas unit used=103631

Gas price= 1Gwei or 0.000000001 Eth

So transaction fee= 103631×0.000000001 Eth=0.000103631 Eth  

You can see the actual output in a smart contract deployment on Etherescan, as shown in the figure below:

In addition, you can “bribe” the miners to do your work first by paying more gas fees. In this way, you can jump to the front of the queue so that your transaction can be processed first.  Even if the transaction fails, you still need to pay for the transaction fee because the miners must validate and execute your transaction.

Gas Limit

The Gas Limit is an estimation of the total amount of work to perform a transaction. It is not easy to compute the gas limit. Fortunately, there are many apps that set the limit for us. Typically, 21,000 Gas will satisfy most transactions. However, for more complex transactions such as sending ETH to an ICO smart contract, the gas limit will be much higher. The reason is such a transaction requires much more computational power.

If you set the limit is too low, your transaction may take too long to process and even fail. As a result, you will lose ETH for nothing. On the other hand, if your transaction was completed before reaching the gas limit, you get back the balance ETH. The Gas Limit protects you from spending unlimited ETH, just like what banks set your credit card limit so that you will not overspend.

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.

Introduction to Corda

A Brief History

Corda is another enterprise-ready blockchain platform other than Hyperledger.  It was developed and launched by R3 in 2016. R3 is an enterprise software firm which focuses on distributed ledger technology.  It collaborates with more than 200 members and partners across multiple industries from both the private and public sectors to work on the Corda project.

Besides that, R3 has assembled a global team of over 180 professionals in 13 countries and over 2,000 technology, financial, and legal experts drawn from its global member base. (www.r3.com)

Key Concepts of Corda

Corda is an open source blockchain project, designed for business from the start.  It allows businesses to build interoperable blockchain networks that transact in strict privacy. Similar to Ethereum, Corda also features smart contracts that facilitate direct transactions among the businesses. However, its smart contracts are written in Java and other JVM languages instead of Solidity.  Also, it enables the development and deployment of distributed apps called CorDapps.

In addition, the Corda platform implements the flow framework to manage communication and negotiation between participants in the network. The Corda network is made up of a peer-to-peer network of nodes. One of the key concepts of Corda’s is its network service known as the notary.   The notary service provides uniqueness consensus for verification of transactions. I shall discuss uniqueness consensus in future articles.

The Corda Architecture

Although we often refer to Corda as a blockchain platform, strictly speaking, it is not a blockchain-based ecosystem. It is a kind of decentralized ledger technology network system that is not built by blocks. Instead, it looks a bit similar to the Tangle system in IOTA.

The Corda Network

The Corda network is an authenticated peer-to-peer network of nodes. Each node is a JVM run-time environment hosting Corda services and executing applications known as CorDapps. We can visualize the Corda network as a fully-connected graph. The nodes on the graph  can communicate with other nodes, as shown in the diagram below:

Corda Network

How does Corda differ from other DLT Platforms?

The Corda platform is different from other DLT platforms because 
 the structure is block-less. Also, the way it propagates data is also different.  Other DLT  platforms use global broadcast and gossip networks to propagate data. However, Corda does not employ the global broadcast method. Instead, It uses point to point messaging to transmit data.


According to the Corda white paper, all communication between nodes is direct, with TLS-encrypted messages sent over the AMQP. This means that data is shared only on a need-to-know basis. (*TLS stands for Transport Layer Security.  AMQP stands for Advanced Message Queuing Protocol,  an open standard application layer protocol for message-oriented middleware)

Corda nodes discover each other via the Network Map Service. The network map service publishes the IP addresses through which every node on the network can be reached. Also, it broadcasts the identity certificates of those nodes and the services they provide. You can imagine the service as a phone book, which publishes a list of peer nodes containing some information.

The Doorman

Corda networks are semi-private,  which means it needs to impose a kind of gateway control before a node can join a network. This control is called doorman. Each network has a doorman service that enforces rules regarding the information that nodes must provide. These nodes need to go through the know-your-customer (KYC)process before being admitted to the network.

To join the network, a node must contact the doorman and provide the required information. If the doorman is satisfied, the node will receive a root-authority-signed TLS certificate from the network’s permissioning service. This certificate certifies the node’s identity when communicating with other participants on the network.

That’s all for now. I shall discuss more about Corda in future articles.