SlideShare a Scribd company logo
t
Introduction to
Blockchain &
Smart Contracts
April 30, 2018Sandip Pandey
1
Create your own Cryptocurrency Token
- Blockchain Enthusiast
- Blockchain Research Engineer
Blockchain Labs, TU Delft
- EIT Digital Alumni (2016)
https://github.com/xoriole
https://www.linkedin.com/in/sandippandey/
About Me
2
1500+ more
Blockchain is a Solution looking for a Problem!
Source: Bitcoin: A Peer-to-Peer Electronic Cash System, S. Nakamoto
        
        
      
→ SHOW US SOME PROOF
Proof of work
Proof of burn
Proof of activity
Proof of stake
Proof of capacity
Proof of elapsed time Proof of ...
- First digital decentralized cryptocurrency
- Founder: Satoshi Nakamoto
- Proof of work consensus
- Pseudonymous
Eg. 1CF6yUN61c4zmE2wTibhPhh53sJ5s4VLsa
Bitcoin Scripts are limited in capability & Restrictive
Input Script
Output Script
A decentralized platform that runs smart contracts
Smart Contract
A collection of code (functions) and data (state) that resides at a specific
address on the blockchain
- Digital Token
- Trustless Crowdsale
- Democratic Autonomous Organizations
- so on …
One step further towards a Programmable Economy
Trade
Finance
Supply
Chain &
Logistics
Health &
Medicine
Self
Sovereign
Identity
...Mortgages
Energy &
Smart Grid
Securities &
Insurance
❏ Multiple interacting entities
❏ Data represents some form of value or asset
❏ Data is shared among the entities
❏ All updates on data need to be logged
❏ Entities need to trust the shared state of data & all updates made on them
❏ CONSISTENCY, VALIDITY and IMMUTABILITY of the data is important
❏ Incremental data dependency
❏ High operational costs (intermediary)
Immutability isn’t always a good thing
- Data written on blockchain cannot be changed or deleted
- No correction of mistakes (Hard Fork?)
- Legal issues: EU - Right to be forgotten
- Think before writing privacy sensitive information on blockchain
Performance Issues
- Transaction delay & Confirmation time
- Transaction throughput (tx/second)
User Account
- Address
- Balance
Smart Contract
- Address
- Balance
- Code
- State
Source: http://www.gjermundbjaanes.com/img/posts/smart_contract_infographic.png
- Transfer of Value
- Smart Contract creation
- Call contract
- Transfer of Value
- Smart Contract creation
- Call contract
{
‘to’: ‘0x990FcbF55D6eD9493c62e11da388A4D89d857200’,
‘value’: 0.500
‘data’: ‘0x’
}
- Transfer of Value
- Smart Contract creation
- Call contract
{
‘to’: ‘’,
‘value’: 0.0
‘data’: ‘0x60806040526040805190810160405280601a….’
}
- Transfer of Value
- Smart Contract creation
- Call contract
{
‘to’: ‘0x990FcbF55D6eD9493c62e11da388A4D89d857200’, // contract
‘value’: 0.0
‘data’: ‘0xa9059cbb000000000000000000000000990fcbf55d...c8’
}
Source: http://www.gjermundbjaanes.com/img/posts/calling_a_smart_contract_infographic.png
❏ Ethereum wallet
❏ Some ethers
❏ An IDE to write and deploy smart contract
❏ Many options - Ethereum wallet (official)/Mist, Metamask, MyEtherWallet, ...
❏ We use Metamask chrome plugin ( https://metamask.io )
Create an account with a
good password
Copy the seed words and
keep it safe.
Your wallet account home
screen
Copy your address.
For eg. 0xC594...277
❏ Ether Network Chains
❏ Main network (ETH)
❏ Test networks
❏ Ropsten
❏ Kovan
❏ Rinkeby << We’ll use this one
❏ Others
❏ Expanse (EXP)
❏ Ubiq (UBQ)
❏ ...
❏ Rinkeby Faucet
https://faucet.rinkeby.io/
❏ Options
❏ Ethereum Wallet/Mist
❏ Remix IDE
https://remix.ethereum.org
❏ ...
Some information about token
- Name,
- Symbol,
- Number of decimals,
- total supply
Some information about token
- Name,
- Symbol,
- Number of decimals,
- total supply
Some information of account and account balance
- Which address has how many tokens?
Some information about token
- Name,
- Symbol,
- Number of decimals,
- total supply
Some information of account and account balance
- Which address has how many tokens?
Movement of tokens
- Transfer of tokens from one account to another
pragma solidity ^0.4.12;
contract MyFirstToken {
string public name = "MyFirstToken";
string public symbol = "MFT";
uint8 public decimals = 2;
uint256 public totalSupply;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
/**Constructor. Initializes contract with some initial supply tokens.*/
function MyFirstToken( uint256 initialSupply) public {
totalSupply = initialSupply * 10 ** uint256(decimals);
balanceOf[msg.sender] = totalSupply;
}
// transfer function in next slide
}
[ http://bit.ly/my-first-token ]
pragma solidity ^0.4.12;
contract MyFirstToken {
/** Transfer tokens.*/
function transfer(address _to, uint _value) public {
// Prevent transfer to 0x0 address.
require(_to != 0x0);
// Check if the sender has enough
require(balanceOf[msg.sender] >= _value);
// Check for overflows
require(balanceOf[_to] + _value >= balanceOf[_to]);
// Save this for an assertion in the future
uint previousBalances = balanceOf[msg.sender] + balanceOf[_to];
// Subtract from the sender
balanceOf[msg.sender] -= _value;
// Add the same to the recipient
balanceOf[_to] += _value;
//Make sure math is right. Assertions should never fail
assert(balanceOf[msg.sender] + balanceOf[_to] == previousBalances);
}
}
[ http://bit.ly/my-first-token ]
Requirements
- Basic Token +
- Foundation creates the token
- Token should be transferable
- Only alumni can send/receive tokens
- Foundation can register alumni in blockchain
http://bit.ly/alumni-credits
[ http://bit.ly/alumni-credits ]
pragma solidity ^0.4.12;
contract AlumniCredits {
string public name = "AlumniCredits";
string public symbol = "EITDAC";
uint8 public decimals = 2;
uint256 public totalSupply;
// Foundation address
address public foundation;
// This creates an array with all balances
mapping (address => uint256) public balanceOf;
/**Constructor. Initializes contract with some initial supply tokens.*/
function AlumniCredits( uint256 initialSupply) public {
foundation = msg.sender; // contract creator is the foundation
totalSupply = initialSupply * 10 ** uint256(decimals);
balanceOf[foundation] = totalSupply;
registered[foundation] = true;
}
}
[ http://bit.ly/alumni-credits ]
pragma solidity ^0.4.12;
contract AlumniCredits {
// All registered/valid alumni addresses approved by the foundation
mapping (address => bool) registeredAlumni;
/** Transfer tokens.*/
function transfer(address _to, uint _value) public {
//Make sure receiver is also alumni
require(registeredAlumni[_alumni] == true);
// Rest is same as basic token…
}
// Register an alumni address.Can be done by foundation only.
function registerAlumni(address _address) public onlyFoundation {
registeredAlumni[_address] = true;
}
//Check if an address belongs to a registered alumni
function isRegistered(address _address) public view returns (bool registered){
return registeredAlumni[_address] == true;
}
}
[ http://bit.ly/alumni-credits ]
// Abstract contract for the full ERC 20 Token standard
// https://github.com/ethereum/EIPs/issues/20
pragma solidity ^0.4.8;
contract Token {
string public name;
string public symbol;
uint8 public decimals = 18;
uint256 public totalSupply;
function balanceOf(address _owner) constant returns (uint256 balance);
function transfer(address _to, uint256 _value) returns (bool success);
function transferFrom(address _from, address _to, uint256 _value) returns (bool success);
function approve(address _spender, uint256 _value) returns (bool success);
function allowance(address _owner, address _spender) constant returns (uint256 remaining);
event Transfer(address indexed _from, address indexed _to, uint256 _value);
event Approval(address indexed _owner, address indexed _spender, uint256 _value);
}
- Determined at the time contract is created
- Derived from creator address and “nonce”
- A Contract cannot be re-deployed at the same contract address
- Determined at the time contract is created
- Derived from creator address and “nonce”
- A Contract cannot be re-deployed at the same contract address
BUG IN THE CONTRACT
HOW TO FIX THEM?
1. Separate Data and Logic
Eg. prepare separate contracts for data storage and application logic
2. Maintain a versioning of contracts (sort of)
3. Delegator/Proxy Contract
Delegator delegates all the calls to latest implementation of the contract
Identity & Access Control
- Who has what level of control on the contract functions and data?
- Access & privilege control
Data Privacy
- Data encryption, Encryption Algorithms,
- Digital Signatures etc.
Future is decentralized!

More Related Content

What's hot

Solidity Simple Tutorial EN
Solidity Simple Tutorial ENSolidity Simple Tutorial EN
Solidity Simple Tutorial EN
Nicholas Lin
 
Dex and Uniswap
Dex and UniswapDex and Uniswap
Dex and Uniswap
Gene Leybzon
 
Solidity
SoliditySolidity
Solidity
gavofyork
 
Solidity Security and Best Coding Practices
Solidity Security and Best Coding PracticesSolidity Security and Best Coding Practices
Solidity Security and Best Coding Practices
Gene Leybzon
 
Hands on with smart contracts
Hands on with smart contractsHands on with smart contracts
Hands on with smart contracts
Gene Leybzon
 
Ethereum Contracts - Coinfest 2015
Ethereum Contracts - Coinfest 2015Ethereum Contracts - Coinfest 2015
Ethereum Contracts - Coinfest 2015
Rhea Myers
 
From CRUD to messages: a true story
From CRUD to messages: a true storyFrom CRUD to messages: a true story
From CRUD to messages: a true story
Alessandro Melchiori
 
Hands on with Smart Contracts session #3
Hands on with Smart Contracts session #3Hands on with Smart Contracts session #3
Hands on with Smart Contracts session #3
Gene Leybzon
 
Spring Transaction
Spring TransactionSpring Transaction
Spring Transaction
Jannarong Wadthong
 
Declaring friend function with inline code
Declaring friend function with inline codeDeclaring friend function with inline code
Declaring friend function with inline code
Rajeev Sharan
 
Oracles
OraclesOracles
Oracles
Gene Leybzon
 
Rajeev oops 2nd march
Rajeev oops 2nd marchRajeev oops 2nd march
Rajeev oops 2nd march
Rajeev Sharan
 
Logging in code
Logging in codeLogging in code
Logging in code
Jannarong Wadthong
 
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
병완 임
 
Migrating our micro services from Java to Kotlin 2.0
Migrating our micro services from Java to Kotlin 2.0Migrating our micro services from Java to Kotlin 2.0
Migrating our micro services from Java to Kotlin 2.0
Björn Wendland
 
Smart contracts in Solidity
Smart contracts in SoliditySmart contracts in Solidity
Smart contracts in Solidity
Felix Crisan
 
Taming Distribution: Formal Protocols for Akka Typed
Taming Distribution: Formal Protocols for Akka TypedTaming Distribution: Formal Protocols for Akka Typed
Taming Distribution: Formal Protocols for Akka Typed
Roland Kuhn
 
Braga Blockchain - Ethereum Smart Contracts programming
Braga Blockchain - Ethereum Smart Contracts programmingBraga Blockchain - Ethereum Smart Contracts programming
Braga Blockchain - Ethereum Smart Contracts programming
Emanuel Mota
 
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic LabsTypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
Alfonso Peletier
 
How to be a smart contract engineer
How to be a smart contract engineerHow to be a smart contract engineer
How to be a smart contract engineer
Oded Noam
 

What's hot (20)

Solidity Simple Tutorial EN
Solidity Simple Tutorial ENSolidity Simple Tutorial EN
Solidity Simple Tutorial EN
 
Dex and Uniswap
Dex and UniswapDex and Uniswap
Dex and Uniswap
 
Solidity
SoliditySolidity
Solidity
 
Solidity Security and Best Coding Practices
Solidity Security and Best Coding PracticesSolidity Security and Best Coding Practices
Solidity Security and Best Coding Practices
 
Hands on with smart contracts
Hands on with smart contractsHands on with smart contracts
Hands on with smart contracts
 
Ethereum Contracts - Coinfest 2015
Ethereum Contracts - Coinfest 2015Ethereum Contracts - Coinfest 2015
Ethereum Contracts - Coinfest 2015
 
From CRUD to messages: a true story
From CRUD to messages: a true storyFrom CRUD to messages: a true story
From CRUD to messages: a true story
 
Hands on with Smart Contracts session #3
Hands on with Smart Contracts session #3Hands on with Smart Contracts session #3
Hands on with Smart Contracts session #3
 
Spring Transaction
Spring TransactionSpring Transaction
Spring Transaction
 
Declaring friend function with inline code
Declaring friend function with inline codeDeclaring friend function with inline code
Declaring friend function with inline code
 
Oracles
OraclesOracles
Oracles
 
Rajeev oops 2nd march
Rajeev oops 2nd marchRajeev oops 2nd march
Rajeev oops 2nd march
 
Logging in code
Logging in codeLogging in code
Logging in code
 
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
BlockchainDay "Ethereum Dapp - Asset Exchange YOSEMITE alpha" Session
 
Migrating our micro services from Java to Kotlin 2.0
Migrating our micro services from Java to Kotlin 2.0Migrating our micro services from Java to Kotlin 2.0
Migrating our micro services from Java to Kotlin 2.0
 
Smart contracts in Solidity
Smart contracts in SoliditySmart contracts in Solidity
Smart contracts in Solidity
 
Taming Distribution: Formal Protocols for Akka Typed
Taming Distribution: Formal Protocols for Akka TypedTaming Distribution: Formal Protocols for Akka Typed
Taming Distribution: Formal Protocols for Akka Typed
 
Braga Blockchain - Ethereum Smart Contracts programming
Braga Blockchain - Ethereum Smart Contracts programmingBraga Blockchain - Ethereum Smart Contracts programming
Braga Blockchain - Ethereum Smart Contracts programming
 
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic LabsTypeScript - All you ever wanted to know - Tech Talk by Epic Labs
TypeScript - All you ever wanted to know - Tech Talk by Epic Labs
 
How to be a smart contract engineer
How to be a smart contract engineerHow to be a smart contract engineer
How to be a smart contract engineer
 

Similar to “Create your own cryptocurrency in an hour” - Sandip Pandey

Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereumDappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Tomoaki Sato
 
A Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts BytecodeA Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts Bytecode
Shakacon
 
Creating an Uber Clone - Part XIII - Transcript.pdf
Creating an Uber Clone - Part XIII - Transcript.pdfCreating an Uber Clone - Part XIII - Transcript.pdf
Creating an Uber Clone - Part XIII - Transcript.pdf
ShaiAlmog1
 
以太坊代幣付款委託 @ Open Source Developer Meetup #12
以太坊代幣付款委託 @ Open Source Developer Meetup #12以太坊代幣付款委託 @ Open Source Developer Meetup #12
以太坊代幣付款委託 @ Open Source Developer Meetup #12
Aludirk Wong
 
Programming smart contracts in solidity
Programming smart contracts in solidityProgramming smart contracts in solidity
Programming smart contracts in solidity
Emanuel Mota
 
Security in the blockchain
Security in the blockchainSecurity in the blockchain
Security in the blockchain
Bellaj Badr
 
How to create ethereum token (A plan coin ico)
How to create ethereum token (A plan coin ico)How to create ethereum token (A plan coin ico)
How to create ethereum token (A plan coin ico)
承翰 蔡
 
Implementing STM in Java
Implementing STM in JavaImplementing STM in Java
Implementing STM in Java
Misha Kozik
 
Advanced smart contract
Advanced smart contractAdvanced smart contract
Advanced smart contract
Đoàn Thái Thiên Lộc
 
Robust Programming of Smart Contracts in Solidity+, RK Shyamasundar
Robust Programming of Smart Contracts in Solidity+, RK ShyamasundarRobust Programming of Smart Contracts in Solidity+, RK Shyamasundar
Robust Programming of Smart Contracts in Solidity+, RK Shyamasundar
Napier University
 
INTEGRATE 2022 - Data Mapping in the Microsoft Cloud
INTEGRATE 2022 - Data Mapping in the Microsoft CloudINTEGRATE 2022 - Data Mapping in the Microsoft Cloud
INTEGRATE 2022 - Data Mapping in the Microsoft Cloud
Daniel Toomey
 
Primer to smart contracts, smart property, trustless asset management
Primer to smart contracts, smart property, trustless asset managementPrimer to smart contracts, smart property, trustless asset management
Primer to smart contracts, smart property, trustless asset management
Tim Swanson
 
Score (smart contract for icon)
Score (smart contract for icon) Score (smart contract for icon)
Score (smart contract for icon)
Doyun Hwang
 
Smart contract and Solidity
Smart contract and SoliditySmart contract and Solidity
Smart contract and Solidity
겨울 정
 
Swift on Raspberry Pi
Swift on Raspberry PiSwift on Raspberry Pi
Swift on Raspberry Pi
Sally Shepard
 
Michał Kopacz: Ports and adapters architecture for business processes
Michał Kopacz: Ports and adapters architecture for business processesMichał Kopacz: Ports and adapters architecture for business processes
Michał Kopacz: Ports and adapters architecture for business processes
RST Software Masters
 
Build on Streakk Chain - Blockchain
Build on Streakk Chain - BlockchainBuild on Streakk Chain - Blockchain
Build on Streakk Chain - Blockchain
Earn.World
 
Presentation topalidis giorgos
Presentation topalidis giorgosPresentation topalidis giorgos
Presentation topalidis giorgos
Giorgos Topalidis
 
Presentation_Topalidis_Giorgos
Presentation_Topalidis_GiorgosPresentation_Topalidis_Giorgos
Presentation_Topalidis_Giorgos
Giorgos Topalidis
 
Jarmo van de Seijp Shadbox ERC223
Jarmo van de Seijp Shadbox ERC223Jarmo van de Seijp Shadbox ERC223
Jarmo van de Seijp Shadbox ERC223
Jarmo van de Seijp
 

Similar to “Create your own cryptocurrency in an hour” - Sandip Pandey (20)

Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereumDappsmedia smartcontract _write_smartcontracts_on_console_ethereum
Dappsmedia smartcontract _write_smartcontracts_on_console_ethereum
 
A Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts BytecodeA Decompiler for Blackhain-Based Smart Contracts Bytecode
A Decompiler for Blackhain-Based Smart Contracts Bytecode
 
Creating an Uber Clone - Part XIII - Transcript.pdf
Creating an Uber Clone - Part XIII - Transcript.pdfCreating an Uber Clone - Part XIII - Transcript.pdf
Creating an Uber Clone - Part XIII - Transcript.pdf
 
以太坊代幣付款委託 @ Open Source Developer Meetup #12
以太坊代幣付款委託 @ Open Source Developer Meetup #12以太坊代幣付款委託 @ Open Source Developer Meetup #12
以太坊代幣付款委託 @ Open Source Developer Meetup #12
 
Programming smart contracts in solidity
Programming smart contracts in solidityProgramming smart contracts in solidity
Programming smart contracts in solidity
 
Security in the blockchain
Security in the blockchainSecurity in the blockchain
Security in the blockchain
 
How to create ethereum token (A plan coin ico)
How to create ethereum token (A plan coin ico)How to create ethereum token (A plan coin ico)
How to create ethereum token (A plan coin ico)
 
Implementing STM in Java
Implementing STM in JavaImplementing STM in Java
Implementing STM in Java
 
Advanced smart contract
Advanced smart contractAdvanced smart contract
Advanced smart contract
 
Robust Programming of Smart Contracts in Solidity+, RK Shyamasundar
Robust Programming of Smart Contracts in Solidity+, RK ShyamasundarRobust Programming of Smart Contracts in Solidity+, RK Shyamasundar
Robust Programming of Smart Contracts in Solidity+, RK Shyamasundar
 
INTEGRATE 2022 - Data Mapping in the Microsoft Cloud
INTEGRATE 2022 - Data Mapping in the Microsoft CloudINTEGRATE 2022 - Data Mapping in the Microsoft Cloud
INTEGRATE 2022 - Data Mapping in the Microsoft Cloud
 
Primer to smart contracts, smart property, trustless asset management
Primer to smart contracts, smart property, trustless asset managementPrimer to smart contracts, smart property, trustless asset management
Primer to smart contracts, smart property, trustless asset management
 
Score (smart contract for icon)
Score (smart contract for icon) Score (smart contract for icon)
Score (smart contract for icon)
 
Smart contract and Solidity
Smart contract and SoliditySmart contract and Solidity
Smart contract and Solidity
 
Swift on Raspberry Pi
Swift on Raspberry PiSwift on Raspberry Pi
Swift on Raspberry Pi
 
Michał Kopacz: Ports and adapters architecture for business processes
Michał Kopacz: Ports and adapters architecture for business processesMichał Kopacz: Ports and adapters architecture for business processes
Michał Kopacz: Ports and adapters architecture for business processes
 
Build on Streakk Chain - Blockchain
Build on Streakk Chain - BlockchainBuild on Streakk Chain - Blockchain
Build on Streakk Chain - Blockchain
 
Presentation topalidis giorgos
Presentation topalidis giorgosPresentation topalidis giorgos
Presentation topalidis giorgos
 
Presentation_Topalidis_Giorgos
Presentation_Topalidis_GiorgosPresentation_Topalidis_Giorgos
Presentation_Topalidis_Giorgos
 
Jarmo van de Seijp Shadbox ERC223
Jarmo van de Seijp Shadbox ERC223Jarmo van de Seijp Shadbox ERC223
Jarmo van de Seijp Shadbox ERC223
 

More from EIT Digital Alumni

EIT Digital Alumni Foundation - About us
EIT Digital Alumni Foundation - About usEIT Digital Alumni Foundation - About us
EIT Digital Alumni Foundation - About us
EIT Digital Alumni
 
The EIT Digital Alumni Foundation
The EIT Digital Alumni FoundationThe EIT Digital Alumni Foundation
The EIT Digital Alumni Foundation
EIT Digital Alumni
 
"CERN: An Innovation Hub" - Ranveig Strøm
"CERN: An Innovation Hub" - Ranveig Strøm"CERN: An Innovation Hub" - Ranveig Strøm
"CERN: An Innovation Hub" - Ranveig Strøm
EIT Digital Alumni
 
"EIT Digital Alumni: State of Play" - Francesco Bonadiman
"EIT Digital Alumni: State of Play" - Francesco Bonadiman"EIT Digital Alumni: State of Play" - Francesco Bonadiman
"EIT Digital Alumni: State of Play" - Francesco Bonadiman
EIT Digital Alumni
 
“Blockchain & Energy: hype or solution?” - Simone Accornero
“Blockchain & Energy: hype or solution?” - Simone Accornero“Blockchain & Energy: hype or solution?” - Simone Accornero
“Blockchain & Energy: hype or solution?” - Simone Accornero
EIT Digital Alumni
 
“Internet of Things: Theory and Practice” - Roman Chirikov
“Internet of Things: Theory and Practice” - Roman Chirikov“Internet of Things: Theory and Practice” - Roman Chirikov
“Internet of Things: Theory and Practice” - Roman Chirikov
EIT Digital Alumni
 
“Earthquakes aren’t the only thing shaking up Santiago” - Dora Palfi
“Earthquakes aren’t the only thing shaking up Santiago” - Dora Palfi“Earthquakes aren’t the only thing shaking up Santiago” - Dora Palfi
“Earthquakes aren’t the only thing shaking up Santiago” - Dora Palfi
EIT Digital Alumni
 
“The power of a movement” - Jeroen Van Lent
“The power of a movement” - Jeroen Van Lent“The power of a movement” - Jeroen Van Lent
“The power of a movement” - Jeroen Van Lent
EIT Digital Alumni
 
“How can the blockchain make electronic voting more secure?” - István András ...
“How can the blockchain make electronic voting more secure?” - István András ...“How can the blockchain make electronic voting more secure?” - István András ...
“How can the blockchain make electronic voting more secure?” - István András ...
EIT Digital Alumni
 
“Thread - A New Wireless Networking Protocol for Internet of Things” - Ankith...
“Thread - A New Wireless Networking Protocol for Internet of Things” - Ankith...“Thread - A New Wireless Networking Protocol for Internet of Things” - Ankith...
“Thread - A New Wireless Networking Protocol for Internet of Things” - Ankith...
EIT Digital Alumni
 

“Hands-on: Build a Low-Power IoT Prototype” - Hylke Visser

“Hands-on: Build a Low-Power IoT Prototype” - Hylke Visser
“Hands-on: Build a Low-Power IoT Prototype” - Hylke Visser

“Hands-on: Build a Low-Power IoT Prototype” - Hylke Visser
EIT Digital Alumni
 

“Towards Machine Intelligence” - Daniyal Shahrokhian

“Towards Machine Intelligence” - Daniyal Shahrokhian
“Towards Machine Intelligence” - Daniyal Shahrokhian

“Towards Machine Intelligence” - Daniyal Shahrokhian
EIT Digital Alumni
 

More from EIT Digital Alumni (12)

EIT Digital Alumni Foundation - About us
EIT Digital Alumni Foundation - About usEIT Digital Alumni Foundation - About us
EIT Digital Alumni Foundation - About us
 
The EIT Digital Alumni Foundation
The EIT Digital Alumni FoundationThe EIT Digital Alumni Foundation
The EIT Digital Alumni Foundation
 
"CERN: An Innovation Hub" - Ranveig Strøm
"CERN: An Innovation Hub" - Ranveig Strøm"CERN: An Innovation Hub" - Ranveig Strøm
"CERN: An Innovation Hub" - Ranveig Strøm
 
"EIT Digital Alumni: State of Play" - Francesco Bonadiman
"EIT Digital Alumni: State of Play" - Francesco Bonadiman"EIT Digital Alumni: State of Play" - Francesco Bonadiman
"EIT Digital Alumni: State of Play" - Francesco Bonadiman
 
“Blockchain & Energy: hype or solution?” - Simone Accornero
“Blockchain & Energy: hype or solution?” - Simone Accornero“Blockchain & Energy: hype or solution?” - Simone Accornero
“Blockchain & Energy: hype or solution?” - Simone Accornero
 
“Internet of Things: Theory and Practice” - Roman Chirikov
“Internet of Things: Theory and Practice” - Roman Chirikov“Internet of Things: Theory and Practice” - Roman Chirikov
“Internet of Things: Theory and Practice” - Roman Chirikov
 
“Earthquakes aren’t the only thing shaking up Santiago” - Dora Palfi
“Earthquakes aren’t the only thing shaking up Santiago” - Dora Palfi“Earthquakes aren’t the only thing shaking up Santiago” - Dora Palfi
“Earthquakes aren’t the only thing shaking up Santiago” - Dora Palfi
 
“The power of a movement” - Jeroen Van Lent
“The power of a movement” - Jeroen Van Lent“The power of a movement” - Jeroen Van Lent
“The power of a movement” - Jeroen Van Lent
 
“How can the blockchain make electronic voting more secure?” - István András ...
“How can the blockchain make electronic voting more secure?” - István András ...“How can the blockchain make electronic voting more secure?” - István András ...
“How can the blockchain make electronic voting more secure?” - István András ...
 
“Thread - A New Wireless Networking Protocol for Internet of Things” - Ankith...
“Thread - A New Wireless Networking Protocol for Internet of Things” - Ankith...“Thread - A New Wireless Networking Protocol for Internet of Things” - Ankith...
“Thread - A New Wireless Networking Protocol for Internet of Things” - Ankith...
 

“Hands-on: Build a Low-Power IoT Prototype” - Hylke Visser

“Hands-on: Build a Low-Power IoT Prototype” - Hylke Visser
“Hands-on: Build a Low-Power IoT Prototype” - Hylke Visser

“Hands-on: Build a Low-Power IoT Prototype” - Hylke Visser
 

“Towards Machine Intelligence” - Daniyal Shahrokhian

“Towards Machine Intelligence” - Daniyal Shahrokhian
“Towards Machine Intelligence” - Daniyal Shahrokhian

“Towards Machine Intelligence” - Daniyal Shahrokhian
 

Recently uploaded

Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
Pixlogix Infotech
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
Tomaz Bratanic
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
kumardaparthi1024
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
Zilliz
 

Recently uploaded (20)

Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Best 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERPBest 20 SEO Techniques To Improve Website Visibility In SERP
Best 20 SEO Techniques To Improve Website Visibility In SERP
 
GraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracyGraphRAG for Life Science to increase LLM accuracy
GraphRAG for Life Science to increase LLM accuracy
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
GenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizationsGenAI Pilot Implementation in the organizations
GenAI Pilot Implementation in the organizations
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Programming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup SlidesProgramming Foundation Models with DSPy - Meetup Slides
Programming Foundation Models with DSPy - Meetup Slides
 

“Create your own cryptocurrency in an hour” - Sandip Pandey

  • 1. t Introduction to Blockchain & Smart Contracts April 30, 2018Sandip Pandey 1 Create your own Cryptocurrency Token
  • 2. - Blockchain Enthusiast - Blockchain Research Engineer Blockchain Labs, TU Delft - EIT Digital Alumni (2016) https://github.com/xoriole https://www.linkedin.com/in/sandippandey/ About Me 2
  • 4. Blockchain is a Solution looking for a Problem!
  • 5.
  • 6. Source: Bitcoin: A Peer-to-Peer Electronic Cash System, S. Nakamoto
  • 8.
  • 9. → SHOW US SOME PROOF Proof of work Proof of burn Proof of activity Proof of stake Proof of capacity Proof of elapsed time Proof of ...
  • 10. - First digital decentralized cryptocurrency - Founder: Satoshi Nakamoto - Proof of work consensus - Pseudonymous Eg. 1CF6yUN61c4zmE2wTibhPhh53sJ5s4VLsa
  • 11. Bitcoin Scripts are limited in capability & Restrictive Input Script Output Script
  • 12. A decentralized platform that runs smart contracts Smart Contract A collection of code (functions) and data (state) that resides at a specific address on the blockchain - Digital Token - Trustless Crowdsale - Democratic Autonomous Organizations - so on … One step further towards a Programmable Economy
  • 13.
  • 15. ❏ Multiple interacting entities ❏ Data represents some form of value or asset ❏ Data is shared among the entities ❏ All updates on data need to be logged ❏ Entities need to trust the shared state of data & all updates made on them ❏ CONSISTENCY, VALIDITY and IMMUTABILITY of the data is important ❏ Incremental data dependency ❏ High operational costs (intermediary)
  • 16. Immutability isn’t always a good thing - Data written on blockchain cannot be changed or deleted - No correction of mistakes (Hard Fork?) - Legal issues: EU - Right to be forgotten - Think before writing privacy sensitive information on blockchain Performance Issues - Transaction delay & Confirmation time - Transaction throughput (tx/second)
  • 17.
  • 18. User Account - Address - Balance Smart Contract - Address - Balance - Code - State Source: http://www.gjermundbjaanes.com/img/posts/smart_contract_infographic.png
  • 19. - Transfer of Value - Smart Contract creation - Call contract
  • 20. - Transfer of Value - Smart Contract creation - Call contract { ‘to’: ‘0x990FcbF55D6eD9493c62e11da388A4D89d857200’, ‘value’: 0.500 ‘data’: ‘0x’ }
  • 21. - Transfer of Value - Smart Contract creation - Call contract { ‘to’: ‘’, ‘value’: 0.0 ‘data’: ‘0x60806040526040805190810160405280601a….’ }
  • 22. - Transfer of Value - Smart Contract creation - Call contract { ‘to’: ‘0x990FcbF55D6eD9493c62e11da388A4D89d857200’, // contract ‘value’: 0.0 ‘data’: ‘0xa9059cbb000000000000000000000000990fcbf55d...c8’ }
  • 24.
  • 25. ❏ Ethereum wallet ❏ Some ethers ❏ An IDE to write and deploy smart contract
  • 26. ❏ Many options - Ethereum wallet (official)/Mist, Metamask, MyEtherWallet, ... ❏ We use Metamask chrome plugin ( https://metamask.io )
  • 27. Create an account with a good password Copy the seed words and keep it safe. Your wallet account home screen Copy your address. For eg. 0xC594...277
  • 28. ❏ Ether Network Chains ❏ Main network (ETH) ❏ Test networks ❏ Ropsten ❏ Kovan ❏ Rinkeby << We’ll use this one ❏ Others ❏ Expanse (EXP) ❏ Ubiq (UBQ) ❏ ...
  • 30. ❏ Options ❏ Ethereum Wallet/Mist ❏ Remix IDE https://remix.ethereum.org ❏ ...
  • 31.
  • 32. Some information about token - Name, - Symbol, - Number of decimals, - total supply
  • 33. Some information about token - Name, - Symbol, - Number of decimals, - total supply Some information of account and account balance - Which address has how many tokens?
  • 34. Some information about token - Name, - Symbol, - Number of decimals, - total supply Some information of account and account balance - Which address has how many tokens? Movement of tokens - Transfer of tokens from one account to another
  • 35. pragma solidity ^0.4.12; contract MyFirstToken { string public name = "MyFirstToken"; string public symbol = "MFT"; uint8 public decimals = 2; uint256 public totalSupply; // This creates an array with all balances mapping (address => uint256) public balanceOf; /**Constructor. Initializes contract with some initial supply tokens.*/ function MyFirstToken( uint256 initialSupply) public { totalSupply = initialSupply * 10 ** uint256(decimals); balanceOf[msg.sender] = totalSupply; } // transfer function in next slide } [ http://bit.ly/my-first-token ]
  • 36. pragma solidity ^0.4.12; contract MyFirstToken { /** Transfer tokens.*/ function transfer(address _to, uint _value) public { // Prevent transfer to 0x0 address. require(_to != 0x0); // Check if the sender has enough require(balanceOf[msg.sender] >= _value); // Check for overflows require(balanceOf[_to] + _value >= balanceOf[_to]); // Save this for an assertion in the future uint previousBalances = balanceOf[msg.sender] + balanceOf[_to]; // Subtract from the sender balanceOf[msg.sender] -= _value; // Add the same to the recipient balanceOf[_to] += _value; //Make sure math is right. Assertions should never fail assert(balanceOf[msg.sender] + balanceOf[_to] == previousBalances); } } [ http://bit.ly/my-first-token ]
  • 37. Requirements - Basic Token + - Foundation creates the token - Token should be transferable - Only alumni can send/receive tokens - Foundation can register alumni in blockchain http://bit.ly/alumni-credits [ http://bit.ly/alumni-credits ]
  • 38. pragma solidity ^0.4.12; contract AlumniCredits { string public name = "AlumniCredits"; string public symbol = "EITDAC"; uint8 public decimals = 2; uint256 public totalSupply; // Foundation address address public foundation; // This creates an array with all balances mapping (address => uint256) public balanceOf; /**Constructor. Initializes contract with some initial supply tokens.*/ function AlumniCredits( uint256 initialSupply) public { foundation = msg.sender; // contract creator is the foundation totalSupply = initialSupply * 10 ** uint256(decimals); balanceOf[foundation] = totalSupply; registered[foundation] = true; } } [ http://bit.ly/alumni-credits ]
  • 39. pragma solidity ^0.4.12; contract AlumniCredits { // All registered/valid alumni addresses approved by the foundation mapping (address => bool) registeredAlumni; /** Transfer tokens.*/ function transfer(address _to, uint _value) public { //Make sure receiver is also alumni require(registeredAlumni[_alumni] == true); // Rest is same as basic token… } // Register an alumni address.Can be done by foundation only. function registerAlumni(address _address) public onlyFoundation { registeredAlumni[_address] = true; } //Check if an address belongs to a registered alumni function isRegistered(address _address) public view returns (bool registered){ return registeredAlumni[_address] == true; } } [ http://bit.ly/alumni-credits ]
  • 40.
  • 41. // Abstract contract for the full ERC 20 Token standard // https://github.com/ethereum/EIPs/issues/20 pragma solidity ^0.4.8; contract Token { string public name; string public symbol; uint8 public decimals = 18; uint256 public totalSupply; function balanceOf(address _owner) constant returns (uint256 balance); function transfer(address _to, uint256 _value) returns (bool success); function transferFrom(address _from, address _to, uint256 _value) returns (bool success); function approve(address _spender, uint256 _value) returns (bool success); function allowance(address _owner, address _spender) constant returns (uint256 remaining); event Transfer(address indexed _from, address indexed _to, uint256 _value); event Approval(address indexed _owner, address indexed _spender, uint256 _value); }
  • 42. - Determined at the time contract is created - Derived from creator address and “nonce” - A Contract cannot be re-deployed at the same contract address
  • 43. - Determined at the time contract is created - Derived from creator address and “nonce” - A Contract cannot be re-deployed at the same contract address BUG IN THE CONTRACT HOW TO FIX THEM?
  • 44. 1. Separate Data and Logic Eg. prepare separate contracts for data storage and application logic 2. Maintain a versioning of contracts (sort of) 3. Delegator/Proxy Contract Delegator delegates all the calls to latest implementation of the contract
  • 45. Identity & Access Control - Who has what level of control on the contract functions and data? - Access & privilege control Data Privacy - Data encryption, Encryption Algorithms, - Digital Signatures etc.