Origin of Smart Contract
Smart contract concept was developed by "Nick Szabo" in 1994 with the goal of bringing practices of contract law and practice to design the electronic protocols between strangers on the Internet. Bitcoin emerged the use of contracts/blocks on a blockchain. Ethereum has made smart contracts operational along with the facility of ready made templates for various purposes. Smart contracts in general can be used to form any type of agreement that consists of specific & precise conditions and outcomes.
What is Smart Contract ?
- Smart Contract is a set of rules in the form of programming code that adds layers of information onto digital transactions being executed on a blockchain.
- Smart contracts are digital programs or contracts which may be executable or kick starter. They execute the instructions given to them automatically.
- To process a Smart Contract a blockchain is required and Contracts can be encoded on any blockchain.
- Blockchain is a virtual machine and it runs a smart contract.
- Smart contract is the basic unit of programming a blockchain for business purposes.
- Smart contract creates assets or tokenize existing assets on a blockchain.
- A smart contract enforces terms of the agreement through programming crypto-graphically.
- Smart contracts ensures a specific set of results.
- Smart Contracts are formed with the combined work of two parties "Software Developer" and "Lawyer". So a need for litigation is not required for that.
- Smart Contract is an agreement between all bodies involved in a transaction that holds everyone involved responsible for their role.
- Smart contracts facilitate to perform required transactions without any involvement of 3rd party.
- All the transactions performed by a smart contract are track-able this enables to maintain transaction history for records. Such transaction can not be reversed.
- Instead of simply exchanging digital tokens for a service or a product, smart contracts facilitate with more complex transactions through them.
- Benefits of using smart contracts instead of traditional contracts are increased speed, efficiency & trust among the parties.
How Smart Contract Works ?
Smart contract is formed with the consultation of lawyer on legal terms and with the help of a programmer who code those terms and write set of rules in the form of program.
That set of rules i.e. smart contract is then placed in a block of a blockchain.
This contract is spread and copied multiple times between the nodes of a blockchain. Now whenever a smart contract get triggers by a request on blockchain then the programs of smart contract gets executed and perform actions as per written terms and conditions. The program verifies implementation of the rules by itself.
Smart Contract Example
Payment settlement after a job is complete.
Assuming that their are two parties in which a payment has to made based on a job. In this case a smart contract plays an automatic and trustworthy role. A legal contract is made between a client and vendor based on various terms and conditions. Payment is made based on these terms. On start of the contract full payment is made by the client and it goes to an intermediate wallet. This payment will be release to vendor on completion of the job and only when both of the parties agrees. If any of the party disagrees and terms of the contract are not full filled the wallet payment goes back to client automatically.
Anatomy of a Smart Contract
Elements of a contract are mutual consent, consideration, capacity, and legality.
Formation of Smart contracts depends on the information of
- Various parties involved,
- Their obligations,
- Terms and Conditions,
- Host that will execute contract code,
- Contract Outcomes
Three main stages during the formation of a smart contract -
First : Translating the terms of the contract into code.
2nd : Ensuring the mutual consent from all parties for the correctness & outcomes of the code written for contract.
3rd : Execution of the code in impartial way so that results are always trustworthy and precise.
Coding Structure of a Smart Contract
A contract is similar to a class. A contract code is consist of state variables, functions, function modifiers, events, structures, and enums. It supports inheritance and polymorphism concepts of Object oriented programming.
|Example : Structure of Smart Contract Program|
|Code for a contract of simple Cryptocurrency|
Solidity is a contract-oriented programming language for writing smart contracts. It is used for implementing smart contracts on various blockchain platforms. It was developed by Gavin Wood, Christian Reitwiessner, Alex Beregszaszi, Liana Husikyan, Yoichi Hirai and several former Ethereum core contributors to enable writing smart contracts on blockchain platforms such as Ethereum.
I have tried to keep this article small and precise . I will keep adding more in future.
You may know more about Blockchain Technology through below articles
Cheers for Happy Life !!!
Post a Comment