Blockchain

Chamod Malintha
setublog
Published in
6 min readMar 16, 2019

What is BLOCKCHAIN

The blockchain is a decentralized, distributed public immutable ledger. Simply you can think it as a global online database that not belongs to anyone.

Satoshi Nakamoto the inventor of Bitcoin technology took the first step into this blockchain concept. Before that no one has ever heard anything about blockchain technology. Satoshi Nakamoto invented a solution for byzantine generals’ problem and latterly it was developed into blockchain technology by some other people.

https://dashbouquet.com/blog/blockchain/blockchain-solutions-the-way-to-transform-your-business-processes

In a blockchain network, every node keeps a copy of all the transaction data. All the nodes are connected to every node in a peer to peer fashion. If any node fails it is not a problem because all the other nodes contain all the transaction data. With the distribution of data, anyone can see and verify all the data set. That makes it very transparent and secure.

Ex: When an attacker attacks a node and change its data, then the blockchain network automatically compares data sets in all the other nodes and identify that node is attacked. Then within the network, it changes that node to its previous state automatically. (We can talk later about 51% attacks and all the other stuff related to it.)

Types of Blockchains

1. Public Blockchains

Anyone can join into the public blockchains. Most popular public Blockchains are Bitcoin and Ethereum.

2. Private Blockchains

In private Blockchains, all the permissions are kept for one organization and information are private to that organization or company. The main reason to use a private blockchain is to keep their information hidden from others.

Ex: Multichain

3. Consortium Blockchains

Consortium blockchains are similar to private blockchains. This type of blockchains is mostly used among business organizations/groups. Like public blockchain, anyone who has an internet connection cannot access to a consortium blockchain.

Control over a consortium blockchain is usually granted to a group of approved individuals. With a consortium blockchain, the consensus process differs to the public blockchain. Instead of anyone being able to partake in the procedure, consensus participants of a consortium blockchain are a group of pre-approved nodes on the network.

Ex: Hyperledger, Corda

BLOCKS

https://www.guru99.com

The blockchain is one to another linked chain of blocks. In a blockchain network, the first block called as genesis block. There will be only one genesis block and after Blockchain is initialized, that block will be the first block forever. Genesis block doesn’t contain a previous hash.

In a blockchain network, it uses hashing algorithms for data encryption and security of the blocks.

https://bitcoinist.com

A block contains,

• Block number

• Nonce (this will be talked in block mining process)

• All the transaction details

• Previous Block Hash

• current Block Hash

Block hash contains 64 characters. It is calculated using transaction details and previous block hash. According to changes of transaction, data block is frequently changing its hash. One simple change leads to completely different block hash (it’s a characteristic of hashing algorithms).

There is a timeframe to generate a block. In the Ethereum network, there is a new block created for every 15 seconds (changes slightly time to time). In bitcoin network, it takes around 10–15 minutes.

BITCOIN:

Bitcoin is a public blockchain network that uses bitcoins as it’s cryptocurrency. It is the first digital currency as well as the first use case of blockchain technology. Without going to banks and other places you can transfer these digital currencies from one person to another. For those cryptocurrency transactions, you have to maintain a digital wallet in your computer or mobile phone. Through that digital wallet, you can make transactions.

https://www.payfast.co.za

Actually, most of the organizations and people use bitcoin to transfer funds, assets purchasing etc. It’s just doing business. It’s not a platform to create blockchain based projects and applications.

That’s where Ethereum comes in. Ethereum is a platform that can be used to create programs blockchain applications for your own needs.

ETHEREUM:

Ethereum is a (blockchain) network of computers. We use Ethereum to create blockchain applications. Ethereum has its own cryptocurrency, which are called as ETHERS.

https://www.ethereum.org

There are many different Ethereum networks, but there is only one main Ethereum network. That is the Public Ethereum network. Everyone uses it for deployment of their production applications.

Other networks can be classified in to test networks and private Ethereum networks. You can create your own private Ethereum network. We use test networks to test our blockchain application before we deploy it to the main network.

Each node is a machine running an Ethereum client. That machine can be desktop, laptop or any kind of computer. All those nodes connected to form a network. Actually, in those Ethereum and Bitcoin networks, there are millions of nodes.

Every node in the Ethereum network contains a full copy of blockchain in other words a node contains every single block that created from the initialization of the genesis block.

Ways of Connecting to the Ethereum Network:

Developers create applications and connect to the network through code by using libraries like web3.js, web3j etc.

For people who have no programming experience can use chrome extension like Metamask, Mist browser or other wallets to interact with the Ethereum network.

Metamask:

Metamask is a chrome extension to ease the process of interacting with the Ethereum world. After installing it we can use it as our digital wallet. It is a coin-based collection of accounts which contains our real and dummy ethers. Using it we can connect to the main network, test networks or our private local node.

https://ethereum.stackexchange.com

To connect to the main network, we have to purchase ethers because every transaction that takes place in the main network costs ethers. But for development purposes we can get dummy ethers from faucets and use those on test networks like Rinkeby, Ropstan etc. Metamask knows how to manage and when to use real or dummy ethers.

When we are creating our metamask wallet, they give us a mnemonic. It is a 12 word phrase which identifies our every account in metamask.

Mnemonic example : Candy Mapple Cream Suger Honey Pudiing Cake Rich Crumble Sweet Treat Smooth

For every account in metamask, has a unique address. It’s like your email address. It is using to identify who you are. That address consists of hexadecimal numbers. Metamask handles all our accounts private keys and public keys.

***********From this onwards, I will continue with Ethereum.********

--

--

Chamod Malintha
setublog

Software Engineer | BSc. (Hons.) in Software Engineering | University of Kelaniya, Sri Lanka