- 4 days ago
Explaining the glue that holds blockchain technology, like DeFi and NFTs, together – Smart Contracts
A smart contract essentially has the same principle as a standard paper contract; it is where the terms of an agreement between a buyer and seller are outlined. Indeed, since we are dealing with cryptocurrency, where all transactions take place online, smart contracts are presented in the form of computer code and exist and run on blockchain technology.
A smart contract allows a transaction between two parties to be carried out without the need for a legal system as a mediator for verification. Traditionally, the legal system is the bank, which acts as a third-party service in any transaction that is to be pursued.
A Bit Of Background
Smart contracts were invented in 1994 by an American computer scientist, ‘Nick Szabo’. Szabo actually invented a digital currency named ‘Bit Gold’, 10 years before Bitcoin was invented. Although invented in 1994, smart contracts were not implemented until 2009 when Bitcoin and blockchain came around.
How do Smart Contracts Work?
Smart contracts cannot access external data and so in order to retrieve information from the outside world to execute into an electronic contract, they get ‘help’ from services known as ‘oracles’. Oracles retrieve, verify and send data from the outside world to smart contracts. This is by using methods such as market data feeds and web APIs.
When two parties make an agreement, a computer code is created which is then executed onto the blockchain network and then by all the nodes in the network. If the terms of the agreement are met and also authorized by all the participants in the network, the transaction is executed.
A smart contract can be instilled into the blockchain on its own but it can also be executed together with other smart contracts. Furthermore, the completion of one smart contract can provoke the start of another smart contract. Since smart contracts run on an open blockchain ledger, rules within a smart contract that apply to certain businesses can also apply to other business partners on other smart contracts. Notably, once a smart contract is executed onto the blockchain, it is irreversible and always traceable.
Smart contracts are most commonly executed on the Ethereum network. They are developed in the form of high code through a specific type of ‘writing’ known as ‘Solidity Language’. The most known contract which runs on the Ethereum network is ‘ERC-20’ and it allows the creation of tokens on this network.
Advantages of using Smart Contracts:
Smart contracts reduce expenses needed to manage transactions, as no third party services are needed. Since no third party services are needed,there is no risk for manipulations by third parties. Also, transactions are also more speedy.
Importantly, smart contracts eliminate the potential for human error as information that is stored on the blockchain exists on every node in the system. The original information can be restored if data is lost. Blockchain technology is also highly secure as information cannot be altered. This eliminates the motivation for fraudulent activity.
Trust between two parties is no longer an issue when working with smart contracts. These types of contracts operate on an ‘If-Then’ principle, where the terms of an agreement are only executed once the amount of money outlined in the contract is sent to the system.