1© Copyright 2016 GBCS LLC
Introduction to Blockchain Technology and
Cryptocurrency
2© Copyright 2016 GBCS LLC
• Blockchain
• What is it?
• How it works
• Use Cases
• Cryptocurrencies
• Smart Contracts
• Ethereum
• Solidity
• Remix
Introduction
3© Copyright 2016 GBCS LLC
• Cryptographically Secure Database
• Information is permanent
• Distributed and Decentralized database
• Uncorrupted
• Transparent → Self-auditing system
Blockchain
What is it?
4© Copyright 2016 GBCS LLC
Blockchain Main features
• Governance:
• Independent or Company Owned
• Mode of operation:
• Public + Permission less: Bitcoin, Ethereum, Monero,
Dash
• Private + Permissioned: Banks, Monax, Multichain
• Type of record:
• Money, Assets, Commands, Intellectual Property…
• Smart Contract
What is it?
5© Copyright 2016 GBCS LLC
How it
works?
Blockchain
6© Copyright 2016 GBCS LLC
Combination of 3 technologiesBlockchain
How it
works?
7© Copyright 2016 GBCS LLC
Cryptography
Blockchain • Is a mathematical method of protecting information.
• Use a encryption algorithm to create a cryptography information
• You need a key to return to original message.
• Cryptocurrencies use different algorithms to cryptography
How it
works?Cryptography
8© Copyright 2016 GBCS LLC
Cryptography
Blockchain Some algorithm used in cryptocurrencies
• SHA256:
• Bitcoin, Mastercoin, Namecoin, Zetacoin, Acoin.
• Scrypt:
• Dogecoin, Litecoin, Topcoin
• Skein:
• Digibyte, Xedoscoin
• X11:
• Dash, Crevacoin, Startcoin
• X13:
• Navcoin, Networkcoin
How it
works?Cryptography
9© Copyright 2016 GBCS LLC
Cryptography
Blockchain • The use of different string results in different “hash”
• The use of different hash function results in different “hash”
How it
works?Cryptography
10© Copyright 2016 GBCS LLC
Combination of 3 technologiesBlockchain
How it
works?
11© Copyright 2016 GBCS LLC
P2P Network
Blockchain • Peer-to-peer network is one in which more than 2 PCs share
information, data or access without a central server. Is a
decentralized communication model.
• In a blockchain technology the P2P is used to share all
transactions with the participants (nodes) and there’s no central
record system.
How it
works?P2P network
12© Copyright 2016 GBCS LLC
P2P Network - Nodes
Blockchain
How it
works?
• Join Voluntarily = Decentralized + Open
• Invited to Join = Private/Permissioned
• Each participant get a full copy (download) of the entire blockchain
and store it in a personal computer (nodes)
• Node’s function: Validate and Relay Transaction = Consensus
• In Bitcoin Nodes = Miners
P2P network
13© Copyright 2016 GBCS LLC
Combination of 3 technologiesBlockchain
How it
works?
14© Copyright 2016 GBCS LLC
Game Theory
Blockchain
How it
works?
Mining = Competing to win “prize” by solving computational puzzles.
Puzzles = computational process of calculating a certain hash.
How to Achieve Distributed Consensus?
Different Algorithms
Game
Theory
Proof-of-Work: Computational intensive puzzles
• High energy cost
Proof of Stake:
• Randomized block selection or selection based on “stake” (amount
of coin owed and time).
PBFT – Practical Bizantine Fault Tolerance
DPoS – Delegated Proof-of-Stake
15© Copyright 2016 GBCS LLC
Hashrate distribution - Bitcoin
Blockchain
How it
works?Game
Theory
https://bitnodes.earn.com/nodes/live-map/
16© Copyright 2016 GBCS LLC
Blockchain
How it
works?Game
Theory
17© Copyright 2016 GBCS LLC
What is PoW?
Blockchain
How it
works?Game
Theory
Block Header – Complete
Bitcoin
https://blockchain.info/
The “fingerprint”
of the block
SHA256
(“block header”)
18© Copyright 2016 GBCS LLC
What is PoW?
Blockchain
How it
works?Game
Theory
https://bitcoin.org/en/developer-reference#constant-and-defaults
19© Copyright 2016 GBCS LLC
What is PoW?
Blockchain
How it
works?Game
Theory
https://bitcoin.org/en/developer-reference#constant-and-defaults
20© Copyright 2016 GBCS LLC
What is PoW?
Blockchain
How it
works?Game
Theory
Block Header – Incomplete
Bitcoin
https://blockchain.info/
The “fingerprint”
of the block
SHA256
(“block header”)
Need to be calculate
by the nodes
21© Copyright 2016 GBCS LLC
What is PoW?
Blockchain
How it
works?Game
Theory Using Python to
understand the PoW
22© Copyright 2016 GBCS LLC
Steps
Blockchain
How it
works?
23© Copyright 2016 GBCS LLC
Steps
Blockchain
How it
works?
24© Copyright 2016 GBCS LLC
Steps
Blockchain
How it
works?
25© Copyright 2016 GBCS LLC
Steps
Blockchain
How it
works?
26© Copyright 2016 GBCS LLC
Steps
Blockchain
How it
works?
27© Copyright 2016 GBCS LLC
Steps
Blockchain
How it
works?
28© Copyright 2016 GBCS LLC
Steps
Blockchain
How it
works?
29© Copyright 2016 GBCS LLC
• Blockchain
• What is it?
• How it works
• Use Cases
• Cryptocurrencies
• Smart Contracts
• Ethereum
• Solidity
• Remix
Introduction
30© Copyright 2016 GBCS LLC
Use Cases
Crypto-
Currencies
• Bitcoin
• First Digital Currency
• Established in Jan/03/2009 with the “genesis block”
• Independent, public, permission less
• Distributed ledgers
• Uses cryptography as a method to verify transactions and
regulate the generation of further units of bitcoin: SHA256
• Consensus: POW
• Limited amount of currency: 21 millions BTC
• See details of bitcoin blockchain: https://blockchain.info/
31© Copyright 2016 GBCS LLC
Each block contains among other informations:
• The block`s hash: that is the “fingerprint”. If you change the
information inside the block, the hash changes too;
• Timestamp (Y/M/D:h:m:s) and any other information that
you might want to use.
• The Merkle Tree: group of transactions
• The previous hash: links the actual block to the previous
block creating the “blockchain”.
Use Cases
Crypto-
Currencies
• Bitcoin
32© Copyright 2016 GBCS LLC
Use Cases
Crypto-
Currencies
• Bitcoin
• Altcoin
• Alternative Coin are alternative cryptocurrencies. Any
other than Bitcoin and can use different structures:
• other hash functions (SHA256, Scrypt, X11, NIST5…)
• use different algorithms than PoW and some can be
mined using a simple CPU
• unlimited or limited supply of currencies
• Linked to projects or business.
• Today there’s more than 1k altcoins
• For a list see: https://coinmarketcap.com/all/views/all/
33© Copyright 2016 GBCS LLC
Use Cases
Crypto-
Currencies
• Bitcoin
• Altcoin
• Token
• In software development means a authentication
signature issued by a server.
• You can use this signature for a limited time or repetitions.
• Can be issued by Government to tax payers or by a
company to supply chains.
• Main difference between altcoins and tokens: structure.
• Coins are separate currencies with their own separate
blockchain
• Tokens facilitates the creation of decentralized
applications. Represent a asset or utility (commodity,
loyalty points or even cryptocurrencies)
34© Copyright 2016 GBCS LLC
Use Cases
Crypto-
Currencies
• Bitcoin
• Altcoin
• Token
• ICO
• Initial Coin Offering is a different way of crowdfunding
projects using a new crypto-coin or crypto-token.
• The first ICO was Riple (2013) that issued tokens to fund a
new Project. After this, the token was converted to a coin
(XRP)
• Another ICO was ethereum (ETH) that created a platform to
unleashed the power of smart contracts
• Inside this platform you can create a new token (or
crypto-coin) and your own blockchain structure using
smart contracts.
35© Copyright 2016 GBCS LLC
Use Cases
Crypto-
Currencies
• Bitcoin
• Altcoin
• Token
• ICO
• Price is established by the company in the Project (White
Paper)
• ICO-token:
• Create rights to a specific Project and can have a
limited time to end
• Can be convert in a coin in future, or not!
• ICO-coin:
• limited or unlimited number of coins
• After the ICO round it finishes with the token or the coin
traded in the crypto-Market
• More about ICO: https://icostats.com/ or https://ico-
list.com/
36© Copyright 2016 GBCS LLC
Use Cases
Crypto-
Currencies
• Bitcoin
• Altcoin
• Token
• ICO
• Is the most importante part in the ICO process
• Must contain (minimal requeriments):
• Project details as timeline (calendar), cost, technology,
Market analysis, projections, use of the Technologies
talk about redemption process, risks and security
• Sale: roadmap of the ICO
• Blockchain model with details of the smart contract
• Token and coin distribution with price, total amount of
emission, share of the total Project funding by the ICO
• Team members
• White Paper
37© Copyright 2016 GBCS LLC
• Blockchain
• What is it?
• How it works
• Use Cases
• Cryptocurrencies
• Smart Contracts
• Ethereum
• Solidity
• Remix
Introduction
38© Copyright 2016 GBCS LLC
Smart
Contracts
SMART CONTRACTS
39© Copyright 2016 GBCS LLC
Smart
Contracts
• First proposed in 1994 (Nick Szabo)
• Put the terms of the agreement, penalties, tax, fee, time and
any information important inside a contract in lines of code
• Are self-executing, anonymous, don`t need central authority
and permit trusted transactions
• Can be used to automate routine process reducing transaction cost
with more security
• Can be used to facilitate transactions, eliminate intermediaries, create
a more transparent system avoiding lawyers and accountants and to
crowdfunding as ICO
40© Copyright 2016 GBCS LLC
Smart
Contracts
• Ethereum
• Decentralized platform that runs smart contracts created by
the Ethereum Foundation (Swiss nonprofit organization)
• Presale in August 2014 and that resulted in a
cryptocurrency: the ether (ETH)
• Can use the platform to issue token or crypto-coin and build a
crowdfunding (ICO) or crowdsale and selling shares in a
blockchain organization
• Use it to create a virtual organization, country, economy,
business with smart contracts
• More: https://ethereum.org/
41© Copyright 2016 GBCS LLC
Smart
Contracts
• Ethereum
• Contract-oriented language used to implement smart
contracts in the Ethereum Virtual Machine (EVM)
• EVM is the runtime environment for smart contracts.
• Use REMIX to create smart contracts without installations.
• Otherway download the file:
• https://github.com/ethereum/browser-solidity/tree/gh-pages
• To work locally you need Node.js
• For solidity details see: https://solidity.readthedocs.io/en/develop/
• For DApps examples: https://github.com/ethereum/dapp-bin
• Or: https://www.stateofthedapps.com/
• Solidity
42© Copyright 2016 GBCS LLC
Smart
Contracts
• Ethereum
• IDE – Integrated Development Environment used to create
smart contracts online
• Used to develop, debug, access properties and optimize
solidity codes in smart contracts and DApps.
• Details about remix: http://remix.readthedocs.io/en/latest/• Solidity
• Remix
43© Copyright 2016 GBCS LLC
Smart
Contracts
• Ethereum
• Solidity
• Remix
List all the
files in your
browser
44© Copyright 2016 GBCS LLC
Smart
Contracts
• Ethereum
• Solidity
• Remix
Compile
contracts if
you change it
Disable autocompilation
A list of compilation
erros and warnings
45© Copyright 2016 GBCS LLC
Smart
Contracts
• Ethereum
• Solidity
• Remix
Three environments:
• JavaScript VM
• Injected Provider
• Web3 Provider
All the accounts associated
to current environment
Gas limit used to
all transactions
Value to each
transaction
created
Used to compiled
contracts
List of pending
transactions

Blockchain Technology Powerpoint

  • 1.
    1© Copyright 2016GBCS LLC Introduction to Blockchain Technology and Cryptocurrency
  • 2.
    2© Copyright 2016GBCS LLC • Blockchain • What is it? • How it works • Use Cases • Cryptocurrencies • Smart Contracts • Ethereum • Solidity • Remix Introduction
  • 3.
    3© Copyright 2016GBCS LLC • Cryptographically Secure Database • Information is permanent • Distributed and Decentralized database • Uncorrupted • Transparent → Self-auditing system Blockchain What is it?
  • 4.
    4© Copyright 2016GBCS LLC Blockchain Main features • Governance: • Independent or Company Owned • Mode of operation: • Public + Permission less: Bitcoin, Ethereum, Monero, Dash • Private + Permissioned: Banks, Monax, Multichain • Type of record: • Money, Assets, Commands, Intellectual Property… • Smart Contract What is it?
  • 5.
    5© Copyright 2016GBCS LLC How it works? Blockchain
  • 6.
    6© Copyright 2016GBCS LLC Combination of 3 technologiesBlockchain How it works?
  • 7.
    7© Copyright 2016GBCS LLC Cryptography Blockchain • Is a mathematical method of protecting information. • Use a encryption algorithm to create a cryptography information • You need a key to return to original message. • Cryptocurrencies use different algorithms to cryptography How it works?Cryptography
  • 8.
    8© Copyright 2016GBCS LLC Cryptography Blockchain Some algorithm used in cryptocurrencies • SHA256: • Bitcoin, Mastercoin, Namecoin, Zetacoin, Acoin. • Scrypt: • Dogecoin, Litecoin, Topcoin • Skein: • Digibyte, Xedoscoin • X11: • Dash, Crevacoin, Startcoin • X13: • Navcoin, Networkcoin How it works?Cryptography
  • 9.
    9© Copyright 2016GBCS LLC Cryptography Blockchain • The use of different string results in different “hash” • The use of different hash function results in different “hash” How it works?Cryptography
  • 10.
    10© Copyright 2016GBCS LLC Combination of 3 technologiesBlockchain How it works?
  • 11.
    11© Copyright 2016GBCS LLC P2P Network Blockchain • Peer-to-peer network is one in which more than 2 PCs share information, data or access without a central server. Is a decentralized communication model. • In a blockchain technology the P2P is used to share all transactions with the participants (nodes) and there’s no central record system. How it works?P2P network
  • 12.
    12© Copyright 2016GBCS LLC P2P Network - Nodes Blockchain How it works? • Join Voluntarily = Decentralized + Open • Invited to Join = Private/Permissioned • Each participant get a full copy (download) of the entire blockchain and store it in a personal computer (nodes) • Node’s function: Validate and Relay Transaction = Consensus • In Bitcoin Nodes = Miners P2P network
  • 13.
    13© Copyright 2016GBCS LLC Combination of 3 technologiesBlockchain How it works?
  • 14.
    14© Copyright 2016GBCS LLC Game Theory Blockchain How it works? Mining = Competing to win “prize” by solving computational puzzles. Puzzles = computational process of calculating a certain hash. How to Achieve Distributed Consensus? Different Algorithms Game Theory Proof-of-Work: Computational intensive puzzles • High energy cost Proof of Stake: • Randomized block selection or selection based on “stake” (amount of coin owed and time). PBFT – Practical Bizantine Fault Tolerance DPoS – Delegated Proof-of-Stake
  • 15.
    15© Copyright 2016GBCS LLC Hashrate distribution - Bitcoin Blockchain How it works?Game Theory https://bitnodes.earn.com/nodes/live-map/
  • 16.
    16© Copyright 2016GBCS LLC Blockchain How it works?Game Theory
  • 17.
    17© Copyright 2016GBCS LLC What is PoW? Blockchain How it works?Game Theory Block Header – Complete Bitcoin https://blockchain.info/ The “fingerprint” of the block SHA256 (“block header”)
  • 18.
    18© Copyright 2016GBCS LLC What is PoW? Blockchain How it works?Game Theory https://bitcoin.org/en/developer-reference#constant-and-defaults
  • 19.
    19© Copyright 2016GBCS LLC What is PoW? Blockchain How it works?Game Theory https://bitcoin.org/en/developer-reference#constant-and-defaults
  • 20.
    20© Copyright 2016GBCS LLC What is PoW? Blockchain How it works?Game Theory Block Header – Incomplete Bitcoin https://blockchain.info/ The “fingerprint” of the block SHA256 (“block header”) Need to be calculate by the nodes
  • 21.
    21© Copyright 2016GBCS LLC What is PoW? Blockchain How it works?Game Theory Using Python to understand the PoW
  • 22.
    22© Copyright 2016GBCS LLC Steps Blockchain How it works?
  • 23.
    23© Copyright 2016GBCS LLC Steps Blockchain How it works?
  • 24.
    24© Copyright 2016GBCS LLC Steps Blockchain How it works?
  • 25.
    25© Copyright 2016GBCS LLC Steps Blockchain How it works?
  • 26.
    26© Copyright 2016GBCS LLC Steps Blockchain How it works?
  • 27.
    27© Copyright 2016GBCS LLC Steps Blockchain How it works?
  • 28.
    28© Copyright 2016GBCS LLC Steps Blockchain How it works?
  • 29.
    29© Copyright 2016GBCS LLC • Blockchain • What is it? • How it works • Use Cases • Cryptocurrencies • Smart Contracts • Ethereum • Solidity • Remix Introduction
  • 30.
    30© Copyright 2016GBCS LLC Use Cases Crypto- Currencies • Bitcoin • First Digital Currency • Established in Jan/03/2009 with the “genesis block” • Independent, public, permission less • Distributed ledgers • Uses cryptography as a method to verify transactions and regulate the generation of further units of bitcoin: SHA256 • Consensus: POW • Limited amount of currency: 21 millions BTC • See details of bitcoin blockchain: https://blockchain.info/
  • 31.
    31© Copyright 2016GBCS LLC Each block contains among other informations: • The block`s hash: that is the “fingerprint”. If you change the information inside the block, the hash changes too; • Timestamp (Y/M/D:h:m:s) and any other information that you might want to use. • The Merkle Tree: group of transactions • The previous hash: links the actual block to the previous block creating the “blockchain”. Use Cases Crypto- Currencies • Bitcoin
  • 32.
    32© Copyright 2016GBCS LLC Use Cases Crypto- Currencies • Bitcoin • Altcoin • Alternative Coin are alternative cryptocurrencies. Any other than Bitcoin and can use different structures: • other hash functions (SHA256, Scrypt, X11, NIST5…) • use different algorithms than PoW and some can be mined using a simple CPU • unlimited or limited supply of currencies • Linked to projects or business. • Today there’s more than 1k altcoins • For a list see: https://coinmarketcap.com/all/views/all/
  • 33.
    33© Copyright 2016GBCS LLC Use Cases Crypto- Currencies • Bitcoin • Altcoin • Token • In software development means a authentication signature issued by a server. • You can use this signature for a limited time or repetitions. • Can be issued by Government to tax payers or by a company to supply chains. • Main difference between altcoins and tokens: structure. • Coins are separate currencies with their own separate blockchain • Tokens facilitates the creation of decentralized applications. Represent a asset or utility (commodity, loyalty points or even cryptocurrencies)
  • 34.
    34© Copyright 2016GBCS LLC Use Cases Crypto- Currencies • Bitcoin • Altcoin • Token • ICO • Initial Coin Offering is a different way of crowdfunding projects using a new crypto-coin or crypto-token. • The first ICO was Riple (2013) that issued tokens to fund a new Project. After this, the token was converted to a coin (XRP) • Another ICO was ethereum (ETH) that created a platform to unleashed the power of smart contracts • Inside this platform you can create a new token (or crypto-coin) and your own blockchain structure using smart contracts.
  • 35.
    35© Copyright 2016GBCS LLC Use Cases Crypto- Currencies • Bitcoin • Altcoin • Token • ICO • Price is established by the company in the Project (White Paper) • ICO-token: • Create rights to a specific Project and can have a limited time to end • Can be convert in a coin in future, or not! • ICO-coin: • limited or unlimited number of coins • After the ICO round it finishes with the token or the coin traded in the crypto-Market • More about ICO: https://icostats.com/ or https://ico- list.com/
  • 36.
    36© Copyright 2016GBCS LLC Use Cases Crypto- Currencies • Bitcoin • Altcoin • Token • ICO • Is the most importante part in the ICO process • Must contain (minimal requeriments): • Project details as timeline (calendar), cost, technology, Market analysis, projections, use of the Technologies talk about redemption process, risks and security • Sale: roadmap of the ICO • Blockchain model with details of the smart contract • Token and coin distribution with price, total amount of emission, share of the total Project funding by the ICO • Team members • White Paper
  • 37.
    37© Copyright 2016GBCS LLC • Blockchain • What is it? • How it works • Use Cases • Cryptocurrencies • Smart Contracts • Ethereum • Solidity • Remix Introduction
  • 38.
    38© Copyright 2016GBCS LLC Smart Contracts SMART CONTRACTS
  • 39.
    39© Copyright 2016GBCS LLC Smart Contracts • First proposed in 1994 (Nick Szabo) • Put the terms of the agreement, penalties, tax, fee, time and any information important inside a contract in lines of code • Are self-executing, anonymous, don`t need central authority and permit trusted transactions • Can be used to automate routine process reducing transaction cost with more security • Can be used to facilitate transactions, eliminate intermediaries, create a more transparent system avoiding lawyers and accountants and to crowdfunding as ICO
  • 40.
    40© Copyright 2016GBCS LLC Smart Contracts • Ethereum • Decentralized platform that runs smart contracts created by the Ethereum Foundation (Swiss nonprofit organization) • Presale in August 2014 and that resulted in a cryptocurrency: the ether (ETH) • Can use the platform to issue token or crypto-coin and build a crowdfunding (ICO) or crowdsale and selling shares in a blockchain organization • Use it to create a virtual organization, country, economy, business with smart contracts • More: https://ethereum.org/
  • 41.
    41© Copyright 2016GBCS LLC Smart Contracts • Ethereum • Contract-oriented language used to implement smart contracts in the Ethereum Virtual Machine (EVM) • EVM is the runtime environment for smart contracts. • Use REMIX to create smart contracts without installations. • Otherway download the file: • https://github.com/ethereum/browser-solidity/tree/gh-pages • To work locally you need Node.js • For solidity details see: https://solidity.readthedocs.io/en/develop/ • For DApps examples: https://github.com/ethereum/dapp-bin • Or: https://www.stateofthedapps.com/ • Solidity
  • 42.
    42© Copyright 2016GBCS LLC Smart Contracts • Ethereum • IDE – Integrated Development Environment used to create smart contracts online • Used to develop, debug, access properties and optimize solidity codes in smart contracts and DApps. • Details about remix: http://remix.readthedocs.io/en/latest/• Solidity • Remix
  • 43.
    43© Copyright 2016GBCS LLC Smart Contracts • Ethereum • Solidity • Remix List all the files in your browser
  • 44.
    44© Copyright 2016GBCS LLC Smart Contracts • Ethereum • Solidity • Remix Compile contracts if you change it Disable autocompilation A list of compilation erros and warnings
  • 45.
    45© Copyright 2016GBCS LLC Smart Contracts • Ethereum • Solidity • Remix Three environments: • JavaScript VM • Injected Provider • Web3 Provider All the accounts associated to current environment Gas limit used to all transactions Value to each transaction created Used to compiled contracts List of pending transactions