Technical perspectives of an ICO on the Ethereum platform

44
TECHNICAL PERSPECTIVES OF AN ICO 28/11/2017 STEVE DEGOSSERIE, CEO MI8 Shutterstock

Transcript of Technical perspectives of an ICO on the Ethereum platform

Page 1: Technical perspectives of an ICO on the Ethereum platform

TECHNICAL PERSPECTIVES OF AN ICO28/11/2017

STEVE DEGOSSERIE, CEO MI8

Shutterstock

Page 2: Technical perspectives of an ICO on the Ethereum platform

MISSION-CRITICAL APPS, BOTS & SMART CONTRACTSDEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

We build end-to-end digital solutions to boost your business’ operations.

Steve Degosserie, CEO mi8 SPRL

▸ 18 years in Software industry (McKinsey Solutions, Zetes, Fluxys)

▸ MSc in Digital Currency & Blockchain technology, University of Nicosia (Cyprus)

▸ Currently working on a token sale for the Stampify project

Clients we serve

Page 3: Technical perspectives of an ICO on the Ethereum platform

The world has a fundamental problem with corporate governance

Almost everywhere in the world, the fundamental principles of corporate governance — the way business organizations are created, run and liquidated — are a remainder of a pre-technology era, deeply misaligned with today’s world.

Page 4: Technical perspectives of an ICO on the Ethereum platform

INTRODUCING STAMPIFY

Stampify paves the way to the business of tomorrow, by providing entrepreneurs, startups and companies with new-generation corporate governance tools. Stampify's mission is to build a frictionless business world where connected organisations work together with transparency, flexibility and trust. To do that, Stampify takes the most out of advanced

technology, including distributed ledgers.

Page 5: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

LET’S MINT TOGETHER : DEVDAY TOKEN

Page 6: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

AGENDA▸ Bitcoin, mother of Blockchains

▸ Ethereum & Smart Contracts

▸ Decentralised Apps : towards Web 3.0

▸ Crypto-economics & Mechanism Design

▸ Cryptocurrencies, Utility Tokens & the ERC20 standard

▸ ICOs : the Good, the Bad and the Ugly

▸ Token dev toolbelt : Truffle, OpenZeppelin & Parity

▸ Let’s mint together : DEVDAY token

Page 7: Technical perspectives of an ICO on the Ethereum platform

BITCOIN, MOTHER OF BLOCKCHAINSBitcoin is a private, decentralized, digital cryptocurrency

▸ Private: not issued by a sovereignty

▸ Decentralized: no issuing party; units are issued algorithmically

▸ Digital: Fully electronic; with no underlying peg to assets

▸ Cryptocurrency: Anti-counterfeiting though cryptography

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

Page 8: Technical perspectives of an ICO on the Ethereum platform

BITCOIN, MOTHER OF BLOCKCHAINSDEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

▸ October 2008: Satoshi Nakamoto’s Bitcoin design paper

▸ January 2009: Genesis block; Bitcoin becomes operational

▸ October 2009: $1 = 1,300 BTC

▸ February 2011: $1 = 1 BTC

▸ April 2013: 1 BTC = $100

▸ December 2013: 1 BTC = $1000

▸ October 2017: 1 BTC = ~$6000

▸ November 2017 : 1 BTC = ~$10000

Page 9: Technical perspectives of an ICO on the Ethereum platform

WHAT IS A “BLOCKCHAIN” ?DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

Under the hood of Bitcoin, is the Blockchain, or Distributed Ledger

Technology (DLT)

“An incorruptible digital ledger of economic transactions that can be

programmed to record not just financial transactions but virtually

everything of value.”

Source: CapGemini, Blockchain: Opportunities and Challenges across Multiple Industries [https://www.capgemini.com/resources/blockchain-opportunities-and-challenges-across-multiple-industries/]

Page 10: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

WHAT IS A “BLOCKCHAIN” ?blockchain technologyA look at

Potential applications

The blockchain is a decentralized ledger of all transactions across a peer-to-peer network. Using this technology, participants can confirm transactions without the need for a central certifying authority. Potential applications include fund transfers, settling trades, voting, and many other uses.

Cryptocurrency is a medium of exchange, created and stored electronically in the blockchain, using encryption techniques to control the creation of monetary units and to verify the transfer of funds. Bitcoin is the best known example.

Has no intrinsic value in that it is not redeemable for another commodity, such as gold.

Has no physical form and exists only in the network.

Its supply is not determined by a central bank and the network is completely decentralized.

Someone requests a transaction.

The transaction is complete.

A verified transaction can involve cryptocurrency, contracts, records, or other information.

The new block is then added to the existing blockchain, in a way that is permanent and unalterable.

The requested transaction is broadcast to a P2P network consisting of computers, known as nodes.

What is it?

How it works:

Increased transparency

Accurate tracking

Permanent ledger

Cost reduction

Complex technology

Regulatory implications

Implementation challenges

Competing platforms

Automotive

Faster, cheaper settlements could shave billions of dollars from transaction costs while improving transparency.

Financial services

Using a blockchain code, constituents could cast votes via smartphone, tablet or computer, resulting in immediately verifiable results.

Voting

Patients' encrypted health information could be shared with multiple providers without the risk of privacy breaches.

Healthcare

The network of nodes validates the transaction and the user's status using known algorithms.

Validation

Consumers could use the blockchain to manage fractional ownership in autonomous cars.

Once verified, the transaction is combined with other transactions to create a new block of data for the ledger.

"Money is no object: Understanding the evolving cryptocurrency market," PwC, 2015"A Strategist's Guide to Blockchain," strategy+business, January, 2016"How Blockchain Technology Is Disrupting Everything," TechDay, 2016

Sources:© 2016 PwC. All rights reserved. PwC refers to the US member firm or one of its subsidiaries or affiliates, and may sometimes refer to the PwC network. Each member firm is a separate legal entity. Please see www.pwc.com/structure for further details. This content is for general information purposes only, and should not be used as a substitute for consultation with professional advisors.

Source: PwC, Making sense of Bitcoin, Cryptocurrency, and Blockchain [https://www.pwc.com/us/en/financial-services/fintech/bitcoin-blockchain-cryptocurrency.html]

Page 11: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

ETHEREUM & SMART CONTRACTS

Ethereum is a decentralized applications platform whereas Bitcoin is (mostly) a decentralized payment system.

▸ Bitcoin: BiTCoin cryptocurrency, store of value, deflationary, simple scripting language , small / slow blocks, PoW consensus, conservative evolution.

▸ Ethereum: ETHer in-app currency, eternal inflation, EVM runtime environment, Turing-complete programming language, dynamic block sizes, PoW but upcoming PoS consensus, substantial innovations in the pipeline.

Page 12: Technical perspectives of an ICO on the Ethereum platform

ETHEREUM & SMART CONTRACTSDEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

Source: Diagram by codebrahma.com

“A Smart Contract is the automated execution of an agreement.” (code)

Smart Contracts are tiny pieces of software code that execute

autonomously on the Blockchain.

Contracts are made between humans. Smart Contracts are running

agreements between humans, apps & devices.

Page 13: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

DECENTRALISED APPS : TOWARDS WEB 3.0▸ Web 1.0 : Static pages, client-server, e-commerce

▸ Web 2.0 : Social web, clouds (third-party servers)

▸ Web 3.0 : Peer-to-peer web, serverless, “Post-Snowden”

Ethereum’s protocols for Web 3.0: ETH + BZZ + SHH + P2P

‣ ETH : blockchain activities (tx, blocks, code)

‣ BZZ (Swarm) : decentralized (incentivized) storage

‣ SHH (Whisper) : inter-node secure & private messaging

‣ P2P : networking layer interconnecting nodes

Page 14: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

CRYPTO-ECONOMICS & MECHANISM DESIGN

Game theory is the study of how and why people make decisions. Or more specifically, the study of mathematical models of conflict and cooperation (= games) between intelligent rational decision-makers.

It has a wide array of applications in economics, politics, political science and sociology, as well as logic, computer science and biology.

Importance of game theory in economics: 11 “game-theorists” have now won the Economics Nobel Prize.

Source: Cryptoeconomics In Context - https://hackernoon.com/cryptoeconomics-in-context-6435ad6839be; Vitalik Buterin, The Cryptoeconomics Way - https://www.youtube.com/watch?v=lYGOMGqz9zE

Page 15: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

CRYPTO-ECONOMICS & MECHANISM DESIGN

Mechanism Design is also known as reverse game theory.

It’s a field in economics and game theory that takes an engineering approach to designing economic mechanisms or incentives, toward desired objectives, in strategic settings, where players act rationally.

The game designer:

‣ chooses the game structure rather than inheriting one

‣ is interested in the game's outcome

Source: Cryptoeconomics In Context - https://hackernoon.com/cryptoeconomics-in-context-6435ad6839be; Vitalik Buterin, The Cryptoeconomics Way - https://www.youtube.com/watch?v=lYGOMGqz9zE

Page 16: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

CRYPTO-ECONOMICS & MECHANISM DESIGN

What makes Bitcoin (and other blockchains) special is not a specific technology, it’s the concept of Cryptoeconomics, that is, using Cryptography AND Economic Incentives to achieve information security goals.

▸ Cryptography can prove properties about messages that happened in the past

▸ Economic incentives defined inside a system can encourage desired properties to hold into the future.

Source: Cryptoeconomics In Context - https://hackernoon.com/cryptoeconomics-in-context-6435ad6839be; Vitalik Buterin, The Cryptoeconomics Way - https://www.youtube.com/watch?v=lYGOMGqz9zE

Page 17: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

CRYPTO-ECONOMICS & MECHANISM DESIGN

When building a system, using Cryptography and Mechanism Design, a Blockchain Developer must carefully:

‣ Apply crypto wherever needed to ensure the basic building blocks of the system will be trustworthy (digital signatures), and tamper-resistant (hashes, encryption).

‣ Decide what are the desired properties of the system (= outcomes) that will hold true in the future

‣ Design the right economic incentives / disincentives so that the desired properties will effectively hold true well into the future.

Source: Cryptoeconomics In Context - https://hackernoon.com/cryptoeconomics-in-context-6435ad6839be; Vitalik Buterin, The Cryptoeconomics Way - https://www.youtube.com/watch?v=lYGOMGqz9zE

Page 18: Technical perspectives of an ICO on the Ethereum platform

USE ECONOMIC INCENTIVES TO REWARD PARTICIPANTS WHO FURTHER THE SYSTEM’S OBJECTIVES, AND PENALIZE THOSE WHO HARM IT.

V. Buterin, Ethereum co-founder

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

Page 19: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

CRYPTO-ECONOMICS & MECHANISM DESIGN

So, whether building a Blockchain platform, or an app on top of an existing Blockchain, it is important to carefully design the economic incentives for the various actors of the system:

‣ Miners

‣ Resource Providers (compute / storage / etc)

‣ Investors

‣ Community (developers)

‣ End-users (or the service / product)

Source: Cryptoeconomics In Context - https://hackernoon.com/cryptoeconomics-in-context-6435ad6839be; Vitalik Buterin, The Cryptoeconomics Way - https://www.youtube.com/watch?v=lYGOMGqz9zE

Page 20: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

ICOS : THE GOOD, THE BAD AND THE UGLY

What’s an Initial Coin Offering (ICO) ?

‣ Process of openly raising funds (crowdfunding sale), typically via cryptocurrencies, by issuing a Utility Token at a certain price, with the promise to investors that raised funds will be used for developing a product or service, whose business model, and related business / technology information, is described within a document shared publicly (= whitepaper).

‣ It’s like an IPO, but with Digital Coins …

Page 21: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

ICOS : THE GOOD

▸ Simpler & faster way of raising money (compared to tradition Initial Public Offerings process, w/ heavy due diligence process, costly third parties involved, or Venture Capitalist rounds)

▸ Global scale -> “The world is a village”

▸ Fully transparent: whitepaper, team composition, code for contracts of Token & Sale are usually published in advance

▸ Purely algorithmic, relatively simple to setup (in days / weeks max)

▸ Gnosis: $12M in 10 min; Brave $35M in 30 sec; Filecoin $200M in 60 min (totally $257M)

Page 22: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

ICOS : THE BAD

▸ Risky capital with no guarantee of ROI

▸ Future Promise: investor must assess business model potential, team experience & ability to deliver, technology readiness, market size

▸ So many ICOs: “good” projects have trouble getting exposure

▸ Few regulations, or vary from country to country, ranging from permissive, to gray-zone, to entirely forbidden / banned

▸ Token sometimes assimilated to securities, assets —> Taxes, VAT

▸ Complex whitelisting procedures required: KYC=Know Your Customer, AML=Anti-Money Laundering, CTF=Counter Terrorist Financing, PEP=Politically Exposed Persons

Page 23: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

ICOS : THE UGLY

▸ Still complex from a technical perspective for a non tech-savvy person (actually, even for tech person !)

▸ Loss of millions of USD due to security vulnerabilities in Smart Contracts: tricky aspects of the Solidity language, insecure third-party libraries / contracts, hacks

▸ Any tricks to get exposure in medias / social networks is used

▸ Very lucrative : social network influencers monetizing access to their followers

▸ 1 tweet or post can be worth several Bitcoins !

▸ Nothing really prevents the team behind the project to disappear with the funds raised …

Page 24: Technical perspectives of an ICO on the Ethereum platform

ICO : GET RICH OR DIE TRYIN'

50 Cent (~= 0.00005 BTC = 5000 Satoshi)

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

Page 25: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

CRYPTOCURRENCIES, UTILITY TOKENS & THE ERC20 STANDARD

▸ Cryptocurrency: digital currencies minted (or mined) using encryption protocols that securely regulate unit production and monitor exchanges/transfer of funds.

▸ Utility Token: Utility tokens (or user tokens / app coins), represent future access to a company’s product or service. If not designed as investments and properly structured, they are exempt from federal laws governing securities.

▸ /!\ Carefully design your token so it’s not considered as a tokenized security, subject to SEC regulations (Howey Test)

Page 26: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

TOKEN DEV TOOLBELT : TRUFFLE

The “Ethereum Swiss Army Knife”

▸ Built-in Smart Contract compilation, linking, deployment and binary management

▸ Automated Contract testing for rapid development

▸ Scriptable deployment & migrations framework

▸ Network management for deploying to both public & private networks

▸ GitHub: https://github.com/trufflesuite/truffle

▸ NPM: truffle

Page 27: Technical perspectives of an ICO on the Ethereum platform

Demo: bootstrap a Truffle project

We’ll start from the metacoin box

‣ npm -g install truffle

‣ truffle unbox metacoin

‣ truffle compile

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

TOKEN DEV TOOLBELT : TRUFFLE

Page 28: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

TOKEN DEV TOOLBELT : TRUFFLE

build\contracts: compilation artifacts

contracts: Solidity contracts

migrations: Deployment scripts

test: Tests written in JS/ or Solidity

truffle.js: Truffle’s config file

Page 29: Technical perspectives of an ICO on the Ethereum platform

truffle test

‣ compiles contracts

‣ deploys to built-in TestRPC

‣ executes tests in an isolated manner

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

TOKEN DEV TOOLBELT : TRUFFLE

Page 30: Technical perspectives of an ICO on the Ethereum platform

truffle develop : integrated dev console

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

TOKEN DEV TOOLBELT : TRUFFLE

Page 31: Technical perspectives of an ICO on the Ethereum platform

truffle(develop)> deploy

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

TOKEN DEV TOOLBELT : TRUFFLE

Page 32: Technical perspectives of an ICO on the Ethereum platform

Interact with your deployed contract …

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

TOKEN DEV TOOLBELT : TRUFFLE

Page 33: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

TOKEN DEV TOOLBELT : OPENZEPPELIN

Open Framework of reusable and secure smart contracts.

▸ Focused on security, modular approach, open source.

▸ Reduce the risk of vulnerabilities in your applications by using standard, tested & community-reviewed code.

▸ GitHub: https://github.com/OpenZeppelin/zeppelin-solidity

▸ NPM: zeppelin-solidity

Page 34: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

TOKEN DEV TOOLBELT : OPENZEPPELIN

Demo: create a simple ERC20 token

‣ Create new smart contract that inherits from BasicToken

‣ Define name, symbol, decimals & initial supply

‣ Write more advanced tests

‣ Deploy token using Truffle deploy

‣ Interact with token using Truffle develop

Page 35: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

TOKEN DEV TOOLBELT : OPENZEPPELIN

Page 36: Technical perspectives of an ICO on the Ethereum platform

Test suite

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

TOKEN DEV TOOLBELT : OPENZEPPELIN

Page 37: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

TOKEN DEV TOOLBELT : PARITY

Full-node client by Parity Technologies

▸ Fast & secure, cross-platform, reliable

▸ Written in Rust programming language

▸ Built-in web-based Wallet & Dapp environment

▸ Register & interact with your smart contracts

▸ Can also be used for private or consortium deployments (PoA consensus)

Page 38: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

TOKEN DEV TOOLBELT : PARITYDemo: deploy simple ERC20 token to Parity node

‣ Deploy token using Truffle deploy

‣ Interact with token using with Parity web UI

Page 39: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

LET’S MINT TOGETHER : DEVDAY TOKEN

Designing a real-world ERC20 token & crowdsale involves making a lot of business & technical design decisions:

‣ Token: total supply, symbol, decimals but also, issuance model, burning or not, retained qty for founders / business ops, vesting schemes, pegging to fiat currency, dual tokens

‣ Crowdsale: start / end time, sale periods, goal, cap, emergency stop, allow refund if goal not reached, gamification (bug bounties, deals), fiat / crypto supported for payments, …

Page 40: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

LET’S MINT TOGETHER : DEVDAY TOKEN

Open Zeppelin contains base contracts for tokens:

▸ StandardToken: full-featured ERC20-compliant token

▸ MintableToken: token can be minted (e.g. when purchased)

▸ BurnableToken: burn function (decrease total supply)

▸ PausableToken: pause token transfers (e.g. during sale)

▸ TokenTimelock: lock tokens during a period of time (vesting)

Page 41: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

LET’S MINT TOGETHER : DEVDAY TOKEN

Open Zeppelin contains base contracts for crowdsales:

▸ Crowdsale: fixed-duration & rate, wallet for raised Ether

▸ CappedCrowdsale: max amount of tokens for sale (cap), sale can end prematurely if cap is reached before end time

▸ RefundableCrowdsale: minmim amount of tokens to be sold (goal), investors are refunded if goal not reached

▸ FinalizableCrowdsale: custom finalization logic at the end of the sale (e.g. burn unsold tokens, mint a reserve qty, etc)

Page 42: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

LET’S MINT TOGETHER : DEVDAY TOKEN

Demo: create a DevDayToken contract

‣ Tokens should be ‘minted’ when an investor buys tokens

‣ name: DevDay Token

‣ symbol: DEVDAY

‣ decimals: 18 (same as ETH)

‣ initial supply: 0 (token minted when purchased)

Page 43: Technical perspectives of an ICO on the Ethereum platform

DEVDAY17 - TECHNICAL PERSPECTIVES OF AN ICO

LET’S MINT TOGETHER : DEVDAY TOKEN

Demo: create a DevDay Token sale contract

‣ Creates and owns Token contract

‣ Cap: 10 ETH, Rate: 500

Page 44: Technical perspectives of an ICO on the Ethereum platform

THANK YOU !

MISSION-CRITICAL APPS, BOTS & SMART CONTRACTS

QUESTIONS ?