Crypto unchained

Chapter 4

Chapter 4: From Wallets to Smart Contracts

Chapter 4:

From Wallets to Smart Contracts

An Architecture of Digital Ownership

Users have two tools at their disposal to interact on a blockchain: wallets and smart contracts.

Wallets

A wallet, in essence, is like a bank account. It has three defining characteristics:

  • an address
  • a private key
  • a balance

These correspond to the following:

  • a bank account number
  • a credit card PIN code
  • the amount of money stored in the account.

The private key simultaneously proves the ownership of a given native currency and can be used to sign off on new transactions.

Wallet

Bank Account

Address

Account Number (Iban)

Balance

Balance

Private Key

Pin Code

Smart contracts

Loosely speaking, a smart contract can be seen as a very generalized wallet. The three defining elements (address, private key and balance) are redesigned to allow for a more general use going beyond simple peer-to-peer payments. The address locates where the smart contract is positioned on the blockchain. The private key is completely re-invented to allow for alternative access modalities. Rather than limiting access to just one user, multiple users can interact with it as long as they follow a given protocol. Finally, the balance has been extended to contain all kinds of digital content (pictures, sound, documents, etc.)

While a wallet can be compared to a bank account, a smart contract is comparable to a vending machine. The idea is simple: an automated agreement that executes when conditions are met.

Wallet

Smart Contract

Address

Address

Balance

Content

Private Key

Governance code

Example of smart contracts

Here are two scenarios explaining how a smart contract works in practice:

Selling a picture

Via a smart contract

Play the audio to understand the graph

Betting on a game

Via a smart contract

Play the audio to understand the graph

Note:

The node executing the smart contract collects “gas fees”. These fees correspond to the computation effort required for the execution of the smart contract. They can be paid by either Alice or Bob, depending on their agreement in the contract.

What are Blockchain Oracles?

Blockchain oracles link “off-chain” information “on-chain” so that smart contracts have the necessary information. In case of a bet on a sports event, the smart contracts tap into the oracle to obtain the score of the game.

As such, the smart contract is a powerful tool which greatly enriches the possibilities of peer-to-peer interactions. Previously, users were primarily limited to exchanging funds. With smart contracts, a full-fledged framework for peer-to-peer interactions becomes possible.

The power of smart contracts has led to the emergence of a whole new subcategory of crypto-assets: distributed applications. They are sometimes described as the next evolution of blockchain technology.

Chapter 5:

The rise of DApps

While we are familiar with the concepts of Apps on our smartphones, only few are aware of the existence of Distributed Applications (Dapps) in the crypto-asset ecosystem.

Read chapter 5