Friday, 20 April 2018

Smart Contracts Explained: Unleashing The Power Of The Blockchain

Smart contracts connect the blockchain to the real world. They allow you to open your front door, turn on your washing machine, charge your electric vehicle, or send funds abroad — all without lifting a finger.
On a bigger scale they could secure voting, update medical records, and speed up supply chains. They’re the key to decentralization, and a trustless mechanism for transacting almost any kind of business through the blockchain, including altcoin trades.

But what exactly are smart contracts?

Well, the term “smart contract” is a bit of a misnomer. First coined in 1996 by Nick Szabo, computer scientist and cryptographer, he defined a smart contract as:

“… a set of promises, specified in digital form, including protocols within which the parties perform on these promises.”
In other words, a smart contract is a piece of code on the blockchain that performs an action once certain criteria are met. You can think of it as “if this, then that” logic, though certain blockchains, such as Ethereum, allow much more complex programming. Once the action is done, it’s added to the blockchain as a permanent record.

While smart contracts are extremely useful, there’s nothing particularly “smart” about them. There are no fancy machine learning algorithms, for example. In fact, smart contracts work best in constrained circumstances, where the code is less prone to unexpected outcomes or bugs — after all, once the action is performed it can’t be undone.

Neither are they “contracts” in the traditional sense. There’s no legal bearing other than what’s written into the code, and no legal precedent. Either the conditions for the code to run are met and the action performed, or nothing happens at all.

So what’s so special about them?

Because smart contracts exist on the blockchain, you can program code that self-executes without the need for third parties. For example, if Alice wanted to send Bob 5 BTC every time her wallet balance reaches 10 BTC, a smart contract could perform that action (using atomic swaps, for example) without Alice needing to go through a centralized exchange.

The same principle applies to real word interactions. Industries like logistics, finance, insurance, and Internet-of-Things can all be run on smart contracts without needing intermediaries. This saves a ton of time, effort, and money. And since humans aren’t required to facilitate transactions, smart contracts eliminate user error and fraud.

How are they used today?

The most famous example of smart contracts are on the Ethereum blockchain. Vitalik Buterin, Ethereum’s creator, designed Ethereum with smart contracts in mind. Anyone can create a smart contract using the Ethereum Virtual Machine (EVM) — a programming environment for writing smart contract code — and have it execute on the blockchain.

One of the more common uses so far is the ERC20 token: a tradeable proxy for an underlying asset, such as currency, in-game credits, gold, or pretty much anything perceived to have value. Instead of having its own blockchain (like Bitcoin or Litecoin), an ERC20 token is just a smart contract on the Ethereum network. Example tokens include EOS, Golem, Tron, Qtum, Binance, 0x, Salt, Qash, Ethos, Funfair, Bancor, Gnosis, Storj, Civic, Aragon, AirSwap, Monaco, and there are hundreds more.

Bitcoin’s smart contract support, on the other hand, is fairly limited. Multi-sig transactions are smart contracts on Bitcoin that require several parties to sign a transaction before it’s executed on the blockchain. While this is undeniably useful, more complex stuff is harder to do. Unlike Ethereum, Bitcoin code isn’t “Turing-complete”. Without getting too technical, this restricts the complexity of the algorithms Bitcoin can perform. Smart contract support is growing with Bitcoin Improvement Proposals (BIPs), but Ethereum is the preferred choice of most programmers.

What is the future for smart contracts?

For all their many uses, smart contracts aren’t infallible. On Ethereum, there’s a cost to running smart contracts called “gas”. Gas is simply the price paid to Ethereum for transacting on their network. So the more complex the smart contract, the more gas you need, and the more expensive it is to run.

Also, Ethereum’s consensus — the process in which it applies changes to its blockchain — is based on “proof-of-work”. This means every node on the network has to process the smart contract code to validate it on the blockchain, causing congestion in the same way mining does on bitcoin (and uses a ton of energy in the process).

Switching to a “proof-of-stake” mechanism would speed things up. Again, without getting too technical, the result of a proof-of-stake mechanism is that fewer nodes have to process the code. That means it’s much faster, making smart contracts easier to scale (with a much smaller draw on energy resources).

How is Altcoin.io using smart contracts?

At Altcoin.io, smart contracts are helping us build a decentralized exchange that provides trustless trading for the cryptocurrency community.

By harnessing atomic swap technology within smart contracts, we’re enabling on-chain peer-to-peer trades without any middlemen. As payment channels advance, our ultimate goal is to also enable off-chain transactions which would provide near instant atomic swaps over the Lightning Network (Bitcoin blockchain) or the Raiden Network (Ethereum blockchain).

Crucially, using smart contracts means you don’t have to give us anything. Your private keys stay private, known only to you. Our first atomic swap wallet has already garnered thousands of users who can trade altcoins safely and directly from their wallets, without ever losing control of their coins.

Altcoin.io Team

Creamcoin Marketcap