In this session, we shall understand how and why smart contracts came into existence.
The very first version of blockchain was a state machine. It was just like an accounting ledger, where it held only the state of the node. Then came the thought that since all these nodes are within a computer network, why can't we have a code, associated with these nodes, which can run on its own based on predefined logic. This is how smart contracts emerged.
To explain the reason of existence of on-chain smart contracts, let us take an example of two different schools. The schools will have different uniforms, different timings, different books and different rules and each school would want their students to adhere to its rules only, not the other’s.
Extending the same analogy to a blockchain, each chain would want its nodes to adhere to the norms set on that particular network and all nodes in that network to be holding the same logic.
In on-chain smart contracts, any external data that is required for the smart contract will be fetched by agents called oracles. Oracles are external agents which connect the smart contract to the external world.
In the last video, we discussed smart contracts and oracles. There was a major shortcoming with the discussed concept: the smart contracts had to be deployed on each node of the network. Let’s see what Shebin has to say about the same.
Evolution of smart contracts happened because:
The only connection between the network and the outside world was oracles, and sometimes, the oracles could get corrupted or hacked.
To avoid the sacrifice of confidentiality, a separate layer to hold the business logic of smart contracts was envisioned because of the demand from enterprises and was called cryptlets.
Like APIs in a three-layer network architecture, there are cryptlets fabric which serve the same purpose in a computer network. Cryptlets are of two types:
There are several developments around IDEs and UI tools for development of smart contracts and these developments promise that blockchains are set to evolve to a better state as we go ahead.
After having gone through the segment, you may refer to the following links to consolidate your understanding on: