Smart Contracts
Imagine that.
I have a
house.
I need to
sell a house.
It is a
complicated and challenging process,
which
entails a lot of paperwork,
communication with different firms and people as well as a high level of
various risks.
That is why
the absolute majority of house sellers decide to find
an estate agent,
who deals with all the paperwork, markets the property and acts as an
intermediary when the negotiations begin, overseeing the deal until it’s
closed.
Smart contracts
·
use blockchain technology to verify, validate, capture and enforce agreed-upon terms between multiple
parties.
·
on the blockchain allow for transactions and agreements
to be carried out among anonymous (unname) parties
without the need for a central entity, external enforcement, or legal system.
What is a Contract?
·
Before deeply understanding the smart contracts, let’s remember the meaning of the term ‘contract’. A
contract is a legally enforceable agreement between two or more parties.
·
The execution of a traditional
contract requires human validation to check the terms and conditions and decide
the next steps according to the written agreement. Therefore, a traditional
contract can be:
The more
complex the contract is, the more it requires control and the more there is a
risk of disputes. For example, this can involve several execution steps that
enable specific actions or that give rise to certain privileges.
·
There is
another way to deal with a contract in a way that it overcomes these challenges
and limitations mentioned previously.
·
As technology
evolves, the way we deal with contracts evolve, and the smart contract is born.
·
However, what are
smart contract?
·
So,
what makes smart contracts so smart? Aside from the customizability and the digital signatures attached,
smart contracts are smart because of their self-executing nature. In the legal
paper world, when a contract is signed, the two parties are accountable to fulfil
the terms of the agreement on their own.
·
Smart contracts are translations of an agreement, including terms and conditions
into a computational code (script).
·
Blockchain
developers write the script in a programming language like Java, C++, etc. in a way that it is void of ambiguity and does not lead to
misinterpretation. The code translates a set of rules that are automatically
executed and validated. A straightforward example is a translation of: “if X
provides the service, Y pays for it.”
Smart contracts' code is uploaded into the
blockchain to check the validity of a contract and enable required steps. From
its initialization, a smart contract is automatically executed. The main
difference between a smart contract and a traditional contract is that a smart
contract doesn’t rely on a third party; cryptographic
code enforces it.
We can consider a vending machine that is
implementing a smart contract mechanically. It verifies the following
properties:
Difference Between
Contract vs Smart
Contracts
|
Contract |
Smart
Contracts |
|
Paper
version of documents |
Virtual
document |
|
Based
on law and legislation |
Based
on the code |
|
Legal
language |
Computer
language |
|
Terms
of the contract can be changed, rewritten or
interpreted differently |
Terms
of the contract cannot be changed as it is encoded in the blockchain |
|
The
help of a notary, a lawyer and appeals to public services |
Excluding
the intervention of third parties |
|
Not
Anonymous, personal meeting of two parties required |
Anonymous,
without personal presence |
|
Transactions
are conducted in currency through banks |
Conducted
using cryptocurrency |
|
Exchange
of values occurs instantly |
The
exchange of values occurs with delays |
|
There
are no guarantees. Any law can be circumvented |
Guaranteed
security of the transaction |
|
Communication
discrepancy |
Conflict-free |
|
You can
change the conditions |
All
conditions are strictly followed |
|
The
probability of fraud, bribery, bribery is very high |
Scam
and fraud excluded |
|
Legal
assistance is needed to draw up a regular contract |
The
smart contract is quite difficult to make yourself |
To better understand how smart contracts work,
let us first understand about blockchain.
The
blockchain is a concept like a book in which we record information.
·
The goals of the paper are to bring certification and secure
digital documents using timestamps.
·
Time stamping is done in a way that it is impossible to change
the date in a given document.
·
Therefore, it is easier to define which documents come first.
·
One document that appears with a timestamp older than another
document is created first.
This approach exploits the immutable
nature of timestamps.
·
This first proposition has evolved and technology, such as
blockchain, has appeared and permitted the refinement of the first proposition.
·
In the approach used by blockchain technology, documents are
linked together in a block to form a chain.
·
The blockchain is a linked data structure using hash pointers.
·
Consequently, blockchain characteristics and technologies
inherit hash functions' and hash pointers' characteristics.
These characteristics are:
These characteristics are essential since they ensure that:
When dealing with a transaction,
security is a must. The hash function used by blockchain technology ensures this
security.
·
Since blockchain is a linked data structure, it contains data
and a hash pointer that points to the previous data.
·
Typically, transactions are linked to each other. Every
transaction that has ever happened is recorded in the blockchain and is
published.
Now that after understanding that
transactions are recorded to form a blockchain, the next
question is what is the relation between blockchain technology and a smart
contract?
A smart contract is defined and
executed inside a distributed blockchain. Every transaction and contract
execution must happen inside the blockchain. There are a few steps to enable
this smart contract execution:
Execution of a contract is run in a peer-to-peer way, which is very close to decentralization. Simple users connected to
the Internet can often be clients. They have to
install the client on the computer. We refer to this principle as mining. The
computers used to run the program are called nodes.
Typically, everyone can create a
contract and upload this contract in a specific transaction on the blockchain.
Depending on the technology used, a specific virtual machine executes the code.
Ethereum smart contracts, for instance, are executed on an Etherum
virtual machine. The contract is funded, and, like in
a traditional payment method, some APIs are made available to expose the
contract so that it is enabled to perform transactions automatically, according
to a specific agreement.
How does Smart Contracts work?
Smart
contracts are based on blockchain technology the decentralized system of which
allows users to manage transactions, transfer information, and material value
without banks and intermediaries. Smart contracts follow only the instructions
given to them. Between the nodes of the platform, the contract is distributed
and copied multiple times. The contract is performed in accordance with the
contract terms after the trigger happens. The program checks the implementation
of the commitments automatically.
Pros:
1. agent neutrality;
2. automation, time-saving:
excludes human participation in transactions, everything is done by the
prescribed program code;
3. safety: data in the decentralized registry cannot
be lost and cyber attacked;
4. precision: no mistakes can be made due to the
absence of hand-filled forms;
5. standardization: a variety of smart contract types,
the possibility to choose change according to needs.
Cons:
1. Difficult to make corrections, it may bring
mistakes into the system and make it less safe.
2. Human factor: perfectly and precisely code is
needed.
3. Implementation costs: experienced coder not much cheap;
4. Uncertain legal status:
5. The new role of agents: programmers will need
consultations for making new kinds of contracts.
6. Non-changeable terms encoded in the blockchain.
Most common use of
smart contracts is the simple transfer of cryptocurrency assets.
1.
Healthcare (transfer or access to the health record, Medical Research,
Track Health);
2.
Media (royalty payments to the artists following the criteria set in the
contract);
3.
Public Sector (Public information can be sent to the parties asking for
them);
4.
Cross-Industry (Product Provenance, Person-to-Person Transaction,
Voting).
Smart contracts offer significant potential across the insurance
sector, in speeding up and streamlining the claims process. A simple example
could be in the case of life insurance. The policy terms would be encoded into
the smart contract. In the event of a passing, the notarized death certificate
would be provided as the input trigger for the smart contract to release the
payment to the named beneficiaries.
This can be extended across different types of insurance, providing
that the insurer can find a suitable oracle for the input of external data in
the event of a claim. For example, in the case of travel disruption, an insurer
could use flight data provided by the airlines to serve as a smart contract
trigger.
The use of smart contracts is revolutionizing the supply
chain and logistics sector. By itself,
blockchain can provide a transparent and permanent record of the transit of
goods between multiple handlers. With smart contracts in play, payments can be
executed automatically upon the receipt of delivery, and inventory levels
updated automatically in real-time.
There are further benefits to be had by integrating blockchain and
smart contracts with other technologies. For example, quality checks could be
performed by artificial intelligence robots and then payments executed
according to the outcome. Internet-of-Things (IoT) enabled smart containers
could send data instructing a smart contract to hold back payment. This could
happen, for example, if temperatures weren’t
maintained throughout the transport of perishable goods, or if containers have
been opened by an unauthorized individual.
Tokenization of real-world assets may mean individual token-holders
also have particular rights. These rights can be coded
onto a smart contract. For example, if company stocks are tokenized,
shareholders have voting rights. With a smart contract, the person’s right to
vote is granted when any given ballot is opened up.
The smart contract allows them to cast their vote and records everything in a
transparent way. Thus, it allows voting from remote, relieving shareholders
from the need to be physically present or name a power of attorney.