Understanding Ethereum, Smart Contracts, Gas and Decentralized applications.

Photo by Zoltan Tasi on Unsplash

Understanding Ethereum, Smart Contracts, Gas and Decentralized applications.

This article provides an introductory overview of fundamental concepts in the blockchain space, including blockchain technology itself, the Ethereum platform, smart contracts, the use of gas in transactions and decentralized applications, with the aim of offering a comprehensive understanding of these concepts to readers.

BLOCKCHAIN TECHNOLOGY

Blockchain technology continues to gain massive adoption across the globe and decentralized applications (dApps) are becoming popular with Ethereum emerging as the largest blockchain network for building these applications.

Blockchain is a digital, decentralized and distributed ledger that enables the secure, transparent and immutable recording of transactions. It consists of a chain of blocks, thus the name blockchain, that contains data and a cryptographic hash of the previous block, making it closed, protected against unauthorized entry and unchangeable.

The decentralized nature of blockchain technology means that a central authority that would validate transactions is needless, as this is done by the network of computers participating in the network. This makes blockchain a trustless and transparent technology that can be used for different purposes such as financial transactions, supply chain management, voting systems and more.

ETHEREUM

The implementation of blockchain technology was first described in 2008 by Satoshi Nakamoto, the name used by the person or persons who designed and built Bitcoin, in a white paper, titled “Bitcoin: A Peer-to-Peer Electronic Cash System”. In the white paper, Satoshi Nakamoto proposed a way to create a decentralized global ledger among peers that could record digital currency transactions.

Ethereum is an open-source blockchain-based platform that allows users to build and deploy smart contracts and decentralized applications (dApps) that execute without any downtimes, censorship, fraud or third-party interference.

Vitalik Buterin, the founder of Ethereum, first proposed the idea behind Ethereum in 2013 when he was a programmer and researcher in the Bitcoin Community. Vitalik was fascinated by the concept of Blockchain and Bitcoin and started thinking about ways to extend its capabilities.

Vitalik started sharing the white paper that outlined the idea behind Ethereum, a Turing-complete, general-purpose blockchain. Vitalik and other Ethereum co-founders began thinking about a blockchain that could support a broad variety of applications. The idea was that by using Ethereum, a developer could build decentralized applications without having to implement a peer-peer network, blockchain, consensus algorithms etc. With contributions from Ethereum’s co-founders and other developers, the network was launched in June 2015.

SMART CONTRACTS

In the early 1990s, Nick Szabo proposed the concept of smart contracts, which he defined as digital promises that are specified and enforced through computer protocols, enabling parties to perform their agreed-upon obligations in a secure and automated manner without the need for intermediaries.

Smart contracts are self-executing programs that automatically execute the terms of an agreement when specific conditions are met. Smart contracts function like accounts that have a balance and can be the recipient of transactions. Unlike user accounts, smart contracts are not controlled by any individual; they are deployed to the network and operate according to their programmed instructions. Users can interact with smart contracts by submitting transactions that trigger the execution of predefined functions on the contract.

Smart contracts are capable of enforcing rules, similar to traditional contracts, but they do so through their underlying code. In general, smart contracts are permanent and cannot be deleted or modified, any actions taken with them are permanent and cannot be reversed.

Smart Contracts are the backbone of decentralized applications and are written in a programming language called Solidity, a JavaScript-like language specifically built for writing smart contracts on the Ethereum network. In order to run, smart contracts are then compiled into the low-level bytecode that runs on the Ethereum Virtual Network (EVM). Smart contracts are deployed to the Ethereum network after compilation and are identified by an Ethereum Address.

GAS

In Ethereum, gas is a unit of measurement used to determine the cost of using computational resources for transactions and smart contracts. You can think of gas as a fuel required to run on Ethereum. The amount of gas needed for each operation is influenced by factors like network congestion and the price of gas is determined by market conditions. Gas is an important concept of building decentralized applications as it affects the expenses associated with running DApps on the Ethereum network.

Gas is paid in Ether (ETH), the native currency of the Ethereum ecosystem and the second largest cryptocurrency in the world after Bitcoin (BTC). It can be transferred between accounts and used to pay for Gas. Ether is $1636.46 as of today and has a market cap of $197.55B. Ether’s current supply in circulation is $120.49M and has an undefined total supply.

DECENTRALIZED APPLICATIONS (DAPPS)

Decentralized applications (DApps) are applications built on a blockchain and operate without the need for a central authority. They use smart contracts to automate processes and enforce agreements between parties. Dapps are built on top of a distributed network of computers that maintain the integrity and security of the system. When a user interacts with a DApp, their transaction is verified by the network of nodes and added to the blockchain to ensure transparency, security, and immutability.

There are many examples of DApps built on a blockchain network, but here are a few examples;

Uniswap: A decentralized exchange built on the Ethereum network that allows users to trade cryptocurrencies without the need for a centralized authority.

Brave Browser: A decentralized browser that allows users to earn cryptocurrency for viewing ads and protects user privacy by blocking trackers and ads by default.

Chainlink: A decentralized oracle network that connects smart contracts to real-world data, enabling smart contracts to access information from outside the blockchain network.

CryptoKitties: A game built on the Ethereum network that allows users to collect and breed virtual cats, with each cat represented by a unique non-fungible token (NFT).

These DApps demonstrate the versatility and potential of blockchain technology for a wide range of use cases.

You can build your own decentralized application (DApp), it typically involves writing smart contracts in a programming language like Solidity and deploying them on a blockchain network like Ethereum. You also need to build a user interface for your DApp using web technologies like HTML, CSS and JavaScript.

There are several tools and frameworks available to help developers build DApps, including Truffle Suite, Remix etc. These tools provide an environment for writing, testing, and deploying smart contracts, as well as a range of other features to make DApp development easier.