How do Smart Contract Platforms Work?

Note: Data in this section last updated August 26th, 2022

Smart contract platforms perform three basic functions:

  • Data Storage: Store important data such as account balances on a blockchain

  • Execution: Run programs via smart contracts

  • Consensus: Provide consensus mining to secure the network and validate state

So if Alice and Bob wanted to use the Ethereum blockchain to trade U.S. dollars for Ethereum tokens, the process would look something like this:

  1. The Ethereum blockchain stores Alice and Bob’s original account balances (i.e. Alice has 2ETH and Bob has $8,000)

  2. Bob would open a trading dapp, such as Uniswap*, which would read these balances

  3. Uniswap’s smart contracts would determine the price of Ethereum, let’s say it’s $4,000, and execute the trade

  4. he results of the trade along with the updated balances would be sent to miners to verify

  5. Miners would verify this transaction using a Proof-of-Work consensus protocol

  6. Miners would then update the Ethereum blockchain with the new balances – (i.e. Alice now has 1 ETH and $4,000 and Bob now has 1 ETH and $4,000)

*This is actually a vast oversimplification of the process and also not how Uniswap actually works. That said, I believe it is helpful in getting a general idea of the flow of a smart contract platform. If you’re interested in learning more about how a decentralized exchange operates, you can check out my paper on DeFi (link).

So, at the end of the day, the network is secured by economic incentives and game theory – a miner who acts appropriately could receive hundreds of thousands of dollars in rewards, while one who attempts to cheat the system will almost certainly be left with nothing but a huge electricity bill.

In the next three sections, we'll dive deeper into how blockchains, smart contracts and consesus mining work... 👉

Last updated