If you are in Crypto mining or staking or any other blockchain technology you might have heard already about a smart contract. A smart contract is nothing else than a script implementation of a paper-based contract and ensures that it goes into effect when certain conditions are met in the world around blockchain.
Let me start with some typical words which I use a lot; Did you know …?
Smart contracts exist in the form they are used today in the blockchain already since Nick Szabo, a computer science/law major penciled out the idea back in 1994 in his paperwork. His basic idea was that all contract conditions can be put into a process utilizing protocols and user interfaces to fulfill the conditions of the smart contract.
Later in 2013, the co-founder of Ethereum Vitalik Buterin uploaded a whitepaper ‘Ethereum: The Ultimate Smart Contract and Decentralized Application Platform’ to his blog. Vitalik introduced and implemented the concept of smart contracts into the Ethereum blockchain system, opening the world to the use of smart contracts.
Current smart contracts used in blockchain resemble scripts that implement conventional pen & paper contracts with digital code lines and execute the contract when a certain set of promises on predefined conditions are met.
Using a smart contract between two parties allows them to be completely anonymous to each other; this is because the contract does not take effect if certain conditions are met. Talking about establishing a contract we can see the easy element here, signing a smart contract allows it to go into motion without a middleman. However, it did introduce the powerful concept of decentralization.
Let us come back to our topic of today. What does it help us, and why is it so popular and used in many areas?
A Traditional Contract
In our infographic below we illustrate two parties who have the objective to go into an agreement that Bob wants to sell his car and Alice wants to purchase it.
On a paper contract both pencil out the agreement, Alice will pay Bob 20,000 Euro for the car. Once Bob receives the deposit he will transfer the vehicle ownership to Alice and hand her over the key for the car.
A trusted third party verifies the deal by making active checks on the contract conditions. The process can differ from country to country, but the concept is nearly the same. The trusted third party checks the vehicle registration authority to validate the ID of the car validates the identity of the buyer and seller and approves their contract of transferring the ownership. This process is time-consuming and costs middlemen fees.
The Smart Contract
1. Bob makes the decision to sell his car. He identifies himself on the blockchain with an ID (public key) 757382 and uses a smart contract to define the terms of the sale signing it with his private key. In the contract, he anchors the condition for the smart contract to go into motion. If 20,000 Euro were sent to my account number 757382 then automatically transfer car ID 13849Z as well as grant smart contract lock access to the account from which the money has been transferred.
2. Bob leaves his car and the key in a garage locked with a smart contract controlled smart lock. The car has its own blockchain address (public key) 13849Z stored in the blockchain.
Bob’s smart contract can be viewed over a web browser.
3. Alice finds the smart contract from Bob and decides to purchase the car. She transfers with her ID (public key) 389157 the 20,000 Euro to Bob’s blockchain address 757382.
4. The smart contract is verified by each node on the blockchain network checking if Bob is the owner of the car and if Alice has enough money to buy the car.
5. If the network agrees that all conditions are “True”, Alice automatically gets the access code to the smart garage lock. The blockchain registers Alice as the new owner of the car. Bob has 20,000 Euro more in his account, and Alic 20,000 Euro less.
6. Alice can now pick up her car by unlocking the smart lock with her private key.
Why can I trust code?
So how can I validate or trust computer code? Let’s assume a thief “C” claims to be the owner of Alice’s car.
Since every transaction is stored in the public blockchain, everyone can inspect it and see that the owner of the unique car ID with the blockchain address 13849Z is Alice, not “C”.
Since the blockchain is replicated across the blockchain network over hundreds of computers, everyone can validate the contract and ID in the blockchain. The blockchain’s biggest advantage is the distribution of data which makes it impossible to manipulate them.
Thank you to Shermin Voshmgir and Valentin Kalinov from BlockchainHub to put this infographic together. Not every blockchain technology supports smart contracts. As of today, we can see the most popular once Binance Smart Chain, Ethereum, Avalanche, Solana or Tron. Cardano announced already to support it in the future.
The use cases are endless, you can find them across all industries and business verticals. The government adopted the concept already across the globe. Other areas are to be followed and we will see more to come.