1
BLISS Project�Output O3 Open Education Resource�Task O3-T1 Training and assessment material
24
Selects appropriate technical options for blockchain design and implementation. Specifies, refines, updates and makes available a formal approach to design solutions, necessary to develop and operate a blockchain application
U2
Blockchain platform
Learning unit :
Abstract :
Hours :
2
Learning outcomes
Platform foundations
Knowledge
Skills
Learning unit
U2
Blockchain platform
Evaluate the feasibility of implementing the specified decentralized blockchain application within a suitable blockchain platforms
K3
3
Learning outcomes
Ethereum platform
Hyperledger platform
Knowledge
Skills
Learning unit
U2
Blockchain platform
Plan and design the specifications of a decentralized blockchain application
K4
4
U2 : Blockchain platform
Jean-Patrick Gelas, Hayri Acar, Léo Besançon, UCBL, France
Hind Benfenatki, INSA of Lyon, France
Revised by: Catarina Ferreira Da Silva and
Parisa Ghodous, UCBL, France
5
Table of Contents
6
Table of Contents
7
Table of Contents: PART 1
8
Blockchain Context
Code is law
X
9
Smart Contract
10
Smart Contract Advantages
11
Smart Contract Limitations
12
Examples
Supply chain
13
Table of Contents: PART 1
14
Smart Contract Lifecycle
15
Interacting with a Smart Contract
16
Interacting with a Smart Contract
17
Alarm Clock Service
18
Trans X
Trans X
S
A
B
T
T+1
Immutability
Fails
Weather
Sport scores
Road states
🡺 Oracles
Usage of Oracles
19
What is an Oracle?
20
Table of Contents: PART 1
21
Tokenization
“The process allowing the inscription of an asset and its rights on a token, thus allowing its management and exchange in a secure peer to peer way, instantly, on a blockchain infrastructure” [18]
22
Tokens
23
Purchasing Tokens
24
Tokens’ Examples
25
Ethereum Request for Comment ERC-20
26
ERC-20: a Technical Standard
27
ERC-721 : Non-Fungible Tokens
28
Table of Contents: PART 1
29
Initial Coin Offering (ICO)
30
ICOs Advantages and Disadvantages
31
More on ICOs
32
Table of Contents: PART 1
33
Decentralized Autonomous Organization (DAO)
34
Table of Contents: PART 1
35
Understanding Ethereum Smart Contract Cost
36
Ethereum Tx Fee and Gas Limit
37
[28]
An Ethereum Wallet Flow
38
Ethereum Gas Price
39
Fee Schedule
40
41
Several more on [26]
42
Summary on Smart Contracts
43
Advantages | Disadvantages |
Agent neutrality in signing deals | Difficult to make changes |
Automation in signing deals, time saving: excludes human participation in transactions, everything is done by the prescribed program code | The third party agents do not disappear but starts playing a different role. The need for lawyers experienced in IT increases in the future because the programmers of smart contracts will need consultations for making new kinds of contracts |
Safety: data in the decentralized registry cannot be lost and cyber attacked | The consumers are quite suspicious because it is a new technology and they do not understand it yet |
Precision: no mistakes can be made due to the absence of hand-filled forms | One can keep and save data in smart contracts safely and it is void of any distortions, only if the code is written perfectly and precisely |
Summary of Advantages and Disadvantages of Smart Contracts
44
Introducing Solidity
pragma solidity ^0.4.0;
contract SimpleStorage {
uint storedData;
function set(uint x) public {
storedData = x;
}
function get() public view returns (uint) {
return storedData;
}
}
45
Table of Contents: PART 2
46
Hyperledger Fabric
Introduction to permissioned blockchains
47
What is Hyperledger?
48
Table of Contents: PART 2
49
Why Do We Need Permissioned Blockchains?
Example : Bitcoin, Ethereum, EOS…
Example : Hyperledger Fabric, Quorum...
50
Drivers of Permissioned Blockchains
51
Table of Contents: PART 2
52
About Hyperledger Fabric
Example: Node, Go, Java
53
Table of Contents: PART 2
54
Network Architecture
Org 2
Org 1
Peer 1
Peer 2
Peer 3
Ledger 1 + Chaincode
Ledger 2 + Chaincode
0
1
2
0
1
2
3
55
Network Architecture: Sending a Transaction
Org 2
Org 1
Peer 1
Peer 2
Peer 3
Ledger 1 + Chaincode
Ledger 2 + Chaincode
Orderer
1
2
2
56
Table of Contents: PART 2
57
Setting up a Network with a Configuration File
defined in a .yaml config file
58
Setting up a Network
59
Setting up a New Ledger
60
A New Ledger of Transactions
With the genesis block file and your certificates, you are all set to start sending transactions
61
Table of Contents: PART 2
62
Chaincodes
63
Writing Hyperledger Smart Contracts
64
Writing Hyperledger Smart Contracts
65
Table of Contents: PART 2
66
Possible Use Cases
“Where does the fish ordered in this restaurant was caught?”
67
Data Sharing Between Multiple Tiered Partners
“I want to easily share a ledger with Company A and its supplier Company B without their competitor Company C having access. But we’re on the same network!”
68
Table of Contents: PART 2
69
Hyperledger Resources
70
Table of Contents: PART 2
71
References
1 | «Qu’est-ce qu’Ethereum ?,» [En ligne]. Available: https://blockchainfrance.net/2016/03/04/comprendre-ethereum/. [Accès le 24 05 2018]. |
2 | S. BOURGUIGNON, «L’ICO cette nouvelle forme de levée de fonds qui fait tourner les têtes,» 26 Juin 2017. [En ligne]. Available: https://siecledigital.fr/2017/06/26/lico-cette-nouvelle-forme-de-levee-de-fonds-qui-fait-tourner-les-tetes/. |
3 | J. Luc, «Qu’est-ce qu’un « smart contract » ?,» [En ligne]. Available: https://bitcoin.fr/quest-ce-quun-smart-contract/. [Accès le 24 05 2018]. |
4 | «Blockchain : qu’est-ce qu’un Smart Contract et à quoi ça sert ?,» [En ligne]. Available: https://www.lemagit.fr/conseil/Blockchain-quest-ce-quun-Smart-Contract-et-a-quoi-ca-sert. |
5 | B. France, «Les applications prometteuses des smart contracts,» 28 January 2016. [En ligne]. Available: https://blockchainfrance.net/2016/01/28/applications-smart-contracts/. |
6 | M. Zimmermann, «Blockchain, Ethereum and Business Applications,» 23 May 2017. [En ligne]. Available: https://www.slideshare.net/MatthiasZimmermann1/blockchain-ethereum-and-business-applications. [Accès le 31 May 2018]. |
7 | K. Healy, «Ethereum in Depth: Smart Contracts - Part 1: What is a Smart Contract?,» 2017. |
8 | B. France, «Les applications prometteuses des smart contracts,» 28 January 2016. [En ligne]. Available: https://blockchainfrance.net/2016/01/28/applications-smart-contracts/. |
9 | C. |. t. c. g. o. Ethereum. [En ligne]. Available: https://cryptozombies.io/en/course. |
10 | K. TAM, «The Best Tools for Smart Contract Development,» 2018. [En ligne]. Available: https://blockgeeks.com/guides/smart-contract-development/. [Accès le 31 May 2018]. |
11 | Mobilefish.com, «Ethereum contract Application Binary Interface,» 2017. |
12 | [En ligne]. Available: https://ethereum.stackexchange.com/questions/234/what-is-an-abi-and-why-is-it-needed-to-interact-with-contracts. |
13 | S. POLROT, «Les Oracles, lien entre la blockchain et le monde,» 13 September 2016. [En ligne]. Available: https://www.ethereum-france.com/les-oracles-lien-entre-la-blockchain-et-le-monde/. |
72
14 | P. Merriam, «Ethereum Alarm Clock Documentation, Release 1.0.0,» 12 December 2017. [En ligne]. Available: https://media.readthedocs.org/pdf/ethereum-alarm-clock-service/latest/ethereum-alarm-clock-service.pdf. |
15 | P. Merriam, «Ethereum Alarm Clock,» [En ligne]. Available: http://www.ethereum-alarm-clock.com/. |
16 | B. Lafontaine et Y. Rouillard, «La Blockchain en détail,» 2016. |
17 | «How To Write A Smart-Contract For Your ICO? An Ultimate guide,» [En ligne]. Available: https://howtotoken.com/ico/how-to-write-a-smart-contract-for-your-ico-an-ultimate-guide/#limitations. |
18 | «Comprendre la tokenisation,» 22 May 2018. [En ligne]. Available: https://blockchainfrance.net/2018/05/22/comprendre-la-tokenisation/. |
19 | «Le web de demain sera décentralisé | Clement Jeanneau | TEDxAgroParisTech,» [En ligne]. Available: https://youtu.be/ISYmB5HBpP4. |
20 | «Qu’est-ce qu’un token ?,» 22 May 2018. [En ligne]. Available: https://blockchainfrance.net/2018/05/22/comprendre-les-tokens/. |
21 | S. POLROT, «Qu’est-ce qu’une cryptomonnaie, un token, un actif numérique ?,» 2 June 2017. [En ligne]. Available: https://www.ethereum-france.com/qu-est-ce-qu-une-cryptomonnaie-token-bitcoin-ether-gnt-gno-dgd-plu-rep-rlc/. |
22 | S. POLROT, «Qu’est-ce qu’un token ERC20 ?,» 02 January 2018. [En ligne]. Available: https://www.ethereum-france.com/qu-est-ce-qu-un-token-erc20/. |
23 | C. Perreau, «L'ICO, ou comment lever des millions en quelques secondes,» 01 June 2018. [En ligne]. Available: https://www.journaldunet.com/economie/finance/1195462-ico-initial-coin-offering/. |
24 | Koinbros, «What are ERC20 and ERC223 tokens?,» 21 November 2017. [En ligne]. Available: https://medium.com/cryptomover/what-are-erc20-and-erc223-tokens-307badcca5a. |
25 | «Qu’est-ce qu’une DAO ?,» 12 May 2016. [En ligne]. Available: https://blockchainfrance.net/2016/05/12/qu-est-ce-qu-une-dao/. |
References
73
26. ETHEREUM: A SECURE DECENTRALISED GENERALISED TRANSACTION LEDGER BYZANTIUM VERSION (Ethereum yellow paper), https://github.com/ethereum/yellowpaper
27. https://www.investopedia.com/terms/g/gas-ethereum.asp
28. What is Gas, https://kb.myetherwallet.com/gas/what-is-gas-ethereum.html
29. Recommended Gas Prices, https://ethgasstation.info/
30. Advantages and Disadvantages of Smart Contracts in Financial Blockchain Systems, https://hackernoon.com/advantages-and-disadvantages-of-smart-contracts-in-financial-blockchain-systems-3a443145ae1c
31. Create your own crypto-currency with Ethereum, https://www.ethereum.org/token
32. ERC20 Token Standard, https://theethereum.wiki/w/index.php/ERC20_Token_Standard
33. OpenZeppelin, https://github.com/OpenZeppelin/openzeppelin-solidity/tree/master/contracts/token
34. What is ERC-721?, http://erc721.org/
35. Build Secure Smart Contracts in Solidity, https://openzeppelin.org/
36. SafeMath to protect from overflows, https://ethereumdev.io/safemath-protect-overflows/
References
74
75