A smart contract is an automatically executed contract in which the terms of the agreement between the contract parties are included in the code line. Essentially, a smart contract is a digital version of a standard paper contract that can automatically check the performance and execute and enforce the contract terms. The concept of smart contracts was proposed in 1994 by American computer scientist and cryptocurrency researcher Nick Szabo.
Smart contracts are executed through a blockchain network, and the contract code is copied to many computers that make up the network. This will ensure safer and more transparent tools and enforcement of contract terms.
How does a smart contract work?
First, let’s suppose that John is interested in buying Mike’s house. The agreement is formed on the Ethereum blockchain using smart contracts. The smart contract contains the agreement between John and Mike.
In the simplest terms, the agreement looks like this: “When John pays Mick 300 ether, John will own the house. Once the smart contract agreement is signed, it cannot be changed-this means that John can safely pay Mike 300 Ether home. In this case, if smart contracts are not used, Mike and John will have to pay a lot of fees to third-party companies. Including banks, lawyers, and real estate agents. No more commissions and no more delays are waiting for lawyers and intermediaries to complete the agreement! This is just one of many examples of how to use smart contracts.
First, the contracting parties must define the terms of the contract. After the contract terms are completed, they are translated into programming code. Essentially, the code represents many different conditional statements describing potential scenarios for future transactions. When a token is generated, it is stored in the blockchain network and copied between blockchain participants, and then the code is run. All computers in the network implement it. If the contract conditions are met and verified by all the blockchain network participants, the relevant transaction will be executed.
Smart contracts and blockchain
The concept of smart contracts is mainly based on the idea of blockchain technology.
The blockchain is a decentralized network that contains a growing list of records (blocks) linked by cryptography. The blockchain network does not contain a single central point like a traditional database. The data stored in the blockchain is shared among all the computers that make up the network. Therefore, the network is less susceptible to failures or potential attacks.
In addition, if the same record on other computers in the network is not changed in the blockchain, the record on one computer cannot be changed. Transactions executed through the blockchain are grouped into chain-linked blocks. A new block is created only after the previous block is completed. The blocks are arranged linearly in chronological order, and each block contains the cryptographic hash of the previous block. As mentioned earlier, we would like to thank the blockchain. Due to blockchain technology, we can decentralize the decentralization of smart contracts to make them fair and unreliable. By decentralization, I mean that they are not controlled by a single central government (such as banks, brokers, governments, etc.).
Use of smart contract
The Atlas Insurance Company of Malta and Axa Insurance Company of France made a smart contract in 2017. They have prototypes that can provide airline customers with compensation when delayed, and the medical system will use smart contracts to record and transmit data securely.
A smart contract: EncrypGen, a blockchain gene network We can already see examples of smart contracts used in the medical industry, such as EncrypGen. This application uses smart contracts to transfer patient data securely and does not allow third-parties to access it.
In this way, patients can control their data, and if researchers want to use patient data, they have to pay. Not only that, but the patient must also choose whether to sell it to him. For the government, smart contracts running on the blockchain may make the voting system completely unreliable and safer.
What is a smart contract: a safe and transparent online solution. Apps such as FollowMyVote use smart contracts and blockchain technology to protect votes from fraud. When voting transactions are written to the blockchain, they cannot be changed. When the vote is over, the smart contract will send the token to the address representing the vote winner.