Introduction to Smart Contract why it is so demanding in the IT world…

Amit Kumar Biswas @Amitlt2
7 min readApr 29, 2022

Started my research a month ago into Smart Contracts as a Security Analyst of Avalance Global Solutions and that’s why I want to share my thoughts and understanding of smart contracts with you.

So at the time of research, I didn’t understand from where I’ll start my research on Smart Contracts.

There will be a few points which I’ll cover and hope it’ll be helpful for you...

  1. Introduction to Smart Contract.
  2. Why Blockchain is so demanding in the IT industry?
  3. Which languages will be required for smart contracts?

4. Smart Contract Weakness Classification or SWC Registry:

5. Tools that are required for testing.

Introduction to Smart Contract.

The term smart contract has been used over the years to describe a wide variety of different things. In the 1990s, cryptographer Nick Szabo coined the term and defined it as “a set of promises, specified in digital form, including protocols within which the parties perform on the other promises.” Since then, the concept of smart contracts has evolved, especially after the introduction of decentralized blockchain platforms with the invention of Bitcoin in 2009. In the context of Ethereum, the term is actually a bit of a misnomer, given that Ethereum smart contracts are neither smart nor legal contracts, but the term has stuck. In this book, we use the term “smart contracts” to refer to immutable computer programs that run deterministically in the context of an Ethereum Virtual Machine as part of the Ethereum network protocol — i.e., on the decentralized Ethereum world computer. Let’s understand the definition of Computer programs, Immutable, Deterministic, EVM context & Decentralized world computer.

Computer Program: Smart contracts are simply computer programs. The word “contract” has no legal meaning in this context.

Immutable: Once deployed, the code of a smart contract cannot change. Unlike traditional software, the only way to modify a smart contract is to deploy a new instance.

Deterministic: The outcome of the execution of a smart contract is the same for everyone who runs it, given the context of the transaction that initiated its execution and the state of the Ethereum blockchain at the moment of execution.

EVM context: Smart contracts operate with a very limited execution context. They can access their own state, the context of the transaction that called them, and some information about the most recent blocks.

Decentralized world computer: The EVM runs as a local instance on every Ethereum node, but because all instances of the EVM operate on the same initial state and produce the same final state, the system as a whole operates as a single “world computer.”

Why Blockchain is so demanding in the IT industry?

There are a few reasons why it is so demanding in the IT industry follow the points below:

  1. Greater Transparency: Transaction histories are becoming more transparent through the use of blockchain technology. Because blockchain is a type of distributed ledger, all network participants share the same documentation as opposed to individual copies. That shared version can only be updated through consensus, which means everyone must agree on it. To change a single transaction record would require the alteration of all subsequent records and the collusion of the entire network. Thus, data on a blockchain is more accurate, consistent, and transparent than when it is pushed through paper-heavy processes. It is also available to all participants who have permission to access it. To change a single transaction record would require the alteration of all subsequent records and the collusion of the entire network. Which can be, you know, a headache.
  2. Enhanced security: There are several ways blockchain is more secure than other record-keeping systems. Transactions must be agreed upon before they are recorded. After a transaction is approved, it is encrypted and linked to the previous transaction. This, along with the fact that information is stored across a network of computers instead of on a single server, makes it very difficult for hackers to compromise the transaction data. In any industry where protecting sensitive data is crucial — financial services, government, healthcare — blockchain has an opportunity to really change how critical information is shared by helping to prevent fraud and unauthorized activity.
  3. Improved traceability: If your company deals with products that are traded through a complex supply chain, you’re familiar with how hard it can be to trace an item back to its origin. When exchanges of goods are recorded on a blockchain, you end up with an audit trail that shows where an asset came from and every stop it made on its journey. This historical transaction data can help to verify the authenticity of assets and prevent fraud.
  4. Increased efficiency and speed: When you use traditional, paper-heavy processes, trading anything is a time-consuming process that is prone to human error and often requires third-party mediation. By streamlining and automating these processes with blockchain, transactions can be completed faster and more efficiently. Since record-keeping is performed using a single digital ledger that is shared among participants, you don’t have to reconcile multiple ledgers and you end up with less clutter. And when everyone has access to the same information, it becomes easier to trust each other without the need for numerous intermediaries. Thus, clearing and settlement can occur much quicker.
  5. Reduced costs: For most businesses, reducing costs is a priority. With blockchain, you don’t need as many third parties or middlemen to make guarantees because it doesn’t matter if you can trust your trading partner. Instead, you just have to trust the data on the blockchain. You also won’t have to review so much documentation to complete a trade because everyone will have permissioned access to a single, immutable version.

Which languages will be required for smart contracts?

1. C++

C++ is a general-purpose programming language that comprises of at least more than 4.4 million developers. Its greatest strength is the ability to scale resource-intensive applications and make them run smoothly. As the EOS blockchain supports smart contracts through its WebAssembly virtual machine, any language that is able to compile into WebAssembly (WASM) will be able to program smart contracts. However, C++ is the recommended language for developers to use on EOS.

2. Solidity

Solidity was first developed by Gavin Wood, Yoichi Hirai, Christian Reitweissner, and many other core contributors of Ethereum to help develop smart contracts. With the Ethereum blockchain leading the way as a major smart contract platform, many alternative blockchains want to make use of Solidity compatible contracts to run on their networks. Smart contracts that are deployed on the Ethereum network can be easily ported to alternative blockchain networks. Solidity is the main smart contract programming language that is used to build smart contracts on the Ethereum blockchain. It is a high-level programming language that looks similar to Python, C++, and JavaScript. It is a contract-oriented programming language meaning that smart contracts are vested with the responsibility of storing all the programming logic that transacts with the blockchain. The Solidity programming language runs on the Ethereum Virtual Machine (EVM) that is hosted on Ethereum nodes connected to the blockchain. It supports inheritance, libraries, and much more and is statically typed. It is capable of building blockchain applications that boost industrial strength.

3. JavaScript

JavaScript is an object-oriented programming language that is dynamic and lightweight. JavaScript was created by Brendan Eich. Along with HTML and CSS, JavaScript forms the three pillars of web designing. JavaScript is used to create smart contracts on the NEO blockchain. JavaScript ushered in the era of more dynamic and user-friendly websites. It is credited with making websites more user-friendly. New language features are added periodically to JavaScript. NEO aims to provide choice and freedom to developers. As it supports a variety of mainstream programming languages, a lot of developers can write smart contracts on NEO and develop and realize their own ideas.

4. Java

Java is a smart contract programming language that is popular and in-demand. It is an object-oriented and class-based programming language that was created by Sun Microsystems in 1995. A lot of its syntax and structure has been derived from C++. Java can be used to create smart contracts in NEO. NEO is a blockchain platform that facilitates the development of smart contracts and digital assets. The word NEO originates from the ancient Greek language and translates as ‘new,’ ‘modern,’ and ‘young.’ NEO aims to use smart contracts to become a decentralized, digital, and distributed platform for non-digital assets. Its specific goal is to become a digital alternative for asset transfers that are currently non-digital. Java was designed to offer flexibility to developers to write code that will run on any machine, irrespective of the platform or architecture. The Java programming language is used to create smart contracts on the NEO blockchain.

5.Golang

Go, or Golang is an open-source programming language that was developed by Google. It supports concurrent programming, which means that it will allow multiple processes to run simultaneously. It is loosely based on the syntax of the C programming language. It is an easy language for developers. The number of Golang developers worldwide is estimated at 800,000. A vast portion of Hyperledger’s chaincode built using Hyperedger Fabric for smart contracts are written in the Golang programming language.

Smart Contract Weakness Classification or SWC Registry:

The Smart Contract Weakness Classification Registry (SWC Registry) is an implementation of the weakness classification scheme proposed in EIP-1470. It is loosely aligned to the terminologies and structure used in the Common Weakness Enumeration (CWE) while overlaying a wide range of weakness variants that are specific to smart contracts. The goals of this project are as follows:

  • Provide a straightforward way to classify security issues in smart contract systems.
  • Define a common language for describing security issues in smart contract systems’ architecture, design, or code.
  • Serve as a way to train and increase performance for smart contract security analysis tools.

Go to this Url:- https://swcregistry.io/

Tools that are required for testing:

  1. Browser based Solidity IDE: http://remix.ethereum.org/
  2. Securify V2.0: https://github.com/eth-sri/securify2
  3. Oyente: https://github.com/enzymefinance/oyente
  4. The Hydra Aplha: https://github.com/IC3Hydra/Hydra
  5. Porosity: https://github.com/msuiche/porosity
  6. Manticore: https://github.com/trailofbits/manticore/
  7. Etherplays: https://github.com/crytic/ethersplay
  8. Online Solidity Decompiler: https://ethervm.io/decompile
  9. Mythril: https://github.com/ConsenSys/mythril
  10. Echidna: https://github.com/crytic/echidna
  11. Slither: https://github.com/trailofbits/slither

Thanks Guys for reading my write-up…

If there is any mistake then don’t hesitate comment me down…

Follow me:

Instagram

Twitter

Facebook

LinkedIn

--

--

Amit Kumar Biswas @Amitlt2

Cyber Security Analyst at @avalanceGlobalSolutions | Security Researcher in | Cyber Security Researcher in Microsoft & Bugcrowd | R&D in Smart Contract |