Smart contract (what is a smart contract on Bitcoin or Ethereum blockchain)

In simple terms, Smart Contract is a program code, a software application.

Smart contracts are the same as dApps (decentralized applications).

The only significant difference from the other type of program code written, for example, in Python programming language, is that in case with smart contract it is hosted on blockchain.

Since all data and logic on blockchain is decentralized, these applications called smart contracts are also decentralized. They are copied across all nodes in the network and every node therefore knows what the outcome of the execution of such application will be.

Smart contracts usually operate tokens/coins and data transactions. For example, you could set up a crowdfunding smart contract where once certain amount of funding is provided by investors into the crypto wallet of the contract, all investors will receive certain tokens in proportion to their investment.

How Smart contract works:

  1. Creation:
    • Users write code to create a smart contract, defining its rules and actions.
  2. Deployment:
    • The smart contract code is deployed onto the blockchain.
  3. Transaction Initiation:
    • Users initiate transactions that involve the smart contract.
  4. Verification and Execution:
    • Nodes on the blockchain verify and execute the smart contract if conditions are met.
  5. Recording on Blockchain:
    • Results are recorded on the blockchain as a new block.
  6. Decentralized Trust:
    • The decentralized nature of the blockchain ensures trust, immutability, and transparent execution of the smart contract.
how smart contracts work