Hashtag Web3 Logo

What is Solidity?

6 min
beginner

The Language of Web3

If you want to build on Ethereum, Arbitrum, Optimism, Base, or Polygon, you need to write code that the Ethereum Virtual Machine (EVM) understands.

The EVM only reads machine-level "bytecode." Writing bytecode by hand is incredibly difficult. Solidity is the high-level language designed specifically to write smart contracts that compile down into that bytecode.

Key Characteristics of Solidity

Solidity was designed with specific constraints in mind, because code running on a blockchain handles real financial value and cannot be changed once deployed.

  1. Object-Oriented: Contracts in Solidity behave a lot like classes in object-oriented programming. They contain state variables (data) and functions (behavior). Contracts can also inherit from other contracts.
  2. Statically Typed: You must declare what type of data a variable holds (e.g., uint256 for a positive integer, address for a wallet address, bool for true/false). This helps catch errors before the code is deployed.
  3. State Management: Solidity is built to interact with the blockchain's state. Variables defined at the contract level are permanently stored on the blockchain.
  4. Value Transfers: Built-in keywords like payable and types like address make it incredibly easy to send and receive ETH directly within the code.

The Compilation Process

Solidity Code .sol files (Human readable) Compiler (solc) ABI JSON interface for UI to interact Bytecode 0x60806040... (Machine code) Deployed to Blockchain (EVM executes it)

When you finish writing your .sol file, you compile it. The compiler outputs two crucial things:

  1. Bytecode: The actual hex code that is deployed to the blockchain and executed by the EVM.
  2. ABI (Application Binary Interface): A JSON file that describes all the functions and variables in your contract. Frontend applications (like a React app) use the ABI to know how to interact with the deployed contract.

Why developers learn Solidity

While other languages exist (like Rust for Solana, or Vyper for Ethereum), Solidity has the largest developer ecosystem, the most audited standard libraries (like OpenZeppelin), and the vast majority of developer tooling (Hardhat, Foundry, Remix).

If you want to become a smart contract engineer, Solidity is the mandatory starting point.

Key takeaways

  • Solidity is a statically typed, object-oriented language for writing EVM smart contracts.
  • Code is compiled into bytecode (deployed to the blockchain) and an ABI (used by frontends to interact with the contract).
  • Contracts are immutable once deployed.
  • It is the most dominant language in the Web3 developer ecosystem.

Quiz: What is Solidity?

1 / 5

What is Solidity primarily used for?