Download as pdf or txt
Download as pdf or txt
You are on page 1of 63

Blockchain and

Decentralized Applications
Understanding and making your first decentralized transaction

Dr. Red Boumghar


red@parametry.ai
Ex-ESA / NASA / ECB
CEO of Parametry.ai
AI, Blockchain and Cloud Intelligence
https://linkedin.com/in/boumghar
@redotics
#BADAUAMYFDT
Disclaimer

All views exposed here are my own, they do not reflect


those of my past, present or future employers,
employees or stakeholders.

Everything presented here is meant for information and


education purposes, there is no financial or investment
advice.

Do your own research and act at your own.


Warnings

I use standard ISO datetime format


YYYY-MM-DD hh:mm:ss

2021-11-30 12:00:00

You can interrupt me anytime!



Why Blockchain – review

Bitcoin – Generation 1
Decentralization and PoW

Ethereum – Generation 2
Smart Contracts

Cardano/Algorand – Generation 3
Scalable and PoS

Hands-On / Let’s do it

Outline
Why Blockchain ?
for Equality
Because Crypto is Cool
Digitalize Finance Fast Transactions (yes/no)
!
yet
, not
Intermediaries
o
N Buy a house in Bali

Interplanetary Economy
Build on newtech
Transparency Trustless environment
Creating new asset classes
because the banker’s manifesto
is all but believing in Humanity

2021-11-11
Red Boumghar – PhD;
parametry.ai 5
Pillars of finance
Euro
USDT
€ Designed by macrovector / Freepik

US$ DAI Lending & Borrowing

Stable Coins Derivatives

Decentralized Exchanges Margin Trading


Insurance

2021-11-11
Red Boumghar – PhD;
parametry.ai 6
Pillars of finance
Centralized Finance Decentralized Finance

CeFi
https://sdw.ecb.europa.eu
vs DeFi
https://defipulse.com

(in kEuros)

200.0B Euros US$ 105.0B

https://coinmarketcap.com
https://app.santiment.net
...
2021-11-11
Red Boumghar – PhD;
parametry.ai 7
-------------------
Bitcoin – Generation 1
2009-01-03
The First 50 bitcoins

2010-05-22
The First Exchange
10000 Bitcoins for 2 Pizzas (US$41)

“Bitcoin’s academic pedigree”


Naraynan & Clark
https://dl.acm.org/doi/10.1145/3132259

2021-11-11
Red Boumghar – PhD;
parametry.ai 9
Bitcoin – Generation 1
UTxO Proof of Work
Unspent Transaction Output with dynamic difficulty
Transaction-Based Ledger via Hash Key ‘brute force’

Foundation of many other projects

2021-11-11
Red Boumghar – PhD;
parametry.ai 10
BITCOIN Decentralization

NODE Relay Network


NODE Information


Block metadata

Transactions Database
Miner NODE
NODE
Get Work To Be Done
getblocktemplate → NODE

2021-11-11
Red Boumghar – PhD;
parametry.ai 11
NODE
BITCOIN network Node

2021-11-11
Red Boumghar – PhD;
parametry.ai 12
https://blockchair.com/bitcoin/block/708800
BITCOIN EXPLORERS

2021-11-11
Red Boumghar – PhD;
parametry.ai 13
BITCOIN MINING - WORK TO BE DONE
bitcoin-cli getblocktemplate '{"rules": ["segwit"]}'

JSON Format

2021-11-11
Red Boumghar – PhD;
parametry.ai 14
Bitcoin mining - work to be done

2021-11-08T18:38:47

2021-11-11
Red Boumghar – PhD;
parametry.ai 15
Bitcoin mining - work to be done

19 Zeros
~ Network Difficulty

The algorithm wants to maintain one block


creation every 10 mins. And adjust this difficulty every 2016 blocks

2021-11-11
Red Boumghar – PhD;
parametry.ai 16
Bitcoin mining - DIFFICULTY

https://www.coinwarz.com/mining/bitcoin/difficulty-chart

Goal is to keep ?!
a constant 10 mins
work per block

People’s Bank of China (PBOC)


issued a notice to a number of
financial institutions concerning
crypto transactions
https://news.bitcoin.com/pboc-instructs-chinas-banks-forbid-all-cryptocurrency-related-activities-immediately/

2021-11-11
Red Boumghar – PhD;
parametry.ai 17
Bitcoin mining

2021-11-11
Red Boumghar – PhD;
parametry.ai 18
BITCOIN MINING – MUTABLE INFORMATION
Header = version + PreviousHash + MerkleRootHash + time + DifficultyBits + Nonce
000000016fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d61900000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f499790466481dac2b7c

Header to be HASHED Integer


Must satisfy the difficulty 4.29B possibilities
n Zeros-starting-hash Few would satisfy the difficulty
Miner must had her/his own
Current mining centers do that
Coinbase transaction
in few seconds
changing the whole merkle tree

2021-11-11
Red Boumghar – PhD;
parametry.ai 19
100%

2021-11-11
Red Boumghar – PhD;
parametry.ai 21
BITCOIN ECONOMICS


Store of Value

Medium of exchange

Unit of account (?)

Scarcity

Producing 6.25 bitcoins
reward every 10 minutes.

2021-11-11
Red Boumghar – PhD;
parametry.ai 22
BITCOIN WRAP-UP
New technology implementations:

UTXO: Unspent Transaction Output

Solving the hash problem

Network difficulty and stakeholders

Not static the protocol evolves by BIP – Bitcoin Improvement Proposals

Requirement for nowadays financial system == 100 000 transactions/second



VISA processes about 24k tx/s, settles 2k tx/s

UNIONPAY processes about 1-k tx/s, settles --k tx/s

MASTERCARD processes about --k tx/s, settles 5k tx/s

Bitcoins makes 1 to 7 tx/s + no need for counterparty risk

2021-11-11
Red Boumghar – PhD;
parametry.ai 23
-------------------
Ethereum – GENERATION 2
https://ethereum.org

Ecosystem for:

Digital currencies

Global payments

Applications

2021-11-11
Red Boumghar – PhD;
parametry.ai 25
ETHEREUM – Generation 2
UTxO Proof of Work
Account/Balance-Based Ledger started moving to
State management Proof of Stake

Foundation of many many many other projects


~ 7000

2021-11-11
Red Boumghar – PhD;
parametry.ai 26
ETHEREUM vs BITCOIN
Points of comparison
Bitcoin Ethereum
Transaction based Ledger Balance based Ledger

1 merkle tree of transactions 4 merkle trees


T CTS
R
1 Turing incomple language 1 native Turing complete language SMANTRA
+ 8 alternative common programming languages
CO
10 mins work / block 14 seconds validation

Proof of Work Proof of Work → Proof of Stake

Nobody had anything Started with a pre-sale

No requirements to participate 32 ETH are necessary


(today about $128 000)
Can be mined Won’t be “mineable” with EIP-3554
2021-11-11
Red Boumghar – PhD;
parametry.ai 27
Proof of stake
Validators (not miners) are randomly selected

… among stakeholders who “locked” at least 32ETH in a stake

Step 1 – Beacon Chain


Step 2 – The merge [difficulty bomb(s)]
Step 3 – The Shard chains

2021-11-11
Red Boumghar – PhD;
parametry.ai 28
SMART CONTRACTS

Not always Smart


And actually just
Digital
Not always really
Smart is the “other name” for
Automation contracts
Promise or Performance
In exchange of a
Promise or performance

2021-11-11
Red Boumghar – PhD;
parametry.ai 29
SMART CONTRACT in REAL

Test and try at home on


https://remix.ethereum.org

2021-11-11
Red Boumghar – PhD;
parametry.ai 30
THE erc20 standard: FUNGIBLE TOKENS
ERC20 is the implementation of EIP20
Ethereum Improvement Proposal >> Ethereum Request for Comments

ERC20 is a Standard to represent any kind of fungible tokens


- divisible
- and all the same in type and value

https://ethereum.org/en/developers/docs/standards/tokens/erc-20/
Example to create your own token: www.tokenmaker.org
2021-11-11
Red Boumghar – PhD;
parametry.ai 31
ERC721: Non-FUNGIBLE TOKENS
ERC721 is the implementation of EIP721
Ethereum Improvement Proposal >> Ethereum Request for Comments

ERC721 is a Standard to represent non-fungible tokens


- Non-divisible
- Unique type and value
- Static Metadata
- Transferrable one at a time
ERC1155 is a Standard to represent non-fungible and fungible tokens
- Metadata is stored off-chain: it is dynamic
- Metadata must be managed by the smart contract
- Can be transferred several at a time

2021-11-11
Red Boumghar – PhD;
parametry.ai 32
PRojects
Euro
USDT
€ Designed by macrovector / Freepik

US$ DAI Lending & Borrowing

Stable Coins Derivatives

Decentralized Exchanges Margin Trading


Insurance

2021-11-11
Red Boumghar – PhD;
parametry.ai 33
Stable coins
Euro
USDT

US$ DAI DAI : Algorithmic stable coin


You mint DAI against you deposits
Stable Coins

USDT: dollar backed stable coin


By Tether company

2021-11-11
Red Boumghar – PhD;
parametry.ai 34
Projects for a new Finance

UNISWAP.org

Autonomous Market Maker


Non-Custodial

KYBER 1 INCH
Decentralized Exchanges Connect liquidity from
different sources to enable
trades at the best rates
2021-11-11
Red Boumghar – PhD;
parametry.ai 35
Lending and borrowing

Designed by macrovector / Freepik


Aave
Lending & Borrowing
Non-Custodial and
Stater.co Open Source
Maker Deposit & Borrow

Borrow ETH by using your NFTS Get/Use/Hold/Accept/Govern


as collaterals DAI

Lend ETH and earn rewards/interest

2021-11-11
Red Boumghar – PhD;
parametry.ai 36
DErivatives

Synthetix
Derivatives

Creation of synthetic assets


(e.g. the sum of bitcoin and ethereum)

Exposure to real world assets

2021-11-11
Red Boumghar – PhD;
parametry.ai 37
Enabling key functions

Smart contracts New applications



Identification The Decentralized

Authorizations Autonomous

Voting Organization

... [DAO]

2021-11-11
Red Boumghar – PhD;
parametry.ai 38
For CUriosity

2021-11-11
Red Boumghar – PhD;
parametry.ai 39
-------------------
GENERATION 3

Ecosystems for: https://cardano.org


Ouroboros Consensus

Native Scalability Capabilities

Native interoperability

Native security and privacy

Complete transaction finality Algorand
https://algorand.com
Pure Proof of Stake™

2021-11-11
Red Boumghar – PhD;
parametry.ai 41
Accessible participation
Built on existing programming language

Cardano Algorand
Haskell Python

500 ADA
for becoming network operator

2021-11-11
Red Boumghar – PhD;
parametry.ai 42
-------------------
Making your own decentralized transaction

1 2 3

Install a wallet Create a key Connect to


a blockchain

Take Actions

2021-11-11
Red Boumghar – PhD;
parametry.ai 44
PRE-REQ – what is a browser

2021-11-11
Red Boumghar – PhD;
parametry.ai 45
Pre-Req Cyber Awareness

Money and assets in your pocket

2021-11-11
Red Boumghar – PhD;
parametry.ai 46
WEB3
Web3
Access to the decentralized web
!=

2021-11-11
Red Boumghar – PhD;
parametry.ai 47
1
INStall a wallet
Wallets are used to send, receive, and store
What’s a wallet ? digital assets like Ether. Wallets come in many
forms. They are either built into your browser,
an extension added to your browser, a piece of
hardware plugged into your computer or even
an app on your phone.
(credits: https://rarible.com)

They are the door to access your assets and


rights on the blockchain. The managers of your
private key and portfolio manager of your
blockchain addresses.
Some wallets are multiblockchain, some are
ERC20 compatible only.

2021-11-11
Red Boumghar – PhD;
parametry.ai 48
1
INStall a wallet
You can your mind later,
your wallet is not attached to the technology
Your private key is.

rarible.com uniswap.org kyber.org


2021-11-11
Red Boumghar – PhD;
parametry.ai 49
Install a wallet

https://metamask.io

2021-11-11
Red Boumghar – PhD;
parametry.ai 50
2
Create a key

https://metamask.io/

2021-11-11
Red Boumghar – PhD;
parametry.ai 51
2
Create a key

2021-11-11
Red Boumghar – PhD;
parametry.ai 52
2
Create a key

2021-11-11
Red Boumghar – PhD;
parametry.ai 53
2
Create a key

2021-11-11
Red Boumghar – PhD;
parametry.ai 54
2
Create a key

2021-11-11
Red Boumghar – PhD;
parametry.ai 55
2
Create a key

2021-11-11
Red Boumghar – PhD;
parametry.ai 56
3
Connect/Switch blockchain

Accounts
List

Connected
Blockchain

2021-11-11
Red Boumghar – PhD;
parametry.ai 57
3
Connect/Switch blockchain

2021-11-11
Red Boumghar – PhD;
parametry.ai 58
4
Take actions
Create an additional account
Externally Owned Address (vs Contract Addresses)

2021-11-11
Red Boumghar – PhD;
parametry.ai 59
4
Take actions

Faucet concept of TestNets

https://faucet.ropsten.be/

2021-11-11
Red Boumghar – PhD;
parametry.ai 60
4
LET’s INTERACT

COPY/PASTE YOUR ETHEREUM ADDRESSES HERE:


https://hackmd.io/@redotics/a/edit

2021-11-11
Red Boumghar – PhD;
parametry.ai 61
4
GO TO UNISWAP.ORG

www.uniswap.org
is a Dapp
A Decentralized Application

Can you receive/send bitcoins to your adresses ?

2021-11-11
Red Boumghar – PhD;
parametry.ai 62
-------------------
Dr. Red Boumghar
red@parametry.ai
https://linkedin.com/in/boumghar
SUMMARY
@redotics

Generation 1 Generation 2

Bitcoin Proof of Work 
Proof of Stake

Hash challenge 
Protocol standards for

Network Difficulty Tokens and NFTs

Smart Contracts

Many projects
Generation 3

Native Proof of Stake Managing your wallet

Scalibity 
Initialization

Security and Privacy 
Using DApps

2021-11-11
Red Boumghar – PhD;
parametry.ai 64

You might also like