A smart contract is a computer code that predefines a set of rules under which the parties to that smart contract agree to interact with each other. Once the pre defined rules are met, the agreement is automatically enforced. The code facilitates, verifies, and enforces the negotiation or performance of an agreement or transaction. This is the simplest form of decentralized automation.
A smart contract is a mechanism involving digital assets and two or more parties, where some or all of the parties deposit assets into the smart contract and the assets automatically get redistributed among those parties according to a formula based on certain data, which is not known at the time of contract initiation.
Note that smart contracts are not to be confused with legal contracts. But we will probably see a fusion of legal contracts and smart contracts emerge over the next few years as the technology becomes more mature and widespread.
# Reducing Transactions Costs of Coordination & Enforcement
Smart contracts radically reduce transaction costs. The contract is a set of promises agreed to in a “meeting of the minds” is the traditional way to formalize a relationship. Auto enforceable code – whether on the protocol level or on the application level – standardizes transaction rules, thus reducing the transaction costs of (1) reaching an agreement, (2) formalization, and (3) enforcement. The abstract concept of a smart contract is a recognized tool to formalize the relationships between people, institutions and the assets they own.
The transaction rulesets (agreement) of the smart contract defines the conditions – rights and obligations – to which the parties of a protocol or smart contract consent. It is often pre-definited, and agreement is reached by simple opt-in actions. This transaction ruleset is formalized in digital form, in machine-readable code (formalization). These rights and obligations established in the smart contract can now be automatically executed by a computer or a network of computers as soon as the parties have come to an agreement and met the conditions of the agreement (enforcement).
Smart contracts are capable of tracking performance in real time, and can bring huge cost savings. Compliance and controlling happen on the fly. In order to get external information, a smart contract needs information oracles, which feed the smart contract with external information.
Smart Contracts are
- Tamper resistant
Smart Contracts can
- Turn legal obligations into automated processes.
- Guarantee a greater degree of security.
- Decreasing reliance on trusted intermediaries.
- Lower transaction costs
Would you enter into a contract with someone whom you’ve never met? Would you agree to lend money to some farmer in Ethiopia? Would you become an investor in a minority-run newspaper in a war zone? Would you go to the hassle of writing up a legal binding contract for a $5 purchase over the internet? If A and B don’t know and trust each other they usually need a trusted third party to serve as an intermediary to verify transactions, and enforce them. With smart contracts & blockchains you don’t need those trusted intermediaries anymore for clearing or settlement of your transactions. Take the example of buying and selling a car:
# How to Code Smart Contracts?
- Official Solidity Documentation, by Ethereum Foundation
- Solidity Tutorial, using Visual Studio
- Solidity Code Snippets, useful for Ðapp development
- Accessing Contracts & Transactions: Interacting with smart contracts
- Integrated development platform (IDE) browser based with integrated compiler and solidity runtime environment without server-side components
- Ethereum Solidity Gitter chat channel
- Remix: IDE that allows developers to build and deploy contracts and decentralized applications on top of the Ethereum blockchain
- The Hitchhiker’s Guide to Smart Contracts in Ethereum, Manuel Aráoz, Medium
- Truffle: The most popular Ethereum development framework, Github
# Further Reading
- Check out our Smart Contract Infographic
- Internet of Agreements: Building the Hyperconnected Future on Blockchains – why smart contracts could change the way people do business: by Hexayurt.Capital in collaboration with ConsenSys