How Ethereum Smart Contracts Work? 7 Things You Need To Know [Simply Explained]

  • by

It’s 2020 — even those who don’t know about blockchain probably know about Ethereum. Ethereum is the second-largest cryptocurrency with over 25 billion dollars in huge market value. To fully understand Ethereum, one should understand correctly what an intelligent contract is.

Ethereum is not only a currency; it is also a platform for other blockchain applications. The Ethereum network uses an Ether currency to pay for transactions.

The Ethereum blockchain operates like the Bitcoin blockchain; a computer network (or nodes) run software that verifies network transactions.

Ether functions like gasoline rather than a standard cryptocurrency. Just as you need fuel or diesel for your engine, you need Ether to power the Ethereum blockchain smart contracts and applications.

I want you to remember everything because it will help you understand one of the Ethereum blockchain’s main products. This product is called a smart contract and many cryptocurrencies now use it. Despite Ethereum’s increasing popularity, the question is:’ What is a smart contract? has only recently become one of the most frequently asked questions in the crypto space.

Yeah, what’s a smart contract? Okay, let’s look deeper…

The purpose of this guide is to help you understand what a smart contract is and how smart contracts work.

I understand that “smart contracts” may at first seem confusing. But once I describe it, you will know it’s simpler than you think.

At the end of this clarified Smart Contract Tutorial, you will never have to google again “What’s a smart contract.” You can understand how and why smart contracts began, the code they use, how they can be used and why they can ever change society!

It is important to talk about the past of smart contracts before we get into the most technical subject. Understanding why and how smart contracts were produced makes it easier to understand their purpose in the world of blockchain.

When were Smart Contracts Invented?

In 1994, Nick Szabo (a cryptographer) invented the idea that contracts could be documented as computer code. When certain conditions are met, this contract would be triggered automatically. This idea could eliminate the need for trusted third-party companies (such as banks).

But why? But why? The answer is simple— because when you make a transaction you no longer need a trustworthy third party. Rather, the contracts (or transactions) are performed on a trusted network, which is completely computer-controlled.

Cool idea, right? Cool idea? Szabo had been working on this idea for years and even wrote a book called Smart Contracts: Digital Free Market Building Blocks. The problem was that blockchain technology did not exist back in 1994.

But now it does!

In 2009, Bitcoin launched blockchain technology for the first time. In 2015, Ethereum was created and the first intelligent contracts were released by an intelligent young man named Vitalik Buterin.

What Is a Smart Contract?

I just don’t want to show you what smart contracts are, I want you to know what they are, too. I outlined three key points to do so, which you should read and try to remember what a smart contract is:

https://i.imgur.com/upfVlvM.jpg A smart contract is a computer code agreement between two individuals. They are running on the blockchain, so they are stored and not updated in a public database.
https://i.imgur.com/Wfkrjz7.jpg Transactions that take place in a smart blockchain contract, meaning that they can be sent without a third party.
https://i.imgur.com/7pIyE6T.jpg The transactions only occur once the terms of the agreement are fulfilled — no third party exists, so there are no trust issues.

How Does a Smart Contract Work?

Okay, then, how do smart contracts work?

To find the answer, let’s start by looking at how to use a smart contract: imagine John wants to buy Mike’s home. This agreement is built using a smart contract on the Ethereum blockchain. This smart contract includes an agreement between John and Mike.

The deal will be as plain as that:’ If John pays Mike 300 Ether, then John will be taken over by the house.’

Once this smart contract has been concluded, it can not be changed— John will feel safe paying Mike 300 Ether for his home.

Without this case, Mike and John would have to pay other payments to third parties without the use of a smart contract. The bank, a lawyer and a house broker are included.

It’s amazing, right? No more fees or delays to wait for a lawyer and broker to process the deal! This is just one example of how a smart contract can be used.

Smart contracts are carried out automatically once the terms of the agreement are fulfilled. This means that a third party, such as a bank, a broker or a government, is not required.

How can this be done?

As mentioned before, we have to thank the blockchain. Thanks to blockchain technology, we can decentralize smart contracts to be equal and untrustworthy. By decentralizing, I mean not being dominated by one central party (such as a bank, broker, government, etc.).

The blockchain is a growing database run by many computers (called nodes) of many people. Because of this, it is not owned by a single person or company.

It means it is almost impossible to hack it–if the hacker wanted to attack the blockchain or the smart contracts it was expected to access more than half of the nodes. Smart contracts can, therefore, run securely and automatically without anybody modifying them! Now you know more about what an intelligent touch is!

Ultimately, we can be secure when we pay deposits for goods or services— there is no trust involved.

What are Smart Contracts Currently Being Used For?

As I said earlier, the house sale of Mike & John is not the only case in which smart contracts can be used. For any type of transaction, smart contacts can be utilized— it doesn’t have to be financial.

The possibilities for smart contracts are infinite. These are used already for financial services, insurance, credit authorization, legal proceedings and even crowdfunding agreements (ICOs).

Let us look at how smart contracts will benefit certain industries now and how other industries will gain in the future…

Insurance Companies

In 2017, Atlas Insurance in Malta and Axa in France two insurance companies tested smart contracts. They had prototypes that compensated customers of airlines by delaying their flights.

See an example: John is about to fly to Los Angeles from NYC. He sends $5 of cryptocurrency to a smart contract with Axa Insurance and offers his flight number. Axa is sending $95 to the smart contract. There is also $100 in the smart contract.

When John’s flight is scheduled, the smart contract would give Axa $100. But if the plane is late, $100 will be sent from the smart contract to John. It’s all automatic.

It saves time and money. It also ensures that John does not need to assume that AXA will pay him the agreed price when his flight is late, as he knows that if it is late, the wise offer will give him his fee ($100) immediately.

Health Systems

Smart contracts are used by health systems to store and securely transfer data.

https://i.imgur.com/bqMoGth.png

We can see examples of smart contracts that Encrypgen wants to use in the medical industry. This is an application that uses intelligent contracts to safely transfer patient data without access from third parties.

The patients monitor their data in this way. When scientists want to use patient data, they have to pay for it. Not only that, but the patient must decide to sell it to them or not.

Governments

To governments, smart contracts that operate on the blockchain will make voting processes completely transparent and much safer.

https://i.imgur.com/iz2qu8D.png

Smart contracts and blockchain technology are used by applications such as FollowMyVote to defend votes from fraud. The voting transaction can not be changed when it is submitted to the blockchain. Once the vote is over, the smart contract must give a token to an address representing the voting winner.

This way, voting is always equal, which always means that the winner is right.

Business Management

Companies may benefit heavily from smart contracts. They can use smart contracts instead of charging staff to run payrolls.

Corporations can only enter into a smart contract, which says WHEN 28.03.18 is the date, sends John 2 ETH to the company. It means that John is always paid on time and never underpaid. The company benefits because everything is automated, saving them plenty of time and money!

ICOs

If you want to begin your blockchain project, you can create your project, as we have seen before, on the Ethereum blockchain. But you’re going to need some money!

How will you get the money you need? Welcome to ICOs… an ICO (Initial Coin Offering) is a modern crowdfunding framework for blockchain applications. You create a smart contract and a token for this smart contract. Imagine calling your token ABC.

To start your project and create your application, collect $10,000,000—imagine that $10,000,000 is equivalent to 10,000 Ether. You agree that you will add 100,000 ABC tokens to the smart contract and that every ABC tokens will be worth 0.1 Ether.

In this way, you will have the 10,000 Ether you need when you sell all 100,000 ABC tokens due to 100,000x 0.1= 10,000.

Now in the smart contract, you are going to write: if 0.1 ETH is sent to the smart contract, 1 ABC is then sent to the address that sends the 0.1 ETH. A smart contract is sent. Therefore, the people who participate in the ICO also obtain the correct token of ABC.

Why would people like to purchase the ABC token?

The two main reasons for purchasing tokens from ICOs are:

  • Once it’s created, the token can be used on the application.
  • When the project becomes more popular, the price of the token will increase.

You can think of ICOs as Kickstarter’s blockchain version. The main difference is that it automatically safely and efficiently automates the entire crowd sales process.

How are Smart Contracts Created?

Smart contracts, like Ethereum and NEO, can be built on various blockchain platforms. Since Ethereum is the most popular choice for developers, I will tell you about the smart contracts of Ethereum. (The best choice is why you are always told about the words ‘ Ethereum Smart Contract’ or’ Ethereum Contract’ emerging on a crypto scene.) Smart contracts are built using the original Ethereum code, known as Solidity.

What is Solidity?

Today, most skilled programmers use one or more popular modern languages. Some of these examples include C (and C++, C #, etc.), Python, Java (and JavaScript), Perl, or some others. For programmers that already know one or more modern programming languages, solidity was designed to be easy to learn.

If in high school you have studied something like Visual Basic, you may have a hard time getting Solidity. Whether you learn a language like Python or C, Solidity is relatively familiar to you.

Solidity uses a wide range of programming principles in other languages. Solidity has for example variables, functions, classes, arithmetic operations, string manipulation, etc. While a programmer will construct a type of a’ main function,’ like’ int main(arg1, arg2){ /code}’ in a language such as C, Solidity will be creating a’ contract’ in the same way.

https://i.imgur.com/MMhF7Dt.jpg

Solidity code, as you can see, looks surprisingly like C++, C # or JavaScript. Python developers will note that variables have to be declared explicitly in their form in Solidity among other differences.

How Smart Contracts Will Change the World?

It’s happening now. From the examples I have provided you can see that smart contracts already start replacing middlemen. We have also seen the potential for future applications–recall the house sales of John and Mike? They didn’t need a property officer, a lawyer or a bank, did they?

So, if smart contracts serve their intent, that one day we will live in a world free of middlemen.

So what is going to happen?

The best thing about not getting middlemen is that we save a lot of money. Not only that, but we don’t have to believe anyone anymore.

Nonetheless, there is also a potential downside: people can lose their jobs. Middleman, like you and me, is real people. Why would anyone pay an employee to do a job that can be done free of charge using a smart contract? They wouldn’t. They wouldn’t.

Nobody knows what the future holds. All we can do is predict and plan, but we have to be prepared for all possible results.

As you can see, smart contracts will make the world a better place without payment. It can minimize fraud, delays and a great deal of overall cost. But as we advance technology further, we reduce the need for such jobs. Now that you’ve read this guide, please answer the golden question’ what is a smart contract?’.

Smart Contracts are Awesome!

Here you can find the smart contracts:

Autonomy–you are the person who makes the contract; you must not rely on a broker, lawyer or other intermediaries to confirm. However, this also removes the risk of third party interference, since execution is automatically controlled by a network instead of one or more people, possibly biased, who may be incorrect.

Trust–The records are encrypted in a shared directory. There is no way someone could say they lost it.

Backup–Just imagine that your bank has lost your account savings. Every one of your friends has their back on the blockchain. Your records are many times duplicated.

Security–cryptography, website encryption, keep your records safe. No hacking. No hacking. In reality, an abnormally intelligent hacker would have to crack the code and infiltrate.

Speed–You will normally have to spend some time and paperwork processing documents manually. Smart contracts use software code to automate tasks and thus shorten hours of business processes.

Savings–Smart contracts save you money as an agent is kicked out. You would have to pay a notary for your transaction, for example.

Accuracy–Automated contracts are not just faster and cheaper, they often eliminate mistakes from filling in heaps of forms manually.

What do you think of smart contracts? Let us know! Let us know!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.