SlideShare une entreprise Scribd logo
1  sur  67
Crypto &
Digital Currencies
in a nutshell
Tal Shmueli
All rights reserved ©
Why Crypto?
● Information Security Paranoia
Why Crypto?
● IP theft protection (not just legally)
Why Crypto? Ransomware!
Why Crypto?
● Encryption can be done (almost) without any resources,
unlike breaking it (pre quantum computing era).
● Future Commerce (digital coins)
Plan
● Bitcoin (DigCurr)
○ History & Background
○ Characters (miners, coders, investors, etc.)
○ General mechanism & Blockchain
● Symmetric Crypto algorithms
● Asymmetric Crypto algorithms (Public Key Enc.)
○ RSA (/Diffie Helman), Digit. Sign., Keys exchange
● “Breaking crypto” difficulty
● Litecoin vs. Bitcoin (vs. Ether maybe ..)
● Practice -
○ Open&Secure wallets, Transfer money (Fees explained)
○ Wallet types - hosted to hardware
○ Leading exchanges
○ Tips to manage account & payments
Plan #2 (Bonus)
● Segwit & Lightning (MIT?)
● Zero Knowledge Proofs (ZKP) & Zerocoin
● Homomorphic encryption
Intro
Intro
(G)Mail is secure, isn’t it? NO!
(G)Mail is secure, isn’t it? NO!
● https://www.google.com/transparencyreport/saferemail/faq/
Some Crypto Fun
What is Bitcoin?
● A protocol that supports a decentralized, pseudo-anonymous,
peer-to-peer digital currency.
● A publicly disclosed linked ledger of transactions stored in a
blockchain
● A reward driven system for achieving consensus (mining)
based on “Proofs of Work” for helping to secure the network
● It’s the first example of a growing category of money known
as cryptocurrency.
What is Bitcoin?
Bitcoin - About
● A person called Satoshi Nakamoto proposed bitcoin,
which was an electronic payment system based on
mathematical proofs. The idea was to produce a currency
independent of any central authority, transferable
electronically, more or less instantly, with very low
transaction fees.
Bitcoin - History
● 18/08/08 - Domain name “bitcoin.org” registered.
● 31/10/08 - an individual or group writing under the name of Satoshi
Nakamoto published a paper entitled “Bitcoin: A Peer-To-Peer
Electronic Cash System”.
● 09/11/08 - Bitcoin project registered at SourceForge.net
● 12/01/09 - First Bitcoin transaction in block 170 (Satoshi -> Hal
Finney).
● 05/10/09 - xchng rates published by NLiberty Std. 1$ = 1309.03BTC
● 11/2013 - BTC price hits 1000$ (1USD=1mBTC) first in Mt. Gox
Bitcoin - History
Bitcoin - Characters
● Core developers
○ https://github.com/bitcoin/bitcoin
● Mining pools
○ https://en.bitcoin.it/wiki/Comparison_of_mining_pools
● Exchanges
○ https://bitcoin.org/en/exchanges
● Wallet hosts
○ https://bitcoin.org/en/choose-your-wallet
Bitcoin - Characters
● Bussineses
○ ‫עסקים‬‫תומכי‬‫ביטקוין‬‫בישרא‬‫ל‬
● Investors
● Criminals
○ Silk Road (drugs and more)
○ Ransomware
○ Automotive Cars?
Bitcoin - Features
● Supporting eight decimal places 0.00000001 (known as a
Satoshi or Noncent*)
● Nominal transaction fee’s paid to the network
○ Same cost to send $.01 as $1,000,000
● Consensus driven – no central authority
● Fake resilient
○ Cannot add coins arbitrarily
○ Cannot be double-spent
•Non-repudiation – aka “gone baby gone” – no recourse and no
one to appeal to return sent tokens
Bitcoin - Decentralized
● The “digital wallet” operates in a peer to peer mode
● When it starts it bootstraps to find other wallets
● The wallet will synchronize with the network by
downloading ALL of the transactions starting from the
GENESIS block if necessary
○ 472375 blocks at time of slide prep
○ >22 GB
● Wallet clients share all transaction information with their
peers.
Bitcoin - Pseudo Anonymous
● Using public key cryptography, specifically Elliptic Curve
Cryptography due to its key strength and shorter keys
(Quantum res.)
● Transactions are sent to public key “addresses” (not names!)
● Why pseudo then? (Mixers)
● Criminals appraoch
Bitcoin - General Mechanism
Hashing & Public key intro
● Hashing
○ A hash function is any function that can be used to map data of arbitrary
size to data of fixed size. The values returned by a hash function are called
hash values, hash codes, digests, or simply hashes
● Example
Hashing & Public key intro
● Public key Encryption (PKE)
○ Public key cryptography, or asymmetric cryptography, is any cryptographic
system that uses pairs of keys: public keys which may be disseminated
widely, and private keys which are known only to the owner.
● Private and Public keys generated together.
● Used for Authentication and Encryption
● How does it works?! (DH, RSA, Later ..)
● Example
Digital Sign. intro
● Simple!
● Uses both Hashing and Public key Encryption (PKE)
● BTC uses the improved Elliptic Curve Digital Signature Algorithm
or ECDSA
● Why hashing?
Blockchain
● Bitcoin uses cryptographic proof instead of the trust in the third
party (PayPal, Banks ..)
● Each transaction is protected through a digital signature.
● Each transaction is sent to the “public key” of the receiver signed
using the sender “private key”.
● The ownership is verified using the sender “public key”.
● Each transaction is broadcast to every node in the Bitcoin
network and is recorded to a public ledger after verification.
Blockchain
● Before a transaction is recorded to the public ledger, veryfing
node ensures -
○ Spender owns the cryptocurrency—digital signature
verification on the transaction.
○ Spender has sufficient cryptocurrency in his/her account:
checking every transaction against spender’s account
(“public key”) in the ledger to make sure that he/she has
sufficient balance in his/her account.
Blockchain
● The Bitcoin system orders transactions by placing them in groups
called blocks and then linking these blocks through what is called
Blockchain (SHA256 Hashes)
● How does the network decide which block should be next in the
blockchain? Who sets the order?
○ There can be multiple blocks created by different nodes at
the same time.
Blockchain - block order
● How to maintain the order of the transactions that are broadcast
to every node in the bitcoin p2p network ?
○ The system has to make sure that double-spending of the
cryptocurrency does not occur.
Blockchain - block order
Blockchain - block order
● ​Mathematical Puzzel (“Proof of work”)
○ Node generating a block needs to prove that it has put
enough computing resources to solve a mathematical puzzle
Blockchain - block order
● ​Mathematical Puzzel (“Proof of work”)
○ Small probability that more than one block will be generated
in the system at a given time.
○ Occasionally, however, more than one block will be solved at
the same time, leading to several possible branches.
○ The “Miner nodes” are financially awarded for their efforts.
Blockchain -target
● Although the accepted chain can be considered a list, the
block chain is best represented with a tree.
● The longest path represents the accepted chain.
● A participant choosing to extend an existing path in the
block chain indicates a vote towards consensus on that
path. The longer the path, the more computation was
expended building it.
Blockchain - block order
●
Blockchain -target
● Also nickamed as “Leading Zeros” target
● The target is a 256-bit number (extremely large) that all Bitcoin clients share​.
● The SHA-256 hash of a block's header must be lower than or equal to the
current target for the block to be accepted by the network.
● The lower the target, the more difficult it is to generate a block
(https://bitcoinwisdom.com/bitcoin/difficulty)
● Every 2016 blocks (~two weeks), every Bitcoin client compares the actual time
it took to generate these blocks with the two week goal and modifies the target
by the percentage difference.
Bitcoin Mining
● Example
Bitcoin - Overview
Bitcoin - Overview
EXAMPLE?
Bitcoin - Alone?
LiteCoin
● Created by Charlie Lee, a former Google employee
● While inspired by, and in most regards technically nearly
identical to Bitcoin (BTC)
● Litecoin has some technical improvements over Bitcoin
LiteCoin
LiteCoin - Segwit
● SegWit increases Litecoin block size limit and allows the
implementation of the second-layer solutions for further
improvement.
● blocks have a hard-coded limit of one megabyte.
● Not enough to account for the hundreds of transactions that
the users are trying to send every minute.
● In May 2017, Litecoin became the first of the top-5 (by
market cap) cryptocurrencies to adopt Segregated Witness
LiteCoin - Segwit- transaction malleability
● While transactions are signed, the signature does not
currently cover all the data in a transaction that is hashed to
create the transaction hash. Thus, while uncommon, it is
possible for a node on the network to change a transaction
you send in such a way that the hash is invalidated.
● It’s not safe to accept a chain of unconfirmed transactions
under any circumstance.
BITCOIN
QUESTIONS?
Background
● (Claude Elwood) Shannon cipher
○ K - set of all keys (Key space)
○ M - set of all messages (Message space)
○ C - set of all ciphertexts (Ciphertext space)
○ A Shannon cipher is a pair x = (E,D) of functions.
■ E : K x M ⇥ C, D : K x C ⇥ M
■ E(k,m) = c
■ D(k, E(k, m)) = m
Background
● One time pad (Fixed Length)
○ x = (E,D), where the keys, messages, and ciphers are bit strings of the same
length.
○ x is defined over (K, M, C) where :
■ K := M := C := {0, 1}^L
○ For fixed L, key k in K, message m in M, the encryption function is defined
as and for k in K, and cipher c in C, the decryption function
is defined as follows
Background
● One time pad (Variable Length)
● .
● .
● .
● One time pad satisfies the definition of perfect security
● Not practical (|key| >= |message|)
Background
● Perfect Security (Definition) :
○ Let x = (E,D) be a shannon cipher defined over (K, M,
C). Consider a probabilistic experiment in which the
random variable k is uniformly distributed over K. If for
all m0, m1 in M and all c in C we have :
Then we say that x is perfectly secure Shannon cipher
Background
● Perfect Security - Bad news!
● Shannons Theorem
○ Let x = (E, D) be a shannon cipher defined over (K, M,
C).
○ If x is perfectly secure, then |K| >= |M|
● Proof (easy..)
Symetric Encryption
Symetric Encryption - Stream Cipher
● We would like to use a key that is much shorter
● The ‘key’ is stretched using efficient, deterministic algorithm
G that maps l-bit strings to L-bit strings.
● Key space - {0,1}^l
● Message and Cipher spaces are - {0,1}^L
● Enc & Dec defined as follows -
Symetric Encryption - Stream Cipher
● PRG - pseudo-random generator
○ An efficient, deterministic algorithm G that, given as an
input a seed s (in Seed Space), computes an output r
(Output Space)
○ def. of security for PRG - no efficient adversary can
effectively tell the difference between G(s) and r, for
ransom chosen s and r from S, R respectively.
“Two Time Pad” - Insecure
● A stream cipher is well equipped to encrypt single message
from Alice to Bob.
● Alice, however may wish to send several messages to Bob.
● An adversary (intercepts c1, c2) can compute
● English text is redundant the adversary can recover both.
Symetric Encryption - Block Cipher
● Digital Encryption Standard (DES) − The popular block cipher of the 1990s. It is
now considered as a ‘broken’ block cipher, due primarily to its small key size.
● Triple DES − It is a variant scheme based on repeated DES applications. It is still
a respected block ciphers but inefficient compared to the new faster block ciphers
available.
● Advanced Encryption Standard (AES) − It is a relatively new block cipher based
on the encryption algorithm Rijndael that won the AES design competition.
Asymetric Encryption
● Public Key Cryptography involves -
○ a public key, which may be known by anybody, and can
be used to encrypt messages, and verify signatures.
○ a private key, known only to the recipient, used to
decrypt messages, and sign (create) signatures.
Asymetric Encryption
Asymetric Encryption
● Public Key Applications -
○ encryption/decryption (secrecy)
○ digital signature (authentication)
○ key exchange (session keys)
● Some algorithms are suitable for all uses, others are specific
to one.
● Given public key, it should be “impossible” to compute
priavte key.
RSA (Rivest, Shamir, Adelson) Algorithm
RSA (Rivest, Shamir, Adelson) Algorithm
1. Choose two large prime numbers p, q (e.g., 1024 bits each)
2. Compute n = p * q, z = (p-1)(q-1) (Euler function).
3. Choose e (e<n) that has no common factors with z (gcd(e,
z) = =1)
4. Choose d such that e*d-1 is exactly divisable by z (e*d mod
z = 1)
5. Public Key - (n,e). Private Key - (n, d).
RSA (Rivest, Shamir, Adelson) Algorithm
1. Encryption & Decryption
a. Given (n,e) and (n,d) as computed above
b. To encrypt bit pattern m
i. Compute c = m^e mod n
c. To decrypt received pattern c
i. Compute m = c^d mon n
m = (m^e mod n)^d mod n
RSA (Rivest, Shamir, Adelson) Algorithm
Digital Signature
● Cryptographic technique ananlogues to hand-written
signatures.
○ Sender (Bob) digitally signs document, establishing
he is document owner.
○ Verifiable, Nonforgeable: Reciepent (Alice) can
prove someone that Bob, and no one else, must have
signed the document.
Digital Signature
Key Distribution
● Symetric Key problem - How do two entities establish a
shared secret key over network?
○ Key Distribution Center (KDC)
● Public Key problem - When Alice obtains Bob’s public key,
how does she know that it’s authentic?
○ Certificate Authority (CA)
Key Ditribution - KDC
Key Ditribution - CA
● Certificate Authority binds public key to particular entity.
● Entity registers its public key with CA.

Contenu connexe

Tendances

Bitcoin: The Internet of Money
Bitcoin: The Internet of MoneyBitcoin: The Internet of Money
Bitcoin: The Internet of Moneywinklevosscap
 
What Are Crypto Tokens & How Crypto Tokens Work?
What Are Crypto Tokens & How Crypto Tokens Work?What Are Crypto Tokens & How Crypto Tokens Work?
What Are Crypto Tokens & How Crypto Tokens Work?Blockchain Council
 
Crypto currencies presentation by Dr. Andre Gholam
Crypto currencies presentation by Dr. Andre GholamCrypto currencies presentation by Dr. Andre Gholam
Crypto currencies presentation by Dr. Andre GholamPMILebanonChapter
 
Cryptocurrency
CryptocurrencyCryptocurrency
CryptocurrencyMZain17
 
All about Cryptocurrency
All about CryptocurrencyAll about Cryptocurrency
All about CryptocurrencyJATIN MITTAL
 
Understanding Cryptocurrency
Understanding CryptocurrencyUnderstanding Cryptocurrency
Understanding CryptocurrencyKapil Gupta
 
Introduction to Cryptocurrency (Bitcoin)
Introduction to Cryptocurrency (Bitcoin)Introduction to Cryptocurrency (Bitcoin)
Introduction to Cryptocurrency (Bitcoin)Kashif Khans
 
What is Cryptocurrency?
What is Cryptocurrency?What is Cryptocurrency?
What is Cryptocurrency?Rakesh Ranjan
 
Blockchain and Cryptocurrencies
Blockchain and CryptocurrenciesBlockchain and Cryptocurrencies
Blockchain and CryptocurrenciesnimeshQ
 
Binance Cryptocurrency Trading Guide
Binance Cryptocurrency Trading GuideBinance Cryptocurrency Trading Guide
Binance Cryptocurrency Trading GuideramadanSalman
 
Introduction to bitcoin
Introduction to bitcoinIntroduction to bitcoin
Introduction to bitcoinWolf McNally
 

Tendances (20)

Bitcoin: The Internet of Money
Bitcoin: The Internet of MoneyBitcoin: The Internet of Money
Bitcoin: The Internet of Money
 
Cryptocurrency
CryptocurrencyCryptocurrency
Cryptocurrency
 
What Are Crypto Tokens & How Crypto Tokens Work?
What Are Crypto Tokens & How Crypto Tokens Work?What Are Crypto Tokens & How Crypto Tokens Work?
What Are Crypto Tokens & How Crypto Tokens Work?
 
What's cryptocurrency ?
What's cryptocurrency ?What's cryptocurrency ?
What's cryptocurrency ?
 
Crypto currencies presentation by Dr. Andre Gholam
Crypto currencies presentation by Dr. Andre GholamCrypto currencies presentation by Dr. Andre Gholam
Crypto currencies presentation by Dr. Andre Gholam
 
Introduction Bitcoin
Introduction BitcoinIntroduction Bitcoin
Introduction Bitcoin
 
Cryptocurrency
CryptocurrencyCryptocurrency
Cryptocurrency
 
All about Cryptocurrency
All about CryptocurrencyAll about Cryptocurrency
All about Cryptocurrency
 
Understanding Cryptocurrency
Understanding CryptocurrencyUnderstanding Cryptocurrency
Understanding Cryptocurrency
 
Introduction to Cryptocurrency (Bitcoin)
Introduction to Cryptocurrency (Bitcoin)Introduction to Cryptocurrency (Bitcoin)
Introduction to Cryptocurrency (Bitcoin)
 
What is Cryptocurrency?
What is Cryptocurrency?What is Cryptocurrency?
What is Cryptocurrency?
 
Blockchain and Cryptocurrencies
Blockchain and CryptocurrenciesBlockchain and Cryptocurrencies
Blockchain and Cryptocurrencies
 
Cryptocurrency
Cryptocurrency Cryptocurrency
Cryptocurrency
 
Crypto 101
Crypto 101Crypto 101
Crypto 101
 
Crypto currency
Crypto currencyCrypto currency
Crypto currency
 
Binance Cryptocurrency Trading Guide
Binance Cryptocurrency Trading GuideBinance Cryptocurrency Trading Guide
Binance Cryptocurrency Trading Guide
 
All about Bitcoins!
All about Bitcoins!All about Bitcoins!
All about Bitcoins!
 
Cryptocurrency
CryptocurrencyCryptocurrency
Cryptocurrency
 
Cryptocurrency
CryptocurrencyCryptocurrency
Cryptocurrency
 
Introduction to bitcoin
Introduction to bitcoinIntroduction to bitcoin
Introduction to bitcoin
 

Similaire à Crypto & Crpyocurrencies Intro

Intro to Blockchain Slides
Intro to Blockchain SlidesIntro to Blockchain Slides
Intro to Blockchain SlidesShannon Wells
 
Bitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the HoodBitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the HoodGalin Dinkov
 
Blockchan For Developers
Blockchan For DevelopersBlockchan For Developers
Blockchan For DevelopersAlex Chepurnoy
 
Blockchain with scala
Blockchain with scalaBlockchain with scala
Blockchain with scalaHongchao Liu
 
Bitclamp - A Permanent and Anonymous Publishing Platform Over Bitcoin
Bitclamp - A Permanent and Anonymous Publishing Platform Over BitcoinBitclamp - A Permanent and Anonymous Publishing Platform Over Bitcoin
Bitclamp - A Permanent and Anonymous Publishing Platform Over BitcoinBSidesROC
 
Proof-of-Stake & Its Improvements (San Francisco Bitcoin Devs Hackathon)
Proof-of-Stake & Its Improvements (San Francisco Bitcoin Devs Hackathon)Proof-of-Stake & Its Improvements (San Francisco Bitcoin Devs Hackathon)
Proof-of-Stake & Its Improvements (San Francisco Bitcoin Devs Hackathon)Alex Chepurnoy
 
Blockchain, bitcoin, ethereum and ICOs
Blockchain, bitcoin, ethereum and ICOsBlockchain, bitcoin, ethereum and ICOs
Blockchain, bitcoin, ethereum and ICOsBogdan Fiedur
 
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 contractsGautam Anand
 
Blockchain 101
Blockchain 101Blockchain 101
Blockchain 101Oded Noam
 
Bitcoins: Application of blockchain technology
Bitcoins: Application of blockchain technologyBitcoins: Application of blockchain technology
Bitcoins: Application of blockchain technologyShiv Sahni
 
Blockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentationBlockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentationPaperchain
 
Total privacy of transactions, Mimblewimble and Grin
Total privacy of transactions, Mimblewimble and GrinTotal privacy of transactions, Mimblewimble and Grin
Total privacy of transactions, Mimblewimble and GrinEugene Pavlenko
 
Blockchain and Bitcoin
Blockchain and BitcoinBlockchain and Bitcoin
Blockchain and BitcoinHugo Rodrigues
 
How to Build Your Own Blockchain
How to Build Your Own BlockchainHow to Build Your Own Blockchain
How to Build Your Own BlockchainLeonid Beder
 
New Business Models enabled by Blockchain
New Business Models enabled by BlockchainNew Business Models enabled by Blockchain
New Business Models enabled by BlockchainSlash
 
Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)
Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)
Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)Alex Chepurnoy
 
Introduction to Bitcoin for programmers
Introduction to Bitcoin for programmersIntroduction to Bitcoin for programmers
Introduction to Bitcoin for programmersWojciech Langiewicz
 

Similaire à Crypto & Crpyocurrencies Intro (20)

Intro to Blockchain Slides
Intro to Blockchain SlidesIntro to Blockchain Slides
Intro to Blockchain Slides
 
Bitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the HoodBitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the Hood
 
Tmc mastering bitcoins ppt
Tmc mastering bitcoins pptTmc mastering bitcoins ppt
Tmc mastering bitcoins ppt
 
Blockchan For Developers
Blockchan For DevelopersBlockchan For Developers
Blockchan For Developers
 
Blockchain introduction
Blockchain introductionBlockchain introduction
Blockchain introduction
 
Blockchain with scala
Blockchain with scalaBlockchain with scala
Blockchain with scala
 
Bitclamp - A Permanent and Anonymous Publishing Platform Over Bitcoin
Bitclamp - A Permanent and Anonymous Publishing Platform Over BitcoinBitclamp - A Permanent and Anonymous Publishing Platform Over Bitcoin
Bitclamp - A Permanent and Anonymous Publishing Platform Over Bitcoin
 
Proof-of-Stake & Its Improvements (San Francisco Bitcoin Devs Hackathon)
Proof-of-Stake & Its Improvements (San Francisco Bitcoin Devs Hackathon)Proof-of-Stake & Its Improvements (San Francisco Bitcoin Devs Hackathon)
Proof-of-Stake & Its Improvements (San Francisco Bitcoin Devs Hackathon)
 
Blockchain, bitcoin, ethereum and ICOs
Blockchain, bitcoin, ethereum and ICOsBlockchain, bitcoin, ethereum and ICOs
Blockchain, bitcoin, ethereum and ICOs
 
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 101
Blockchain 101Blockchain 101
Blockchain 101
 
Bitcoins: Application of blockchain technology
Bitcoins: Application of blockchain technologyBitcoins: Application of blockchain technology
Bitcoins: Application of blockchain technology
 
Blockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentationBlockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentation
 
Total privacy of transactions, Mimblewimble and Grin
Total privacy of transactions, Mimblewimble and GrinTotal privacy of transactions, Mimblewimble and Grin
Total privacy of transactions, Mimblewimble and Grin
 
Blockchain and Bitcoin
Blockchain and BitcoinBlockchain and Bitcoin
Blockchain and Bitcoin
 
Ethereum overview
Ethereum overviewEthereum overview
Ethereum overview
 
How to Build Your Own Blockchain
How to Build Your Own BlockchainHow to Build Your Own Blockchain
How to Build Your Own Blockchain
 
New Business Models enabled by Blockchain
New Business Models enabled by BlockchainNew Business Models enabled by Blockchain
New Business Models enabled by Blockchain
 
Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)
Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)
Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)
 
Introduction to Bitcoin for programmers
Introduction to Bitcoin for programmersIntroduction to Bitcoin for programmers
Introduction to Bitcoin for programmers
 

Dernier

Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapRishantSharmaFr
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Servicemeghakumariji156
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxNadaHaitham1
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdfKamal Acharya
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxJuliansyahHarahap1
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxMuhammadAsimMuhammad6
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Arindam Chakraborty, Ph.D., P.E. (CA, TX)
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesMayuraD1
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayEpec Engineered Technologies
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdfAldoGarca30
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.Kamal Acharya
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...drmkjayanthikannan
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Call Girls Mumbai
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptDineshKumar4165
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdfKamal Acharya
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilVinayVitekari
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxSCMS School of Architecture
 

Dernier (20)

Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best ServiceTamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
Tamil Call Girls Bhayandar WhatsApp +91-9930687706, Best Service
 
Wadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptxWadi Rum luxhotel lodge Analysis case study.pptx
Wadi Rum luxhotel lodge Analysis case study.pptx
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptxOrlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
Orlando’s Arnold Palmer Hospital Layout Strategy-1.pptx
 
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
Call Girls in South Ex (delhi) call me [🔝9953056974🔝] escort service 24X7
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak HamilCara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
Cara Menggugurkan Sperma Yang Masuk Rahim Biyar Tidak Hamil
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
Standard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power PlayStandard vs Custom Battery Packs - Decoding the Power Play
Standard vs Custom Battery Packs - Decoding the Power Play
 
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
1_Introduction + EAM Vocabulary + how to navigate in EAM.pdf
 
Employee leave management system project.
Employee leave management system project.Employee leave management system project.
Employee leave management system project.
 
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
Unit 4_Part 1 CSE2001 Exception Handling and Function Template and Class Temp...
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
Bhubaneswar🌹Call Girls Bhubaneswar ❤Komal 9777949614 💟 Full Trusted CALL GIRL...
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Moment Distribution Method For Btech Civil
Moment Distribution Method For Btech CivilMoment Distribution Method For Btech Civil
Moment Distribution Method For Btech Civil
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 

Crypto & Crpyocurrencies Intro

  • 1. Crypto & Digital Currencies in a nutshell Tal Shmueli All rights reserved ©
  • 2. Why Crypto? ● Information Security Paranoia
  • 3. Why Crypto? ● IP theft protection (not just legally)
  • 5. Why Crypto? ● Encryption can be done (almost) without any resources, unlike breaking it (pre quantum computing era). ● Future Commerce (digital coins)
  • 6. Plan ● Bitcoin (DigCurr) ○ History & Background ○ Characters (miners, coders, investors, etc.) ○ General mechanism & Blockchain ● Symmetric Crypto algorithms ● Asymmetric Crypto algorithms (Public Key Enc.) ○ RSA (/Diffie Helman), Digit. Sign., Keys exchange ● “Breaking crypto” difficulty ● Litecoin vs. Bitcoin (vs. Ether maybe ..) ● Practice - ○ Open&Secure wallets, Transfer money (Fees explained) ○ Wallet types - hosted to hardware ○ Leading exchanges ○ Tips to manage account & payments
  • 7. Plan #2 (Bonus) ● Segwit & Lightning (MIT?) ● Zero Knowledge Proofs (ZKP) & Zerocoin ● Homomorphic encryption
  • 10. (G)Mail is secure, isn’t it? NO!
  • 11. (G)Mail is secure, isn’t it? NO! ● https://www.google.com/transparencyreport/saferemail/faq/
  • 13. What is Bitcoin? ● A protocol that supports a decentralized, pseudo-anonymous, peer-to-peer digital currency. ● A publicly disclosed linked ledger of transactions stored in a blockchain ● A reward driven system for achieving consensus (mining) based on “Proofs of Work” for helping to secure the network ● It’s the first example of a growing category of money known as cryptocurrency.
  • 15. Bitcoin - About ● A person called Satoshi Nakamoto proposed bitcoin, which was an electronic payment system based on mathematical proofs. The idea was to produce a currency independent of any central authority, transferable electronically, more or less instantly, with very low transaction fees.
  • 16. Bitcoin - History ● 18/08/08 - Domain name “bitcoin.org” registered. ● 31/10/08 - an individual or group writing under the name of Satoshi Nakamoto published a paper entitled “Bitcoin: A Peer-To-Peer Electronic Cash System”. ● 09/11/08 - Bitcoin project registered at SourceForge.net ● 12/01/09 - First Bitcoin transaction in block 170 (Satoshi -> Hal Finney). ● 05/10/09 - xchng rates published by NLiberty Std. 1$ = 1309.03BTC ● 11/2013 - BTC price hits 1000$ (1USD=1mBTC) first in Mt. Gox
  • 18. Bitcoin - Characters ● Core developers ○ https://github.com/bitcoin/bitcoin ● Mining pools ○ https://en.bitcoin.it/wiki/Comparison_of_mining_pools ● Exchanges ○ https://bitcoin.org/en/exchanges ● Wallet hosts ○ https://bitcoin.org/en/choose-your-wallet
  • 19. Bitcoin - Characters ● Bussineses ○ ‫עסקים‬‫תומכי‬‫ביטקוין‬‫בישרא‬‫ל‬ ● Investors ● Criminals ○ Silk Road (drugs and more) ○ Ransomware ○ Automotive Cars?
  • 20. Bitcoin - Features ● Supporting eight decimal places 0.00000001 (known as a Satoshi or Noncent*) ● Nominal transaction fee’s paid to the network ○ Same cost to send $.01 as $1,000,000 ● Consensus driven – no central authority ● Fake resilient ○ Cannot add coins arbitrarily ○ Cannot be double-spent •Non-repudiation – aka “gone baby gone” – no recourse and no one to appeal to return sent tokens
  • 21. Bitcoin - Decentralized ● The “digital wallet” operates in a peer to peer mode ● When it starts it bootstraps to find other wallets ● The wallet will synchronize with the network by downloading ALL of the transactions starting from the GENESIS block if necessary ○ 472375 blocks at time of slide prep ○ >22 GB ● Wallet clients share all transaction information with their peers.
  • 22. Bitcoin - Pseudo Anonymous ● Using public key cryptography, specifically Elliptic Curve Cryptography due to its key strength and shorter keys (Quantum res.) ● Transactions are sent to public key “addresses” (not names!) ● Why pseudo then? (Mixers) ● Criminals appraoch
  • 23. Bitcoin - General Mechanism
  • 24. Hashing & Public key intro ● Hashing ○ A hash function is any function that can be used to map data of arbitrary size to data of fixed size. The values returned by a hash function are called hash values, hash codes, digests, or simply hashes ● Example
  • 25. Hashing & Public key intro ● Public key Encryption (PKE) ○ Public key cryptography, or asymmetric cryptography, is any cryptographic system that uses pairs of keys: public keys which may be disseminated widely, and private keys which are known only to the owner. ● Private and Public keys generated together. ● Used for Authentication and Encryption ● How does it works?! (DH, RSA, Later ..) ● Example
  • 26. Digital Sign. intro ● Simple! ● Uses both Hashing and Public key Encryption (PKE) ● BTC uses the improved Elliptic Curve Digital Signature Algorithm or ECDSA ● Why hashing?
  • 27. Blockchain ● Bitcoin uses cryptographic proof instead of the trust in the third party (PayPal, Banks ..) ● Each transaction is protected through a digital signature. ● Each transaction is sent to the “public key” of the receiver signed using the sender “private key”. ● The ownership is verified using the sender “public key”. ● Each transaction is broadcast to every node in the Bitcoin network and is recorded to a public ledger after verification.
  • 28. Blockchain ● Before a transaction is recorded to the public ledger, veryfing node ensures - ○ Spender owns the cryptocurrency—digital signature verification on the transaction. ○ Spender has sufficient cryptocurrency in his/her account: checking every transaction against spender’s account (“public key”) in the ledger to make sure that he/she has sufficient balance in his/her account.
  • 29. Blockchain ● The Bitcoin system orders transactions by placing them in groups called blocks and then linking these blocks through what is called Blockchain (SHA256 Hashes) ● How does the network decide which block should be next in the blockchain? Who sets the order? ○ There can be multiple blocks created by different nodes at the same time.
  • 30. Blockchain - block order ● How to maintain the order of the transactions that are broadcast to every node in the bitcoin p2p network ? ○ The system has to make sure that double-spending of the cryptocurrency does not occur.
  • 32. Blockchain - block order ● ​Mathematical Puzzel (“Proof of work”) ○ Node generating a block needs to prove that it has put enough computing resources to solve a mathematical puzzle
  • 33. Blockchain - block order ● ​Mathematical Puzzel (“Proof of work”) ○ Small probability that more than one block will be generated in the system at a given time. ○ Occasionally, however, more than one block will be solved at the same time, leading to several possible branches. ○ The “Miner nodes” are financially awarded for their efforts.
  • 34. Blockchain -target ● Although the accepted chain can be considered a list, the block chain is best represented with a tree. ● The longest path represents the accepted chain. ● A participant choosing to extend an existing path in the block chain indicates a vote towards consensus on that path. The longer the path, the more computation was expended building it.
  • 35. Blockchain - block order ●
  • 36. Blockchain -target ● Also nickamed as “Leading Zeros” target ● The target is a 256-bit number (extremely large) that all Bitcoin clients share​. ● The SHA-256 hash of a block's header must be lower than or equal to the current target for the block to be accepted by the network. ● The lower the target, the more difficult it is to generate a block (https://bitcoinwisdom.com/bitcoin/difficulty) ● Every 2016 blocks (~two weeks), every Bitcoin client compares the actual time it took to generate these blocks with the two week goal and modifies the target by the percentage difference.
  • 41. LiteCoin ● Created by Charlie Lee, a former Google employee ● While inspired by, and in most regards technically nearly identical to Bitcoin (BTC) ● Litecoin has some technical improvements over Bitcoin
  • 43. LiteCoin - Segwit ● SegWit increases Litecoin block size limit and allows the implementation of the second-layer solutions for further improvement. ● blocks have a hard-coded limit of one megabyte. ● Not enough to account for the hundreds of transactions that the users are trying to send every minute. ● In May 2017, Litecoin became the first of the top-5 (by market cap) cryptocurrencies to adopt Segregated Witness
  • 44. LiteCoin - Segwit- transaction malleability ● While transactions are signed, the signature does not currently cover all the data in a transaction that is hashed to create the transaction hash. Thus, while uncommon, it is possible for a node on the network to change a transaction you send in such a way that the hash is invalidated. ● It’s not safe to accept a chain of unconfirmed transactions under any circumstance.
  • 46. Background ● (Claude Elwood) Shannon cipher ○ K - set of all keys (Key space) ○ M - set of all messages (Message space) ○ C - set of all ciphertexts (Ciphertext space) ○ A Shannon cipher is a pair x = (E,D) of functions. ■ E : K x M ⇥ C, D : K x C ⇥ M ■ E(k,m) = c ■ D(k, E(k, m)) = m
  • 47. Background ● One time pad (Fixed Length) ○ x = (E,D), where the keys, messages, and ciphers are bit strings of the same length. ○ x is defined over (K, M, C) where : ■ K := M := C := {0, 1}^L ○ For fixed L, key k in K, message m in M, the encryption function is defined as and for k in K, and cipher c in C, the decryption function is defined as follows
  • 48. Background ● One time pad (Variable Length) ● . ● . ● . ● One time pad satisfies the definition of perfect security ● Not practical (|key| >= |message|)
  • 49. Background ● Perfect Security (Definition) : ○ Let x = (E,D) be a shannon cipher defined over (K, M, C). Consider a probabilistic experiment in which the random variable k is uniformly distributed over K. If for all m0, m1 in M and all c in C we have : Then we say that x is perfectly secure Shannon cipher
  • 50. Background ● Perfect Security - Bad news! ● Shannons Theorem ○ Let x = (E, D) be a shannon cipher defined over (K, M, C). ○ If x is perfectly secure, then |K| >= |M| ● Proof (easy..)
  • 52. Symetric Encryption - Stream Cipher ● We would like to use a key that is much shorter ● The ‘key’ is stretched using efficient, deterministic algorithm G that maps l-bit strings to L-bit strings. ● Key space - {0,1}^l ● Message and Cipher spaces are - {0,1}^L ● Enc & Dec defined as follows -
  • 53. Symetric Encryption - Stream Cipher ● PRG - pseudo-random generator ○ An efficient, deterministic algorithm G that, given as an input a seed s (in Seed Space), computes an output r (Output Space) ○ def. of security for PRG - no efficient adversary can effectively tell the difference between G(s) and r, for ransom chosen s and r from S, R respectively.
  • 54. “Two Time Pad” - Insecure ● A stream cipher is well equipped to encrypt single message from Alice to Bob. ● Alice, however may wish to send several messages to Bob. ● An adversary (intercepts c1, c2) can compute ● English text is redundant the adversary can recover both.
  • 55. Symetric Encryption - Block Cipher ● Digital Encryption Standard (DES) − The popular block cipher of the 1990s. It is now considered as a ‘broken’ block cipher, due primarily to its small key size. ● Triple DES − It is a variant scheme based on repeated DES applications. It is still a respected block ciphers but inefficient compared to the new faster block ciphers available. ● Advanced Encryption Standard (AES) − It is a relatively new block cipher based on the encryption algorithm Rijndael that won the AES design competition.
  • 56. Asymetric Encryption ● Public Key Cryptography involves - ○ a public key, which may be known by anybody, and can be used to encrypt messages, and verify signatures. ○ a private key, known only to the recipient, used to decrypt messages, and sign (create) signatures.
  • 58. Asymetric Encryption ● Public Key Applications - ○ encryption/decryption (secrecy) ○ digital signature (authentication) ○ key exchange (session keys) ● Some algorithms are suitable for all uses, others are specific to one. ● Given public key, it should be “impossible” to compute priavte key.
  • 59. RSA (Rivest, Shamir, Adelson) Algorithm
  • 60. RSA (Rivest, Shamir, Adelson) Algorithm 1. Choose two large prime numbers p, q (e.g., 1024 bits each) 2. Compute n = p * q, z = (p-1)(q-1) (Euler function). 3. Choose e (e<n) that has no common factors with z (gcd(e, z) = =1) 4. Choose d such that e*d-1 is exactly divisable by z (e*d mod z = 1) 5. Public Key - (n,e). Private Key - (n, d).
  • 61. RSA (Rivest, Shamir, Adelson) Algorithm 1. Encryption & Decryption a. Given (n,e) and (n,d) as computed above b. To encrypt bit pattern m i. Compute c = m^e mod n c. To decrypt received pattern c i. Compute m = c^d mon n m = (m^e mod n)^d mod n
  • 62. RSA (Rivest, Shamir, Adelson) Algorithm
  • 63. Digital Signature ● Cryptographic technique ananlogues to hand-written signatures. ○ Sender (Bob) digitally signs document, establishing he is document owner. ○ Verifiable, Nonforgeable: Reciepent (Alice) can prove someone that Bob, and no one else, must have signed the document.
  • 65. Key Distribution ● Symetric Key problem - How do two entities establish a shared secret key over network? ○ Key Distribution Center (KDC) ● Public Key problem - When Alice obtains Bob’s public key, how does she know that it’s authentic? ○ Certificate Authority (CA)
  • 67. Key Ditribution - CA ● Certificate Authority binds public key to particular entity. ● Entity registers its public key with CA.

Notes de l'éditeur

  1. During WWII the Soviet Union could not produce enough one-time pads . . . to keep up with the enormous demand . . . . So, they used a number of one-time pads twice, thinking it would not compromise their system. American counter-intelligence during WWII collected all incoming and outgoing international cables. Beginning in 1946, it began an intensive e↵ort to break into the Soviet messages with the cooperation of the British and by ... the Soviet error of using some one-time pads as two-time pads, was able, over the next 25 years, to break some 2900 messages, containing 5000 pages of the hundreds of thousands of messages that been sent between 1941 and 1946 (when the Soviets switched to a di↵erent system).