What is Solidity

Completed

Solidity is an object-oriented language for writing smart contracts.

Smart contracts are programs stored inside a blockchain. They specify the rules and behavior for how digital assets are transferred. You use Solidity to program smart contracts for the Ethereum blockchain platform. Smart contracts contain state and programmable logic. Transactions result in functions executed in smart contracts. Thus, smart contracts enable you to create a business workflow.

Overview

Solidity is the most popular programming language for the Ethereum blockchain.

Solidity is a high-level language that is based on other programming languages, including C++, Python, and JavaScript. If you're familiar with any of those languages, Solidity code should feel familiar.

Solidity is statically typed, which means that type checking happens at compile time, not at run time like with dynamically typed languages. With a statically typed language, you need to specify the type of each variable. For example, Python and JavaScript are dynamically typed languages, whereas C++ is statically typed.

Solidity supports inheritance, which means that functions, variables, and other properties present in one contract can be used in another. The language also supports complex user-defined types like structs and enums, which allow you to group related types of data together.

Solidity is an open-source programming language with a growing community of collaborators. To learn more about the Solidity project and how to contribute, see the GitHub repository.

What is Ethereum?

Before we go any further, you should also familiarize yourself with Ethereum.

Ethereum is one of the most popular blockchain platforms, right behind Bitcoin. It's a community-built technology and has its own cryptocurrency called Ether (ETH) that you can buy and sell.

What makes Ethereum unique is that it's the "world's programmable blockchain". By using Ethereum, you can code contract definitions, also known as smart contracts. Smart contracts are used to describe how blockchain participants transfer digital assets. Solidity is the primary programming language used to develop on the Ethereum platform, and it's built and maintained by Ethereum developers.

Ethereum Virtual Machine

Solidity contracts run on the Ethereum Virtual Machine, or EVM for short. It's a sandboxed environment that is completely isolated. It doesn't access anything else on the network besides the contracts it executes. You don't need to know much more about the EVM for now, but just remember that Solidity smart contracts will be deployed to and run in a virtual environment.