Concretely, decentralized applications are constructed by smart contracts on the Ethereum blockchain. Here's a few mental models to think about what a smart contract is capable of.
- Web development lens: You can think of smart contract as the backend + database of your application.
- Object oriented programming lens: A smart contract is just a class. It's got methods and attributes. When someone says a smart contract has X address, they are saying there's an instance of the smart contract out there with memory address X. It's expensive for users to instantiate new instances of the smart contracts, so we try to design them in a way that everyone can share the same instance.
- Purely technical lens: A smart contract is bytecode deployed to Ethereum's virtual machine. Similar to byte code or machine level code, humans write programs in a high level language that gets compiled. In Ethereum, most programmers write code in Solidity. This code defines the functions the smart contract has as well as how the smart contract manipulates data. In solidity, this data can take the form of hashmaps, integers, or strings.