Let’s Talk: Ethereum Smart Contracts
By: Sameer Dewan
Tags: Blockchain, Solidity, Ethereum, JavaScript, Programming

Into the possibilities smart contracts offer the world and how software engineers can prepare to launch powerful, ground-breaking startups utilizing this technology

Let’s rewind to 2017: Bitcoin is running wild, Ethereum has broken above $1,000 dollars, and tokens deployed on Ethereum during the now infamous ICO offerings are making millionaires everywhere.

Just kidding. Let’s fast forward. This isn’t a price speculation article. We’re engineers — for the most part, we don’t care about internet tokens (unless they’ve made us rich or are making us rich).

The purpose of this article is to discuss the technology known as smart contracts. While Bitcoin is the pioneer DLT (distributed ledger technology) we all know, it does not offer us the capacity to execute complicated, real world smart contracts, and those that it can foster are costly. We’re here to talk about Ethereum based smart contracts. This article is geared towards software engineers without a background in the blockchain space.

What is a smart contract? First, let’s talk Bitcoin.

In the case of Bitcoin, the distributed ledger act as a great, big Excel spreadsheet (tremendously minimized explanation). I pay you, you pay me. Money in, money out. We distribute the task of maintaining this immutable spreadsheet record across nodes who are incentivized to maintain these records through “mining”. Eureka! We have solved the double-spend problem and centralized fiat currency inflation.

Smart contracts are a bit different. Instead of just maintaining records for a payment network using DLT, Ethereum lets us deploy tamper-proof, decentralized financial applications and computer code. Ethereum (the token) is simply what you pay miners to deploy and spend in fees to interact with these decentralized applications.

Okay, cool story, bro.

You probably don’t care, and I didn’t either, for a while. To really come to appreciate what this means, let’s use Uber as an example of a “what if” Ethereum based spin-off utilizing an oracle network, Chainlink.

In the above diagram, we examine Uber — a closed, centralized network for connecting passengers to drivers. To participate in the network, a driver must apply to Uber, at which point they are approved or denied. A passenger requests a ride, receives a quote from Uber, accepts the quote, pre-pays Uber for the ride, and is connected to a driver who will pick the passenger up. Upon successful trip, the Uber network will relinquish a portion of the money quoted by Uber to the driver, keeping the remainder for itself.

Awesome! We all use Uber, and we love it. But is there a better way?

Why can’t the driver set the price they’d like to accept? Better yet, why can’t drivers begin bidding on a ride request as they come in near by, and the end user have the option to weigh reviews of the driver + price in their decision?

Ride sharing commissions have been reported to range between 25% — 43% of total ride cost. This is a massive network participation fee. This fee touches the end user and the driver themselves.

Let’s flip this model on its head. We’ll get into the technicals of how later.

In this scenario, there are only two parties — the drivers and the passenger. The smart contract is just a piece of code deployed to the Ethereum blockchain which the two parties are interacting with, most likely, without even realizing it’s blockchain technology they’re using. The oracle network is a third party decentralized network our contract utilizes to get API data from off-chain into the blockchain. We pay an oracle network a service fee for the resilient, aggregated data provided. In this case, the data we are retrieving is user location data.

The driver gets the majority of the ride share fee. The only network fee collected is the tiny gas fee from the Ethereum Network itself, and the cost of running the smart contract (paying the oracle data services).

We’ve just given ownership back to the driver and passenger.

Okay, cool story again bro, but this isn’t realistic.

What about making sure the ride is fulfilled in a timely manner? What about passenger security? What about insurance? What about refunds? I don’t want my user to pay in Ethereum, or drivers to be paid in Ethereum

Answers:

Oracle networks can ensure this (see Chainlink) If the passenger has not reported a safe passage within “x” time limit, oracle networks can reach out to local authorities with all details of both passenger and driver Etherisc Kleros On the fly currency swapping using Uniswap

If you’ve started asking yourself these questions, you’re on the right track to understanding why this is the tech area where you need to be now. There’s a reason this model hasn’t overtaken ride sharing apps already.

We are currently in a place that these technologies are like the early internet.

No, not that internet. I’m talking about ARPANET early internet. Gas fees are too high, decentralized insurance protocols haven’t reached vehicles yet, off-chain retrieval and validation of credentials aren’t sophisticated enough yet.

These missing decentralized protocol utilities are being developed as you read this for use in smart contracts.

The big “if” you need to ask yourself is “if this infrastructure is built, will I be ready to jump in at the forefront of the dApp revolution?”.

I think the next generation of game-changing startups are going to come in the form of dApps. Infrastructure is a work in progress, but it’s growing daily.

Closing Thoughts

Does this article seem like a bait and tease?

Don’t be so sure about that. If you are ready and knowledgeable about the capabilities of this technology when it nears maturity, you will be in the same position the early innovators of the web were in nearly twenty years ago. You’ll already know about writing in Solidity and utilizing oracle networks. Minimizing gas costs for your end user. You’ll build the next game changing application.

An application built on Ethereum that has really solidified my belief that the space is becoming more mature is Aave. It’s production ready and you can use it today.

TLDR;

LEARN ABOUT ETHEREUM

LEARN AND PRACTICE WRITING SOLIDITY

USE TRUFFLE SUITE

LEARN HOW TO USE CHAINLINK

DEPLOY ON TEST NET FOR FREE!

This is your chance to be at the forefront of a revolution as an innovator of next generation applications. You could wait, say, ten more years before jumping in and just working at a company that is built on this tech stack, or you could prepare today and be the person who builds it.