Greetings amazing people!
In today’s blog, we will be breaking down smart contracts, from their history, and composition to their working. Everything you need to know as a beginner trying to understand smart contracts.
Intro
To understand smart contracts you need to first understand what a blockchain is (check out one of my previous blogs on blog chain for more information on it ).In short think of it as multiple blocks that store
data and a hash (for each block). The blocks are connected so that the hash of a certain block depends on the previous block.
This “BlockChain “ acts as a public ledger of transactions that occur on a particular network. The idiosyncratic part of the blockchain is that it is decentralized hence a lot of issues that arise due to middlemen are eliminated.
Breaking it Down
Smart Contracts is one of the most utilised applications of the blockchain. According to google, the concept of smart contract was first introduced in 1994 by Nick Szabo (who was a cryptographer). In simple terms smart contract is a contract( composed of a code[Solidity in terms of Ethereum network]) that can be converted to code and run within a blockchain. Ethereum is the most used network/platform used for deploying smart contracts. Like I mentioned above its code is concealed within a contract, This code checks if a condition of the contract is met or not(if statement…..if condition ‘a’ is met then action ‘A’ is performed . eg if crypto is transferred then send money to this address), If the condition is satisfied then can exchange crypto(any asset) or perform a function within the network.
Source
When we all create accounts on meta mask, We can perform transactions on a particular chain using that account. A smart account is an entity (account) that can be automatically executed based on the predetermined rules are in the contract. Smart contacts are used in places where we need the consent of a few parties……usually in a crypto lottery( to choose a random no. once all the crypto is locked),nfts minting, games, etc. This makes the entire process much more trustworthy.
Composition
Finally, before we break down the smart contract completely let’s understand, what a transaction is? Transaction on a chain has 4 main components
Source
A smart contract is similar to a transaction but it is controlled by a code as mentioned above. The components of the smart contract are :
Also, there’s one major difference between a smart contract and a transaction. The transaction with the same account can be made on multiple networks but a smart contract can only be used on one network once it’s deployed.
Hope you learned something new from this blog. Lemme know your thoughts on this topic in the comments :^)