Blockchain developers use Solidity to program smart contracts.
The same team developed Solidity and Ethereum, and, as such, their history is entwined. Solidity was first proposed in 2014 by Ethereum co-founder Gavin Wood and subsequently developed by a team of Ethereum core developers.
[Read now: 5 real-world use cases for NFTs]
The Ethereum developer community has defined standards that govern how Solidity smart contracts are used to build dApps on Ethereum. Commonly called “token standards,” some will be highly familiar, while others are more obscure. Here’s a selection:
Ethereum’s ability to process instructions coded in Solidity is what differentiates it from a blockchain like Bitcoin. Bitcoin can only process instructions that relate to BTC transactions, whereas Solidity allows the Ethereum Virtual Machine (EVM) to translate a potentially infinite variety of instructions.
Once a developer has written a smart contract in Solidity, they run it through a compiler, breaking it down into a set of instructions rendered in byte code. The EVM can read the byte code and execute it accordingly.
The generation of byte code introduces an element of economic balance into the process of developing smart contracts. Generating byte code requires Ethereum gas, which must be paid for by the user.
Ethereum is a Turing-complete machine. In principle, anyone could program a Solidity smart contract to do anything on the platform. However, this capability is limited by the practical requirement to buy enough gas.
There are other languages that compilers can process into byte code, including Serpent, Viper, and Mutan. However, they all serve the same function: To allow human-readable code to be compiled into byte code for execution by the Ethereum Virtual Machine.
Solidity can program almost any outcome as a general-purpose language and is relatively easy to write and quick to deploy. However, writing secure smart contract code is very difficult. Many black-hat operators in the crypto space actively seek out vulnerabilities in Solidity programming to drain accounts of funds.
Since the value of the DeFi markets started to rise exponentially, there have been many instances of this happening. Digital asset research firm Messari estimated in April that over $284 million had been lost to DeFi hacks since 2019.
Many projects now use blockchain security audit firms and independent third parties to scrutinize code for deficiencies. However, it’s not a silver bullet, and issues may slip past an audit undetected.
The fact that blockchains are immutable only compounds this issue. Once a developer publishes their code to the blockchain, they can’t edit or tweak it. Therefore, it must be thoroughly tested and robust enough against attack when it goes live.
Immutability explains apps like Uniswap have versioning. When the developers want to make changes and introduce new features, they can’t simply add them to the existing version—they must publish an entirely new version to the blockchain.
Similarly, they can’t stop people from using the old version. They could remove the user interface and make it more difficult, but the smart contract would continue to exist.
Solidity continues to power the biggest ecosystem in blockchain, Ethereum. Despite its limitations, it boasts an active developer base continually updating the code and maintaining smart contract standards. As such, Solidity will remain among the leading smart contract programming languages for the foreseeable future.
The “double-spend” problem is one of the many pieces of jargon that often seems confusing to anyone unfamiliar with cryptocurrencies because it doesn’t exist in traditional finance. Understanding the double-spend problem and how Bitcoin solves it is key.
What is a CEX? What is a DEX? Centralized Exchanges (CEXs) and Decentralized Exchanges (DEXs) are different types of cryptocurrency exchanges. What's the difference? And which is best for you?