What are smart contracts and how do they work? (2021)

Contents

Advice

  • Los contratos inteligentes son contratos expresados ??como un fragmento de código diseñado para llevar adelante un conjunto de instrucciones.
  • The term “smart contract” was created in the decade of 1990, in an academic post created by Nick Szabo.
  • The Dapps, or decentralized applications, they are essentially a series of linked smart contracts.

We are all familiar with apps and app stores. Looking for, download the application you want and leave.

Behind the pretty UX and UI interfaces, these applications perform a specific set of instructions established by their creator. It can be a game, a calendar or a way to buy goods and services.

Smart contracts serve a very equivalent function.

A smart contract is a contract, expressed as a code snippet, which is designed to carry out a set of instructions.

The only difference is that with smart contracts there are no intermediaries. There is no person or company that has your information or verifies it. The Blockchain blockchain [/ definition] verifies and maintains a record for you.

Vitalik Buterin y la community Ethereum they believe this is the future of blockchain. And Bitcoin is the gold of the business world, smart contracts are the oil that the business world works on.

How does a smart contract work?

Then, you want to buy a car online without a smart contract. For this you need:

  • ? A listing site to keep information on all the cars you would like to see
  • ? A way to communicate with sellers
  • ? A payment system that enables you to exchange money once you have found your car
  • ? Any chance to get a money back if the car turns out to be a failure
  • ???? You must also register the change of ownership of the car with the authorities

Each of these points requires you to trust the site or service you are accessing and, habitually, each part of that procedure is controlled by a different company or individual.

It wouldn't take much for a crafty person or organization to change any of the above, canceling the entire procedure.

A smart contract eliminates the need to trust so many people in the purchasing procedure.

Why? Smart contracts are:

  • ? Sure: use cryptography to prevent people from tampering with records.
  • ? Transparent: everyone can see on the blockchain what the smart contract is and what it is used for.
  • ? No third parties: Smart contracts don't need a middleman to verify them. The blockchain does it for you.
  • ? Independent: they work automatically, so you don't have to wait for someone to press a button.
  • ? Precision: how smart contracts are written in code, do not depend on the gray areas of a language and the meaning of words.

If this happens, do the following (Yes this, So that)

At the heart of a smart contract there is usually a mechanism that says (in computer code) “if this happens, hazlo”.

These already exist today. Suppose you want to pay for something with a credit or debit card. Your bank's computer program will use “if this happens, Do this” in the next way:

  • ?If the amount in the bank account is greater than the requested amount, release funds.
  • ???? ?If the amount in the bank account is less than the requested amount, do not release the funds.

The difference with smart contracts is that, instead of a bank (or any third party) control that decision, this falls on the blockchain.

Then, taking the example above and applying it to a smart contract built on a blockchain, I would see the following:

  • ?If the amount in the digital wallet is greater and has not been spent, release funds.
  • ???? ?If the amount in the digital wallet is less, or has already been spent, do not release the funds.

The most interesting thing about smart contracts is that anyone can reach an agreement with anyone else, and the blockchain keeps a record of all this.

Inside a smart contract

In the same way as regular contracts, smart contracts are designed to enforce the terms of an agreement, either a crypto exchange, tokenized rights, proof of identity or almost anything else.

Smart contracts will be executed automatically when predefined conditions are met. The operation of a smart contract can be briefly described with three main terms:

  • ? Interconnectivity: each smart contract generally has a restricted set of functions. Multiple smart contracts can be configured to connect with each other and form more complex agreements known as decentralized applications (dapps) .
  • ? Objects: They are the signatories that interact with the smart contract and the / the subjects / I know what it is / are modified by the smart contract based on predefined or recently submitted terms.
  • ? Environment: the smart contracts depend on an underlying crypto environment. This ensures that they can operate safely and that the data on which they act is immutable and, usually, transparent.

On most blockchains, the code behind smart contracts is immutable, even though several blockchains also support updatable smart contracts.

Who created the smart contracts?

Like the blockchain technology used to power most cryptos, smart contracts were derived from earlier technologies that were not entirely complete. In the case of smart contracts, are derived from earlier electronic instruction execution programs that used if statements / else and other conditional logic to automatically produce a result based on the information presented to it.

The term “smart contract” was created in the decade of 1990 in a academic article created by Nick Szabo, a prominent computer scientist and cryptographer who was also responsible for the development of one of the first precursors of Bitcoin, known as Bit Gold. At first, Szabo described smart contracts for a number of basic purposes, how to reduce fraud and enforce contractual agreements, but later he delved into the possible use cases of technology for digital money, smart property and others. in a document of 1996 .

Ethereum implemented a full Turing language on its blockchain, enabling complex and sophisticated logic in your smart contracts.

How do smart contracts use dapps?

The Dapps, or decentralized applications, can be considered as a group of linked smart contracts.

A smart contract can only be used for one type of transaction. Despite this, an app can bundle multiple smart contracts together to do more sophisticated things.

A dapp can also put a friendly interface on top of contracts, just like applications do today.

Some notable dapps

  • ? Augur: a tool that enables anyone to speculate on derivatives
  • ? MakerDAO: a decentralized financial dapp (DeFi) that enables users to lend and borrow with crypto without the need for an intermediary.
  • ? Uniswap : an exchange platform based on Ethereum that makes it possible for anyone to exchange tokens ERC20 .
  • ? CryptoKitties: Unique collectible cryptos supported by NFT that can be “collect” through smart contracts.
  • ? Money: an Ethereum wallet that uses smart contracts to abstract concepts like addresses and private keys.

Who uses smart contracts?

Smart contracts are a relatively new technology, but they have already been widely implemented, especially in pure crypto projects.

Smart contracts are at the heart of all decentralized finance revolution (DeFi) and are used to power popular DeFi protocols such as Compound , Aave , Uniswap and hundreds more.

But they have also been adopted by a wide range of companies, and some governments have even started experimenting with smart contracts. Some of the most prominent examples are:

  • ? Ubisoft: Gaming giant Ubisoft has embraced blockchain in a big way; Among his many blockchain initiatives, has created specially designed smart contracts that enable users to own, transfer and claim non-fungible tokens (NFT) rare basados ??en su popular franquicia de juegos Rabbids.
  • ? ING: The Dutch bank ING has co-created Fnality , a blockchain-based trade settlement system using smart contracts. It also participates in other blockchain initiatives.
  • ?? The swedish government : the government of Sweden has tested a blockchain-based land registry to prove ownership of the land, which is based on smart contracts.

Smart contracts aren't always perfect

Even though smart contracts are generally considered a form “without confidence” to enforce agreements and logic, they are not without problems.

On one side, smart contracts are immutable in many blockchains. This means that, once published, they cannot be changed or updated, which can have disastrous consequences if there are underlying problems in the code. The best example of this is the Ethereum DAO hack from 2016, in which an unknown hacker diverted millions of ether (ETH) by exploiting a loophole in the DAO split function.

Often, furthermore, new and unknown attack vectors can be exploited, which often leads to loss of money for investors. This was seen in September 2020, with the crash of the trial version of Eminence, a project by Andre Cronje from Yearn Finance. Was exploited by $ 15 million by an unknown hacker after a large number of investors shoved their money into it.

In the same way, a simple faulty code can render the smart contract effectively useless. This was seen with the collapse in August 2020 of the DeFi performance project known as YAM, that used unaudited smart contracts and was thwarted by a critical error that rendered its governance function useless.

Smart contract audit

Even though smart contracts are protected by their underlying blockchain technology, they must also be safe by design, since certain functions or bugs in your code can be exploited.

This has happened multiple times in the past and remains one of the biggest challenges for further adoption.. Total, Hundreds of millions of dollars in unsecured smart contract assets have been stolen, including the aforementioned Eminence hack and an April hack 2020 in which they were stolen 25 million dollars from dForce.

A report from November 2020 from blockchain research firm CipherTrace found that around $ 10 millions per month are extracted only from DeFi projects.

To help minimize the risk of this, various third-party security and development companies, What Mythx and ConsenSys Diligence (ConsenSys funds a editor Decrypt independent ), now offer smart contract auditing services. This involves examining the smart contract code to identify any vulnerabilities., that can be corrected. This usually happens before a smart contract is made public..

Popular dapps often make their smart contract audit public in the footer of their web portal, giving confidence to users who don't have the time or expertise to verify their code themselves.

The 10 top smart contract platforms by market capitalization

Smart contract platforms have become one of the most important sectors in crypto. Of the 10 major cryptographic assets by market capitalization (according to Data of Messari ), three are smart contract platforms, and one of them, Ethereum, ranks second after Bitcoin itself.

Between them, the 10 major smart contract platforms have a combined market capitalization of more than $ 176 billion at the time of writing this post. Is it so:

  • Ethereum: Ethereum is designed to function as a “world computer” decentralized, which can be used as a platform on which dapps can be run.
  • Cardano: Cardano is an open source public blockchain project. Its main feature is that it claims to be the world's first peer-reviewed blockchain, with a network of academics and scientists who review its protocols before publishing them.
  • Polkadot: Created by Ethereum Co-Founder, Gavin Wood, Polkadot is a “multi-chain network” designed to link blockchain networks.
  • EOS: Aimed at commercial users, EOS is designed to fix common blockchain related problems, like speed and scalability.
  • TRON: A “decentralized virtual machine”, Tron was originally designed as an entertainment and social media platform, and now has the noble goal of propping up a decentralized internet.
  • NO: the platform is NOT, abbreviation for New Economy Movement, is designed to offer companies a more efficient way to verify and move assets on the blockchain.
  • Tezos: Ethereum's competitor, Tezos, was designed from the ground up as a proof-of-stake blockchain, with chain governance; Coin owners can vote on proposals to make changes to how the Tezos blockchain works.
  • VeChain: VeChain is designed to drive and simplify supply chain management, helping companies remove fraud in the manufacturing and delivery process.
  • NEO: Often nicknamed “Chinese Ethereum”, NEO se difference from Ethereum in that it has no transaction fees; it is also faster and supports approximately 10.000 transactions per second.
  • Cosmos: Cosmos it's a “Blockchain Internet”, a network of blockchain networks designed to communicate seamlessly with each other over the protocol of communication between blockchains.

The future of smart contracts

Currently, most blockchains have smart contract functions, with active communities of developers creating dapps using smart contracts on blockchains like Cosmos, NEO and Hyperledger. The scope of the capabilities of smart contracts can range from something very simple to something like Bitcoin or Litecoin., up to something more advanced on dapp-capable blockchains like Ethereum, Tron y Polkadot.

We are still in the early days of what smart contracts and dapps can be used for. But there are companies and even governments that are already experimenting with its potential. They are currently used for a wide variety of tasks, as digital identities, supply chain management, insurance, data storage and much more .

Subscribe to our Newsletter

We will not send you SPAM mail. We hate it as much as you.