Smart contracts in Blockchain-based on BTC, ETH

Nirmitee
3 min readApr 27, 2022

--

WHAT ARE SMART CONTRACTS IN BLOCKCHAIN?

Smart contracts, which are stored on a blockchain, are essentially programmes that run when specific criteria are met. They’re typically used to automate the execution of a contract so that all parties can be certain of the outcome immediately away, without the need for any intermediaries or wasted time. They can also automate a workflow by starting the next phase once certain conditions are met.

In short, Smart contracts are digital contracts that are automatically executed when preset terms and conditions are met and are maintained on a blockchain.

HOW DO THESE SMART CONTRACTS WORK?

To make smart contracts operate, simple “if/when/then” lines are inserted into code on a blockchain. The actions are carried out by a network of computers once the preset conditions are met and approved. Transferring funds to the appropriate parties, registering a car, sending alerts, or issuing a ticket are examples of these tasks. The blockchain is updated once the transaction is completed. This means that the transaction can’t be changed, and the results are only visible to those who have been given permission to see them.

A smart contract can have as many parameters as necessary to persuade participants that the activity will be completed appropriately. To create the conditions, participants must agree on how transactions and accompanying data are represented on the blockchain, as well as the “if/when/then” rules that govern those transactions. They must also analyse all possible exceptions and design a structure for resolving disputes.

A developer can then code the smart contract, though businesses that use blockchain are increasingly giving templates, web interfaces, and other online tools to make smart contract creation easier.

HOW DO SMART CONTRACTS WORK?

A smart contract is a business logic-encoding programme that runs on a dedicated virtual machine embedded in a blockchain or other distributed ledger.

Step 1: Business teams work with developers to specify the smart contract’s desired behaviour in response to specific events or circumstances.

Step 2: Simple events include things like payment authorization, package receipt, and utility metre reading thresholds.

Step 3: More complex actions, such as determining the value of a derivative financial instrument or releasing an insurance payout automatically, may be encoded using more advanced logic.

Step 4: The logic is then created and tested using a smart contract development tool. Following the completion of the application, it is sent to a different team for security testing.

Step 5: A company that specialises in vetting smart contract security or an internal expert could be used.

Step 6: Once the contract has been authorised, it is deployed on an existing blockchain or equivalent distributed ledger infrastructure.

Step 7: Once deployed, the smart contract is set up to listen for event updates from an “oracle,” which is essentially a cryptographically secure streaming data source.

Step 8: The smart contract executes after it has the required combination of events from one or more oracles.

LIMITATIONS OF SMART CONTRACT

  • Smart contracts can’t get information about “real-world” events since they can’t send HTTP queries. This is on purpose.
  • Using third-party data could endanger consensus, which is necessary for security and decentralisation.

BENEFITS OF SMART CONTRACTS

  1. Transparency and trust:- There is no need to be concerned about information being tampered with for personal gain because there is no third party engaged and encrypted transaction records are disseminated among participants.
  2. Security:- Blockchain transaction records are particularly difficult to attack since they are encrypted. Furthermore, because each record on a distributed ledger is linked to the entries before and after it, hackers would have to alter the entire chain in order to change a single record.
  3. Savings:- Smart contracts reduce the need for middlemen in transactions, as well as the associated time delays and costs.

Sign up to discover human stories that deepen your understanding of the world.

Free

Distraction-free reading. No ads.

Organize your knowledge with lists and highlights.

Tell your story. Find your audience.

Membership

Read member-only stories

Support writers you read most

Earn money for your writing

Listen to audio narrations

Read offline with the Medium app

--

--

Nirmitee
Nirmitee

Written by Nirmitee

Understand Business | Deliver Technology

No responses yet

Write a response