How Smart Are Smart Contracts? — A quick, explorative look into smart contracts and the technology that makes them possible

in blockchain •  7 years ago  (edited)

The concept of smart contracts was first developed around the mid-90s by legal scholar and computer scientist Nick Szabo.  

The initial idea was to replace traditional contracts with reliable computer programs. These programs would execute as per the terms of the contract.

As a computer program cannot back out of an agreement, it was supposed to be more predictable and reliable than conventional contracts that depend entirely on human mediation.  

In a smart contract, every transaction would be implemented without the interference of a third-party or middlemen.

Simply put, a smart contract is a legal agreement in the form of a computer program that executes itself when particular conditions are met. These conditions are what all parties involved have already agreed upon. Once deployed or put into action, a smart contract cannot be interfered with.

For decades though, smart contracts remained hardly more than an intriguing hypothesis.

It was extremely difficult to write a secure, efficient program that could store the terms of an agreement, verify its outcomes and then complete the transaction without human interference.

That changed when blockchain technology was developed. 

Smart contracts on a blockchain 

A blockchain can be thought of as a database (or a distributed ledger) spread across a number of computers, all of which retain a full copy.

Each of the duplicated copies of the database are constantly synchronized and validated against each other for flaws or anomalies.  

If the information in one copy of the database does not precisely match the information in all the other copies, it is considered to be compromised and is promptly replaced by the version supported by the majority.

The cryptographic nature of the blockchain makes it possible to write code that can enforce a predefined agreement or relationship securely and instantly.  

(To understand how a blockchain works, please refer to the easy-to-follow guide by Hacker Noon titled "WTF is The Blockchain"  — Google it)

Seeing how a contract may have any amount and types of clauses and conditions, creating a smart contract would require an environment that is able to handle all possible computations without fail. This is where Ethereum comes in.

Ethereum is the second most popular blockchain platform today after Bitcoin. Unlike Bitcoin though, Ethereum implements a Turing-complete programming language, Solidity, on its blockchain. This means that it is capable of expressing all tasks that can be performed on computers.  

Moreover, Ethereum is designed for building decentralized applications that run on the blockchain, enabling rapid development, security and interactivity while eliminating third-party interference.

This allows for the creation of advanced smart contracts on the blockchain that can be made to perform the most complex of tasks.

A smart contract on a blockchain works like an executable piece of code that stores the rules for negotiating the terms of the contract, verifies outcomes to predetermined specifications and then accurately executes the agreement.

Apart from functioning as decentralized legal agreements, smart contracts can also be used for general computation on the blockchain. A smart contact can also take inputs from other smart contracts. This enables different smart contracts to work together in order to perform complex tasks.

With access to your history of transactions and available cryptocurrency balance, a smart contract can also automate transfer of funds between any two accounts on the blockchain.

In light of this, there are countless advantages to a decentralized legal agreement.

Imagine you and a stranger meet in a bar and place a bet on whether or not it would rain tomorrow. Both you and the stranger wager $10 each and entrust the bartender to hold the money till either of you wins. The bartender would then give the whole $20 to whose prediction comes true.

Although not a legal agreement, this example works just as fine as both you and the stranger are relying on a third party – the bartender – to carry out what you've agreed upon. The bartender, who knows none of you personally, may ask for a nominal fee from you both to carry out these duties. Let's say you pay $1 each to make the bartender keep his word.  

The next day, you win the bet and come to the bar to collect your money. Now there are many things that could go wrong here. The bartender may not show up at all or refuse to give you the money citing problems of his own. But let's say he gives you the money after serving his other duties. So, even in a successful transaction, you've had to trust a middleman, pay him a fee and wait for him to carry out his tasks.

That's how a conventional transaction takes place, more or less. You rely heavily on third parties and middlemen (including banks) and it costs both you and the other transacting parties (which, in a business setting, would be your customers) a little extra.  

However, with a smart contract, all you have to do is place the bet. The rest of the transaction will be not only automated but also decentralized and directly enforceable. This means that none of the parties can back out of the agreement.

The smart contract will store the rules and penalties of the agreement made between you and the stranger, which once deployed will be unalterable. It will then wait for tomorrow to analyze the outcome by receiving inputs from another smart contract that is built to check weather, validate the required conditions based on what has already been agreed upon and then transfer assets from one party to another based on whose bet turned out to be right. The assets here would be a cryptocurrency like bitcoins and ether rather than fiat money like the dollar.  

Okay but what does this mean for me? 

Smart contracts have many real-world applications. In fact, the possibilities are endless.

A smart contract can help you exchange units of value like money, property or shares securely and without mediation from middlemen or government agencies.  

Blockchain systems like Ethereum, on which smart contracts run, are undeniably faster, cheaper and much more secure that traditional systems, and operate in a transparent, dispute-free way. Smart contracts, thus, are not subject to single points of failure.

All of this makes smart contracts appealing for a number of other applications. For instance, smart contracts may be used to build a foolproof voting system that is infinitely more secure than the prevalent voting mechanism. Each voter would be able to not only cast their votes from the comfort of their homes but would also verify the outcome of the election on their own.

Smart contracts on a blockchain may also be used to streamline business operations in an organization. As Ethereum allows different smart contracts to “communicate” with each other, a separate smart contract could be written for every operational task while conditional smart contracts could be written to facilitate a reliable back-and-forth between them. This drastically reduces the amount of human error in business operations and makes them easier, cheaper and more transparent.

The ability of smart contracts to interact with each other on the blockchain also makes them usable as building blocks for decentralized applications or DApps or even entire decentralized autonomous companies or DAOs. But more on that later.

With blockchain development still emerging from the stage of infancy, it is hard to tell how more advanced platforms crop up that enable us to build even more advanced smart contracts and DApps. But whatever the future holds, it sure does seem exciting, and for now, it all seems to revolve around blockchains and smart contracts! 

If the article was of any help to you, please upvote and share it.

Follow me on Medium: @faizanrashidbhat

Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

Why is it on introduceyourself?

My bad. This is my first post. Thanks for pointing it out

Tag removed :)

Good article ... a must read... :)

Thank you :)

I hope you upvote my post as well

https://steemit.com/@rafalklimsiak

#upvoteforupvote