Today as a part of our Crypto for beginners series we would like to introduce to the nontechnical part of our community the basics of Smart Contracts. How do they work? What are the benefits?
With blockchain being a decentralized, immutable open ledger, it can be a platform for transacting many things. The most common or well known utility is as digital currency, like Bitcoin. Another asset that can live on the blockchain include smart contracts, or self-executing contracts. Smart contracts help you exchange anything of value in a transparent way that does not depend on intermediaries. This place smart contracts as a quite impressive tool with unlimited use case possibilities.
How do smart contracts work?
Smart contracts can be thought of as digital contracts. They are converted to computer code, stored and replicated on a network of computers that run and secure the blockchain. Based on the details in the code, a smart contract is automatically executed when criteria are met between both parties by this same network of computers. Just like how code works behind a website, a code in a smart contract is essentially an “if, then” statement meaning: if conditions in the contract are met, then an event detailed in the contract is triggered. Easy to understand real world example: if someone pays X amount to the smart contract, then the smart contract will send that person the desired product.
What are benefits of smart contracts?
1. Trustless and Autonomous
Because no single entity owns or controls the blockchain, smart contracts are able to transact and execute autonomously without a third party. You don’t have to rely on a lawyer, broker, or even the person you are transacting with. All the details are in a smart contract hosted on the blockchain and the code (conditions of the smart contract) can be reviewed by anyone as it is open source. Also the smart contract code can’t be changed afterwards as, once submitted to the blockchain, it is immutable, so everyone can trust that the agreed upon terms are executed no matter what. The person who writes the smart contract code needs to be very sure the code is 100% correct, because once it is on the blockchain, it is there forever!
2. Safety and Backup
Because of the cryptographic properties of blockchain technology a properly coded smart contract is very secure and the assets that it might hold are therefore safe against for example hacking. And once a smart contract is submitted to the blockchain network, it also means that it is distributed to all the computers that form the network and by that automatically backed up.
3. Savings and Speed
With not having to rely on a third-party like a lawyer or broker, you can save on these fees. Because smart contracts auto-execute based on when criteria is met, the transactions are automated and save time.
What are some examples of smart contracts?
There are many applications for smart contracts in business to business transactions (B2B), such as supply chain and logistics. Companies can use self-executing smart contracts to pay their suppliers when their goods arrive, for instance.
In creative industries, content creators and musicians can fully own rights to content they put out. Using smart contracts, it would allow them to collect royalty fees every time their content is used for commercial purposes. The blockchain would keep track of all ownership rights and ensure content creators are paid in real time.IPFS would allow to store the original copyrighted content into the blockchain and cross validate in case of any dispute.
By using smart contracts to facilitate property ownership and sales, these transactions will always be backed up on the blockchain and can reduce auditing cost, time, and need for third-parties. An example could be the issuance of a car title once the car has been paid off. The smart contract is self-enforced and will auto execute, while all the payments are recorded on the blockchain and are immutable.
Code is law.
What does it cost? Who pays for it?
Running smart contracts on the blockchain requires computer calculations to be made by the network, just as normal transactions do. Normal (peer-to-peer) transaction fees are paid in the Blockchain’s native currency, in case of PIRL the native currency is PIRL, and the fee for smart contract transactions as well. Smart contract transactions are more complicated, so the fee is usually a bit higher. Just as normal transaction fees the smart contract fees are paid by the user that initiates the transaction to the smart contract for most smart contract enables networks. You may expect those fees to be infinitely smaller than intermediaries would charge for the services that smart contracts replace.
As we proceed into a more digitized world, smart contracts will become more prominent and developed. Technology is constantly evolving, and smart contracts are an innovation to help us become a more efficient and transparent society. Their functionality can widely spread into the business sector as well as into online markets and simple user’s everyday use.
Combined with the recently announced implementation of IPFS technology we are looking into a bright future for the platform. Giving the chance to Smart Contract developers also include an immutable file storage and content in the smart contracts game.