Smart Contracts


Smart Contracts are self-executing contracts with the terms of the agreement between a buyer and seller written into the code. A simple example of a smart contract is a vending machine. The terms of the agreement between a vending machine and its customer are as follows, insert a dollar, select your snack, get a snack. If less than a dollar is inserted, no snack, if more, change is returned. This is a basic agreement that could be coded into a smart contract.
Using this logic of if→then statements, more complicated tasks involving exchanging money for services can be automated using smart contracts. An example of this is a smart contract based rideshare service like “Uber”. Within a smart contract based rideshare app, upon starting a ride, a rider would send funds from their account into an escrow account controlled by a smart contract. When the rider reached their desired destination, location data would trigger the smart contract to automatically release of the funds from the escrow account into the account of the driver. If the rider did not end up where they needed to go, the smart contract would return the funds to the rider.