what are smart contracts

What Are Smart Contracts In blockchain? real world examples

Bitcoin is sort of the “first generation” of blockchain. We could call it Blockchain 1.0. Ethereum and the smart contract are pushing blockchain into the next stage: Blockchain 2.0. Smart contract is critical to applying blockchain into broader use, so let’s explore it further.

Who Invented Smart Contracts?

The computer scientist and cryptographer Nick Szabo first proposed the smart contract concept in a paper published in 1994. (It is worth noting that Szabo has been bandied about as the possible true identity of Satoshi, something he has denied.)

The smart contract created by Szabo is a computer system designed to facilitate and verify contracts between parties and people.

Smart Contracts are The Key To Ethereum

The cryptocurrency Ethereum is a decentralized platform that runs smart contracts and allows developers to build their apps on the blockchain created by Ethereum. Smart contract is key in Ethereum, since it finally allows cryptocurrencies to be used in broader business activities.

Smart contract can function in the absence of trust, because it executes terms without intervention from the parties involved. Once a smart contract is generated, it cannot be reversed.

Transactions are traceable but irreversible. A smart contract works on an “if-then” language. If A happens, then B will take place. So once a contract is set up, the terms will be executed automatically.

Real world Examples of smart contracts

Vending machine example

An example often used to help explain smart contracts is a vending machine. Everyone knows how they work. You go to a vending machine and put in a certain amount of money; in return, the machine dispenses a product.

Say a vending machine sells sodas for $.25. Bob puts a quarter into the machine, and in return, it spits out a soda. Alice puts a dollar into the same machine, and it spits back $.75 and a soda.

Not a hard concept, right?

Well, smart contract on blockchain functions similarly.

Smart contract on blockchain involves three steps:

  1. Parties involved in the contract reach a consensus and formulate a smart contract.
  2. The parties put the contract into the blockchain through a peer-to-peer network.
  3. The smart contract is put into motion once it’s accepted into the blockchain.

Renter and landlord example

Say I would like to lease my apartment to you. You, as renter, pay me an advance in Bitcoins through a blockchain. Once the transaction is done, I receive the payment. You will then get a contract and receipt.

And I, as landlord, will give you a key to enter the apartment within a certain period of time. If the key is not delivered to you on time, the blockchain will return the advance to you. If the key is delivered before the agreed date, the blockchain will temporarily hold the key until you pay the advance.

The system works on these if-then propositions, and everyone on the blockchain is able to see the contract we’ve both agreed upon. Therefore, nobody has to worry about the authenticity of the contract.

And after the rental period is over, the contract will be automatically terminated once the terms have been fulfilled.

Decentralizing the Entire Contract Market

Just as Bitcoin is decentralizing currency and business transactions, smart contract has the potential to decentralize the entire contract market.

Assets in digital format are now able to be exchanged and traded in blockchain by adopting smart contract, so all kinds of interesting trades can happen on blockchain.

Smart contract broadens the potential use of blockchain dramatically —potentially bringing in almost the entire contractual landscape. And in my opinion, it’s just getting started.

The Future of smart contracts

I’m confident that in the future, smart contracts will be put into even broader use in the financial sector. I think this for a number of reasons.

Since a smart contract is capable of self-executing contracts related to assets transfer, it, as a technology, definitely presents uses related to stock trading and other financial market trading.

Another reason for the growth of smart contracts will be the growth of the Internet of Things (IoT).

Everything around us, including smartphones, cars, wearable products, and even furniture, is going to be connected to the Internet. This will create exponential data needs. What will we use to capture and store all of these new data? Blockchain.

Another trend in smart contracts’ favor is that blockchain is cost-efficient and friendly. In traditional law firms and auditing firms, adopting blockchain and smart contracts will significantly lower the cost of doing business and improve efficiency. It will be a win-win.

ethereum simplified for beginners

Ethereum: Simplified For Beginners

Vitalik Buterin is a name you may not be familiar with, but almost everyone in computer science, blockchain, and cryptocurrency is. His white paper, “Ethereum: A Next-Generation Cryptocurrency and Decentralized Application Platform,” released in Bitcoin Magazine back in 2014, put him into the spotlight.

And at just 19 years old, he totally disrupted the existing crypto world.

What is Ethereum?

Ethereum is an open software platform based on blockchain technology that developers can use to build and deploy decentralized applications. The first generation of applications on blockchain is, admittedly, quite limited.

The blockchain Bitcoin uses merely focuses on transactions (and tracking of transactions) using Bitcoins. The use of first-generation blockchain is also very narrowly defined.

However, Ethereum is offering a public blockchain that goes beyond a peer-to-peer electronic cash system. By implementing smart contracts, the use of blockchain has the potential to expand beyond cryptocurrency.

Anything of value can now be exchanged with and through smart contracts. Agreements and exchanges of every sort can theoretically run on Ethereum.

Want to know more about smart contracts? Read this post next.

What are third parties on the Internet?

One way to understand his innovation—Ethereum—is to appreciate how it aims to replace third parties on the Internet through the use of blockchain.

They’re services like Google, Facebook, and Apple that hold our personal data, financial data, and professional data on their servers. The importance of replacing third parties is all about security.

Third parties makes it easier for hackers to hack, since everyone’s data are all in one place (or in just a few places). Also, under a third-party system, governments may be able to access your files without your knowledge.

DAPPS are built on Ethereum

Apps built using Ethereum are called DAPPs (decentralized applications).

Developers create their DAPPs using smart contracts. In keeping with the theme of decentralization, DAPPs are all decentralized and are not owned by individuals or organizations. Rather, they are owned by multiple people—specifically, everyone on blockchain.

How Ethereum Was Born

Despite these innovations, it hasn’t all been wine and roses. In the short history of Ethereum so far, it’s had several major challenges. Probably, the biggest has been the DAO.

In May of 2016, the former CCO of Ethereum, Stephan Tual, founded Slock.it, along with a few members of the Ethereum team.

In doing so, he also announced the concept of the DAO—the Decentralized Autonomous Organization.

Despite very little information about what the DAO actually was, during its Initial Coin Offering (ICO), the DAO raised an amount of Ethereum equal to $150 million from over 20,000 investors.

However, on June 17, 2016, a hacker hacked the DAO through a loophole in the system. Within just a couple of hours, the DAO lost 3.6 million ETH, the equivalent of $70 million.

The loophole facilitating this hacking did not come from Ethereum itself, but from an application on which it was built. However, the resulting mess was left to the Ethereum team and community to take care of.

Several proposals were presented to get the stolen money back.

Because transferred funds were always held in an account for twenty-eight days, the hacker couldn’t simply take the money and run.

Ethereum eventually proposed to “hardfork” the funds to an account available to the original owners. A hardfork involves making a primordial change to blockchain that can make previously invalid transactions valid, or vice versa.

But by doing so, it subverts the shared goal of decentralization that so many people involved in cryptocurrency share. Eventually, even though 10 percent of the Ethereum community voted against it, Ethereum decided to hardfork 192 million blocks in order to retrieve the stolen funds.

After this was done, a new blockchain was created called ETH (separate from the original blockchain, ETC).

There are many takeaways for the cryptocurrency and blockchain communities that come out of the DAO incident.

If you’re interested in getting granular, there are many articles on Google.

However, as Einstein is supposed to have said, a person who never made a mistake is a person who never tried anything new. Smart contracts is something new, and so is everything related to blockchain.

In my opinion, there are going to be bumps in the road—like DAO —along the way. But as long as we survive and learn from our mistakes, we shall all be stronger in the end.

Can Ethereum Be Hacked?

To answer this, I’m going to pull a quote from Ethereum.com.au:

If it is about the blockchain, the answer is no. It is not hackable. If it is about the smart contract, it depends who deploys it and if there is any exploitable flaw. If it is about the wallet, it depends on the wallet application and your security standard procedure. If it is about the exchange, it depends on the exchange’s centralized server, its API security, and your own security practice in securing your account credentials with the same exchange.