Well, in reality it is not a contract and it is not intelligent, it is a code that establishes a series of conditions that must be met to enable benefits for any of the parties.
The smart contracts are proposed in 1996 by Nick Szabo, a computer, a lawyer and scientist cryptographer closely linked to Bitcoin. His proposal seeks to offer a tool that allows formalizing agreements between parties for computer network environments such as the internet.
These smart contracts would be applications that run within a blockchain. They are made up of a series of digital agreements that must be complied with and which are based on specific rules. The rules are established in a computer code that will be distributed throughout the network.
Smart contracts allow two unknown parties to establish a series of commitments through a blockchain without the need for a trusted third party. If the conditions are not met by the parties, the contract will not be settled. It is a much simpler process, without the need for trusted third parties, that is not limited by borders and that reduces costs and time of incorporation.
How A Smart Contract Works
They are programs that have a deterministic purpose, running continuously until the established conditions are met. Normally, smart contracts are usually based on certain conditions that allow progress to be made until they are fulfilled. A simple example would be video games, in which you must complete some actions to go to the next level and so on until you complete it.
Smart contracts require a blockchain where they can be stored and executed, since they are really fragments of code. In Ethereum, smart contracts execute and manage operations that occur when addresses (users) interact with each other.
All addresses (of users) in a blockchain that are not a smart contract are called externally owned accounts (EOA). What EOAs do is control the computer code that establishes the conditions and characteristics of smart contracts.
A smart contract in any blockchain is based on a code that determines actions and a set of public keys. At least two public keys must be given, that of the creator of the smart contract and that of the contract itself, which acts as a unique identifier.
An execution of the same is then carried out through a transaction in the chosen
blockchain technology. The smart contract will only be executed when called by an EOA or by other smart contracts.
Characteristics Of Smart Contracts
They feature the following set of unique features:
- Distributed: Any smart contract is replicated and distributed by all the nodes connected to the network. Everyone is guaranteed to have a copy of the established conditions and they cannot be changed at will by one of the parties.
- Deterministic: They can only perform actions for which they have been designed, but only when the given conditions are met. The end result will never vary, no matter who executes it.
- Autonomous: They have the ability to automate any type of task, working as a program with auto-executables. Normally, if a smart contract does not receive an activation, it will remain on hold and do nothing.
- Immutable: When they are released to the network they can no longer be modified. Once deployed they can only be removed, as long as this particular function has been implemented previously.
- Customizable: They have the ability to adjust the code before being launched to do what we want. They can be used for the creation of different types of decentralized applications (DApps).
- Trustless: These are not required by trusted third parties to verify the integrity of the process and that the marked conditions are met. In addition, blockchain technology is worthy of the accuracy of the data.
- Transparent: They are always stored on a public blockchain, so the code can be seen by everyone, whether or not they are participants in the smart contract.
A Smart Contract Can Be Deleted
The reality is that smart contracts have the ability to be eliminated, if so programmed. Within the
Ethereum blockchain, smart contracts can add a function in the code that is: SELF-DESTRUCT. This implementation in code allows you to delete the smart contract in the future if an error is detected or replace it with a new one. If this element is not added, the smart contract can never be deleted.
A Smart Contract Can Not Be Modified
Once the smart contract is launched, it cannot be modified. Usually, what is done is that a smart contract makes calls to other smart contracts with certain functions. This allows us to delete a specific smart contract (if we have enabled the delete option) and replace it with a new, more complete or improved one.
What Can We Create With A Smart Contract?
The limit of the capabilities of a smart contract is set by people's capacity for imagination and the ability of a programmers to create the code.
Bitcoin presents some difficulties in terms of the creation and deployment of smart contracts that will be corrected with Taproot, to a large extent. Ethereum allows the creation, deployment and execution without technical limits thanks to its full Turing-type EMV, which roughly functions as a large decentralized computer.
Within Bitcoin, the most common implementations are Colors Coins, a kind of tokens with more limited features and capabilities than in Ethereum.
Ethereum, on the other hand, allows you to create very rich smart contracts that allow you to do a huge number of things. You can create autonomous decentralized organizations (DAO),
decentralized applications (DApps), fungible and non-fungible tokens, decentralized finance applications (DeFi) , decentralized exchanges (DEX) and everything we can imagine.