SlideShare a Scribd company logo
Introduction to Blockchain
Laurence Kirk
Extropy.IO
Monday 28th June 2021
Extropy.io 2019
Website :
https://extropy.io
Email :
info@extropy.io
Twitter : @extropy
Free Developer
Workshops
● Basic
● Enterprise
● Advanced EVM
● Zero Knowledge
Proofs
Business Workshops
Providing Blockchain solutions
DApp development and customised
blockchains
Security Audits
Extropy.io 2019
TLDR
The blockchain provides a
trust layer without a central
authority
Extropy.io 2019
Overview of Blockchain
Components
Extropy.io 2019
Gossip Network
Extropy.io 2019
Shared Public Ledger
Extropy.io 2019
Components of the Blockchain
● Shared public ledger
updated by consensus
● P2P Network
● Cryptography
Extropy.io 2019
These components give a blockchain
system
● Transparency and verifiable state based on consensus
● Resilience
● Censorship resistance
● Tamper proof interactions
Extropy.io 2019
Extropy.io 2019
● Timestamping and verification
● Digital Cash
● Proof of Work (Consensus)
● Byzantine Fault Tolerance (Consensus)
● Public keys as Identities
● Smart Contracts
Working Towards Bitcoin
Extropy.io 2019
Satoshi Nakamoto is the name used by
the presumed pseudonymous person or
persons who developed bitcoin, authored
the bitcoin white paper, and created and
deployed bitcoin's original reference
implementation
Extropy.io 2019
August 2008 - domain name bitcoin.org registered
October 2008 - A Peer-to-Peer Electronic Cash System posted to a cryptography mailing list
January 2009 - Software implementation released as open source
2010, the first known commercial transaction using bitcoin occurred when programmer Laszlo Hanyecz
bought two Papa John's pizzas for 10,000 BTC
Extropy.io 2019
By MikeG001 - Own work, CC BY-SA 4.0,
Extropy.io 2019
Blockchain Data structure
Extropy.io 2019
Proof of Work
Extropy.io 2019
Tx
Tx
Tx
Tx
Tx
Network point of view
Extropy.io 2019
Building a consensus
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
Tx
?
Extropy.io 2019
Extropy.io 2019
Proof of Work is not the only consensus mechanism used in blockchains
Avalanche
Polkadot consensus
Creates smart contract
and submits it to the
blockchain
The Ethereum Virtual
Machine
Extropy.io 2019
Restrictions
● Gas - Amount of Computation
● Determinism
● Oracles - Getting data from the internet
Extropy.io 2019
getWeather() getWeather()
getWeather()
Extropy.io 2019
Oracles
EVM Languages
Solidity
The most popular programming language for Ethereum contracts
LLL
Low-level Lisp-like Language
Vyper
A language with overflow-checking, numeric units but without unlimited loops
Pyramid Scheme (experimental)
A Scheme compiler into EVM that follows the SICP compilation approach
Flint
A language with several security features: e.g. asset types with a restricted set of atomic operations
LLLL
An LLL-like compiler being implemented in Isabelle/HOL
HAseembly-evm
An EVM assembly implemented as a Haskell DSL
Bamboo (experimental)
- A language without loops but with explicit constructor invocation at the end of every call
Designing for
decentralisation
Rock Paper Scissors
Playing Rock Paper Scissors on the blockchain
Alice plays ‘Rock’
Bob sees Alice’s
transaction, so he plays
‘Paper’
and therefore wins
Here is your
prize
Common Patterns
And
Best Practices
Consensys : Best Practices
● Use caution when making external calls
● Mark untrusted contracts
● Avoid state changes after external calls
● Don't use transfer() or send().
● Handle errors in external calls
● Favor pull over push for external calls
● Don't delegatecall to untrusted code
● Remember that Ether can be forcibly sent to an account
● Remember that on-chain data is public
● Beware of the possibility that some participants may "drop offline" and not return
● Beware of negation of the most negative signed integer
● Enforce invariants with assert()
● Use assert(), require(), revert() properly
● Use modifiers only for checks
● Beware rounding with integer division
● Be aware of the tradeoffs between abstract contracts and interfaces
● Keep fallback functions simple
● Check data length in fallback functions
etc.
Open Zeppelin
Ownership and Access Control
Contracts:
Ownable
AccessControl
Tokens
● ERC20
● ERC721
● ERC777
Creating a DApp
https://web3js.readthedocs.io/en/v1.3.0/
Other languages are available
Java
Rust
.NET
….
DeFi
CEX / DEX
From CoinMarketCap : Exchanges
From CoinMarketCap : Exchanges
Introduction to AMMs
Problems with DEXs
● Performance
● Liquidity
● Regulation
Incentivising Users
● Users deposit funds into a liquidity pool, for example ETH and USDT
● This pool ( a token pair ) allows users to exchange (or maybe lend or borrow) tokens
● Interacting with the exchange incurs fees
● These fees are paid to the liquidity providers
The AMM works according to smart contracts
They are characterised as constant function market makers.
From Constant Function Market Makers
The term “constant function” refers to the fact that any trade must change the reserves in
such a way that the product of those reserves remains unchanged (i.e. equal to a constant).
LP Tokens
Typically the liquidity provider receives LP tokens when they add
liquidity, say ETH and USDT
Later they can take liquidity by providing LP tokens to the contract and
will receive back ETH and USDT.
Ideally they will make a profit
Risks when providing liquidity
● Slippage
○ Large trades can move the price
● Impermanent loss
As a result of volatility
Yield Farming
Yield Farming at its simplest is a means of earning rewards for depositing tokens
Users are rewarded for providing liquidity
Different strategies are used by investors to maximise their rewards from the many DeFi projects
Compound and yearn.finance introduced this area to DeFi
June 2020 - BAT token APY
Aave and Flash loans
Community education : http://extropy.foundation
Extropy.io 2019
Q & A
https://bit.ly/HackAfrica1

More Related Content

Similar to Intro to blockchain

Blockchain Experiments 1-11.pptx
Blockchain Experiments 1-11.pptxBlockchain Experiments 1-11.pptx
Blockchain Experiments 1-11.pptx
saiproject
 
Web3’s red pill: Smashing Web3 transaction simulations for fun and profit
Web3’s red pill: Smashing Web3 transaction simulations for fun and profitWeb3’s red pill: Smashing Web3 transaction simulations for fun and profit
Web3’s red pill: Smashing Web3 transaction simulations for fun and profit
Tal Be'ery
 

Similar to Intro to blockchain (20)

How to design, code, deploy and execute a smart contract
How to design, code, deploy and execute a smart contractHow to design, code, deploy and execute a smart contract
How to design, code, deploy and execute a smart contract
 
Ethereum
EthereumEthereum
Ethereum
 
Ethereum-Cryptocurrency (All about Ethereum)
Ethereum-Cryptocurrency (All about Ethereum) Ethereum-Cryptocurrency (All about Ethereum)
Ethereum-Cryptocurrency (All about Ethereum)
 
Stefano Maestri - Blockchain and smart contracts, what they are and why you s...
Stefano Maestri - Blockchain and smart contracts, what they are and why you s...Stefano Maestri - Blockchain and smart contracts, what they are and why you s...
Stefano Maestri - Blockchain and smart contracts, what they are and why you s...
 
Building Apps with Ethereum Smart Contract
Building Apps with Ethereum Smart ContractBuilding Apps with Ethereum Smart Contract
Building Apps with Ethereum Smart Contract
 
Best practices to build secure smart contracts
Best practices to build secure smart contractsBest practices to build secure smart contracts
Best practices to build secure smart contracts
 
Blockchain Experiments 1-11.pptx
Blockchain Experiments 1-11.pptxBlockchain Experiments 1-11.pptx
Blockchain Experiments 1-11.pptx
 
Attacking and Exploiting Ethereum Smart Contracts: Auditing 101
Attacking and Exploiting Ethereum Smart Contracts: Auditing 101Attacking and Exploiting Ethereum Smart Contracts: Auditing 101
Attacking and Exploiting Ethereum Smart Contracts: Auditing 101
 
10 Best Programming Languages for Blockchain in 2023.pdf
10 Best Programming Languages for Blockchain in 2023.pdf10 Best Programming Languages for Blockchain in 2023.pdf
10 Best Programming Languages for Blockchain in 2023.pdf
 
EOSIO Distributed Application Use Cases
EOSIO Distributed Application Use CasesEOSIO Distributed Application Use Cases
EOSIO Distributed Application Use Cases
 
Programming Decentralized Application
Programming Decentralized ApplicationProgramming Decentralized Application
Programming Decentralized Application
 
Introduction to Ethereum Smart Contracts
Introduction to Ethereum Smart Contracts Introduction to Ethereum Smart Contracts
Introduction to Ethereum Smart Contracts
 
[PyCon Korea 2018] Python in Chains: Running Python Code for IoT Projects on ...
[PyCon Korea 2018] Python in Chains: Running Python Code for IoT Projects on ...[PyCon Korea 2018] Python in Chains: Running Python Code for IoT Projects on ...
[PyCon Korea 2018] Python in Chains: Running Python Code for IoT Projects on ...
 
Introducing Moonbeam: A Smart Contract Parachain with Ethereum Compatibility
Introducing Moonbeam: A Smart Contract Parachain with Ethereum CompatibilityIntroducing Moonbeam: A Smart Contract Parachain with Ethereum Compatibility
Introducing Moonbeam: A Smart Contract Parachain with Ethereum Compatibility
 
RTC2017 Ethereum Workshop
RTC2017 Ethereum WorkshopRTC2017 Ethereum Workshop
RTC2017 Ethereum Workshop
 
20221110 MetaCoin
20221110 MetaCoin20221110 MetaCoin
20221110 MetaCoin
 
Etherium Intro for techies
Etherium Intro for techiesEtherium Intro for techies
Etherium Intro for techies
 
Ergo Hong Kong meetup
Ergo Hong Kong meetupErgo Hong Kong meetup
Ergo Hong Kong meetup
 
Web3’s red pill: Smashing Web3 transaction simulations for fun and profit
Web3’s red pill: Smashing Web3 transaction simulations for fun and profitWeb3’s red pill: Smashing Web3 transaction simulations for fun and profit
Web3’s red pill: Smashing Web3 transaction simulations for fun and profit
 
Evaluation of Ethereum
Evaluation of Ethereum Evaluation of Ethereum
Evaluation of Ethereum
 

More from Vanessa Lošić

Encode polkadot club event 3, technical deepdive
Encode polkadot club   event 3, technical deepdiveEncode polkadot club   event 3, technical deepdive
Encode polkadot club event 3, technical deepdive
Vanessa Lošić
 
Encode polkadot club event 2, intro to polkadot
Encode polkadot club   event 2, intro to polkadotEncode polkadot club   event 2, intro to polkadot
Encode polkadot club event 2, intro to polkadot
Vanessa Lošić
 

More from Vanessa Lošić (20)

Intro to DAOs
Intro to DAOsIntro to DAOs
Intro to DAOs
 
Hack DeFi Ideation
Hack DeFi IdeationHack DeFi Ideation
Hack DeFi Ideation
 
Encode Club Hackathon
Encode Club Hackathon  Encode Club Hackathon
Encode Club Hackathon
 
How fcm-works-v0.1 fc-club-22092021
How fcm-works-v0.1 fc-club-22092021How fcm-works-v0.1 fc-club-22092021
How fcm-works-v0.1 fc-club-22092021
 
Polkadot ideation
Polkadot ideationPolkadot ideation
Polkadot ideation
 
Encode polkadot club
Encode polkadot club  Encode polkadot club
Encode polkadot club
 
Textile
TextileTextile
Textile
 
Encode Club workshop slides
Encode Club workshop slidesEncode Club workshop slides
Encode Club workshop slides
 
Encode polkadot hack intro event
Encode polkadot hack intro eventEncode polkadot hack intro event
Encode polkadot hack intro event
 
Encode
EncodeEncode
Encode
 
Encode Club -_Pinning_Services_-_aug_2021
Encode Club -_Pinning_Services_-_aug_2021Encode Club -_Pinning_Services_-_aug_2021
Encode Club -_Pinning_Services_-_aug_2021
 
Encode Polkadot Club
Encode Polkadot Club   Encode Polkadot Club
Encode Polkadot Club
 
Interlay + Encode
Interlay + EncodeInterlay + Encode
Interlay + Encode
 
Subspace
SubspaceSubspace
Subspace
 
Intro to NFTs
Intro to NFTsIntro to NFTs
Intro to NFTs
 
Introduction to Filecoin
Introduction to Filecoin   Introduction to Filecoin
Introduction to Filecoin
 
Encode polkadot club event 3, technical deepdive
Encode polkadot club   event 3, technical deepdiveEncode polkadot club   event 3, technical deepdive
Encode polkadot club event 3, technical deepdive
 
Encode club introduction_to_libp2p
Encode club introduction_to_libp2pEncode club introduction_to_libp2p
Encode club introduction_to_libp2p
 
Encode polkadot club event 2, intro to polkadot
Encode polkadot club   event 2, intro to polkadotEncode polkadot club   event 2, intro to polkadot
Encode polkadot club event 2, intro to polkadot
 
Hack africa workshop_2_part_one_chilli_chelli
Hack africa workshop_2_part_one_chilli_chelliHack africa workshop_2_part_one_chilli_chelli
Hack africa workshop_2_part_one_chilli_chelli
 

Recently uploaded

Recently uploaded (20)

How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...How world-class product teams are winning in the AI era by CEO and Founder, P...
How world-class product teams are winning in the AI era by CEO and Founder, P...
 
Demystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John StaveleyDemystifying gRPC in .Net by John Staveley
Demystifying gRPC in .Net by John Staveley
 
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
Integrating Telephony Systems with Salesforce: Insights and Considerations, B...
 
Key Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdfKey Trends Shaping the Future of Infrastructure.pdf
Key Trends Shaping the Future of Infrastructure.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3UiPath Test Automation using UiPath Test Suite series, part 3
UiPath Test Automation using UiPath Test Suite series, part 3
 
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
Unsubscribed: Combat Subscription Fatigue With a Membership Mentality by Head...
 
JMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and GrafanaJMeter webinar - integration with InfluxDB and Grafana
JMeter webinar - integration with InfluxDB and Grafana
 
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
From Daily Decisions to Bottom Line: Connecting Product Work to Revenue by VP...
 
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered QualitySoftware Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
Software Delivery At the Speed of AI: Inflectra Invests In AI-Powered Quality
 
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptxIOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
IOS-PENTESTING-BEGINNERS-PRACTICAL-GUIDE-.pptx
 
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
Exploring UiPath Orchestrator API: updates and limits in 2024 🚀
 
IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024IoT Analytics Company Presentation May 2024
IoT Analytics Company Presentation May 2024
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
AI for Every Business: Unlocking Your Product's Universal Potential by VP of ...
 
Assuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyesAssuring Contact Center Experiences for Your Customers With ThousandEyes
Assuring Contact Center Experiences for Your Customers With ThousandEyes
 
UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2UiPath Test Automation using UiPath Test Suite series, part 2
UiPath Test Automation using UiPath Test Suite series, part 2
 
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...
 
Knowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and backKnowledge engineering: from people to machines and back
Knowledge engineering: from people to machines and back
 
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone KomSalesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
Salesforce Adoption – Metrics, Methods, and Motivation, Antone Kom
 
"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi"Impact of front-end architecture on development cost", Viktor Turskyi
"Impact of front-end architecture on development cost", Viktor Turskyi
 

Intro to blockchain