SlideShare a Scribd company logo
1 of 36
1Copyright © 2017 All rights reserved. AIR at en-japan inc.
The Bitcoin Blockchain
2Copyright © 2017 All rights reserved. AIR at en-japan inc.
- We are gonna go in depth in how the bitcoin blockchain works.
- For now all you have to know is that the btc blockchain is a p2p distributed
read only write only once ledger.
Introduction
3Copyright © 2017 All rights reserved. AIR at en-japan inc.
- A public key is generated with ECDSA (Elliptic Curve Digital Signature
Algorithm) from a random private key
Bitcoin address?
You can just flip a coin 256 times to get a private key or use a computer :)
Note: Total number of possible btc addresses 2^160, it’s bigger than (the number of grains of
sand on earth) ^ 2
4Copyright © 2017 All rights reserved. AIR at en-japan inc.
Elliptic Curve
y^2 = x^3 + ax + b
secp256k1
a = 0
b = 7
Max
(keysize)
More secure than RSA
A lot less space used
Pk = Sk * G
5Copyright © 2017 All rights reserved. AIR at en-japan inc.
- When you make a transaction you sign it with your private key.
- A btc address is derived from a public key generated from your private key
and encoded in Base58Check
Bitcoin address?
k K A
Private key </= Public key </= Btc address
ECC Hashing
6Copyright © 2017 All rights reserved. AIR at en-japan inc.
Bitcoin address Generation Steps
Public key
SHA256
RIPEMD160
1KbYHh7LjcUxpcrKWsxmrhEsrF9BjBS3km
RIPEMD = RACE Integrity Primitives
Evaluation Message Digest
Version Payload
SHA256
SHA256
First 4 bytes
Version Payload Checksum
Base58
Base58Check
Encode
7Copyright © 2017 All rights reserved. AIR at en-japan inc.
- With a private key we can now sign transactions.
- Each transaction contains inputs transactions and outputs transactions. When
you create a transaction the inputs are your bitcoins, the outputs contains the
btc addresses you want to send these btc to.
- It's possible to sign a transaction that will only be valid in the future. You can
set a variable called nLockTime to either a timestamp or a block height. Then
the transaction will only be included in the blockchain after the block height or
timestamp you specified.
Transactions
8Copyright © 2017 All rights reserved. AIR at en-japan inc.
Transactions
4 bytes Version Specifies which rules this
transaction follows
1-9 bytes (VarInt) Input Counter How many inputs are
included
Variable Inputs One or more transaction
inputs
1-9 bytes (VarInt) Output counter How many outputs do we
have
Variable Outputs One or more outputs
4 bytes nLockTime A unix timestamp or block
number
9Copyright © 2017 All rights reserved. AIR at en-japan inc.
Transactions
Alice needs to pay Bob 5 BTC.
She has 6 BTC left in a previous unspent transaction output (UTXO),
she decides to use that UTXO as input of a new 5 BTC transaction to
Bob.
That means she’ll have to create a transaction with 2 UTXO, one is for
Bob btc address for 5 BTC, and the second one is for an address she
owns, for 1 BTC minus fees.
Alice previous txid (contains 6BTC):
3f4fa19803dec4d6a84fae3821da7a
c7577080ef75
16au1M18Pcu9wzz79
hAznvdh8nt1opjEcz
(5BTC bob)
14h22VUd4393feMAU
Xb8hbyJo5wmrKtezu
(1BTC - fees Alice)
All UTXO balance should always match transaction input balance
minus fees.
10Copyright © 2017 All rights reserved. AIR at en-japan inc.
- The transaction Alice did is still not broadcasted to the network. So that’s
nothing more than a signed check for now.
Transactions
11Copyright © 2017 All rights reserved. AIR at en-japan inc.
- Contains an amount of bitcoins, a LockScript (ScriptPubKey), and an
UnlockScript (ScriptSig)
UTXO
{
"txid" :
"263c018582731ff54dc72c7d67e858c002ae298835501d
80200f05753de0edf0",
"address" :
"mvbnrCX3bg1cDRUu8pkecrvP6vQkSLDSou",
"scriptPubKey" :
"76a914cbc20a7664f2f69e5355aa427045bc15e7c6c7728
8ac",
"amount" : 10.00000000,
"confirmations" : 0,
}
76a914cbc20a7664f2f69e5355aa427045bc15e7c6c77288ac
Is the hex representation of:
OP_DUP OP_HASH160 cbc20a7664f2f69e5355a
a427045bc15e7c6c772 OP_EQUALVERIFY OP_CHECKSIG
12Copyright © 2017 All rights reserved. AIR at en-japan inc.
- Pay to Public Key Hash (P2PKH)
- Pay to Public Key
- Multi Signature (limit 15 keys)
- Pay to Script Hash (P2SH)
- Data Output (OP_RETURN)
Different transactions
13Copyright © 2017 All rights reserved. AIR at en-japan inc.
When Alice pays Bob she generates a LockScript:
OP_DUP OP_HASH160 <Bob Public Key Hash> OP_EQUAL OP_CHECKSIG
To be able to spend that money, Bob needs to generate the following
UnlockScript:
<Bob Signature> <Bob public key>
Concatenating UnlockScript + LockScript and executing it should return TRUE.
Pay to Public Key Hash (P2PKH)
14Copyright © 2017 All rights reserved. AIR at en-japan inc.
Same as before but without Hashes, it used to be the standard long time ago
when people didn’t have btc addresses but sent directly to pubkeys
<Bob Public Key> OP_CHECKSIG
To be able to spend that money, Bob needs to generate the following
UnlockScript:
<Bob Signature>
Concatenating UnlockScript + LockScript and executing it should return TRUE.
Pay to Public Key (P2PK)
15Copyright © 2017 All rights reserved. AIR at en-japan inc.
A very interesting feature. You can create a lockScript that can only be unlocked if
multiple keys are used (limit 15). Great way to do joint accounts or escrow
systems.
M <pubkey 1> <pubkey 2> … <pubkey N> N OP_CHECKMULTISIG
M is the threshold of required signatures to spend the output and N the total
number of pubkeys.
To be able to spend that money, Bob needs to generate the following
UnlockScript:
OP_0 <Signature 1> <Signature 2>...
MultiSignature
16Copyright © 2017 All rights reserved. AIR at en-japan inc.
This is a new way to do multi signatures transactions.
Pay to Script Hash (P2SH)
Without P2SH:
LockingScript: 2 Pubkey1 Pubkey2 OP_CHECKMULTISIG
UnlockingScript: Sig1 Sig2
With P2SH:
Redeem Script: 2 Pubkey1 Pubkey2 OP_CHECKMULTISIG
LockingScript: OP_HASH160 <20 bytes hash of redeem script> OP_EQUAL
UnlockingScript: Sig1 Sig2 redeem script
17Copyright © 2017 All rights reserved. AIR at en-japan inc.
It is possible to simply write data in the blockchain in a transaction script. It’s very
useful for uses beyond payments, like stock certificates, proof of existence etc..
OP_RETURN <data>
This UTXO can never be spent and you can store a maximum of 80 bytes.
Data Output OP_RETURN
18Copyright © 2017 All rights reserved. AIR at en-japan inc.
Miners:
- Check that transaction is signed with the key matching the inputs (i.e the
inputs belong to Alice and the message has not been tampered)
- Sum of inputs > Sum of outputs (Sum(inputs) - Sum(outputs) = fees)
- The inputs are unspent (would have to read the whole blockchain to check
that but nowadays there is an UTXO index for that purpose)
Miners and blocks
19Copyright © 2017 All rights reserved. AIR at en-japan inc.
- Miner generate a coinbase transaction (no UTXO as input)
- SHA256(the content of the block header + a random value) needs to be lower
than a specific difficulty value.
- One block is mined every 10 minutes. Difficulty adjusted every 2016 blocks.
- Each block contains a Merkle Tree root, it’s used to quickly check if a specific
transaction is included in a specific block. All transactions are hashed and
summarized into one node at the root of the tree.
Proof of work
20Copyright © 2017 All rights reserved. AIR at en-japan inc.
Genesis block
The first mined block has been mined by Satoshi Nakamoto on January 3rd 2009.
It’s called the Genesis block.
You can find this hidden message in it:
“ The Times 03/Jan/2009 Chancellor on brink of second bailout for banks.”
This message is here as a proof of the earliest date the block could have been mined
21Copyright © 2017 All rights reserved. AIR at en-japan inc.
Sometimes 2 miners find the
solution at the same time.
2 blocks found at the same time?
22Copyright © 2017 All rights reserved. AIR at en-japan inc.
Sometimes 2 miners find the
solution at the same time.
In that situation we have a fork.
2 blocks found at the same time?
23Copyright © 2017 All rights reserved. AIR at en-japan inc.
The next miner finding a block
will have to choose one as a
parent block.
2 blocks found at the same time?
24Copyright © 2017 All rights reserved. AIR at en-japan inc.
The bitcoin mining software
always choose the longest chain
by default for the next block.
So now we have an orphan
block!
All transactions in that block have
now 0 confirmations and are out
of the blockchain! These
transactions have to be included
in a block again. That’s why you
should always wait for 3
confirmations (blocks) at least.
2 blocks found at the same time?
25Copyright © 2017 All rights reserved. AIR at en-japan inc.
If a miner had 50% of the mining
network they can in theory find a
block 50% of the time. That
means they can abuse the
system and do a double spend.
BTC Guild few years ago mined 6
blocks in a row.
2 blocks found at the same time?
26Copyright © 2017 All rights reserved. AIR at en-japan inc.
Common double spend
Alice previous txid (contains 1BTC):
3f4fa19803dec4d6a84fae3821da7a
c7577080ef75
1HYGn4HvcM8eZaAFb
GYSGxG1xPTRYXWt3z
(1BTC to Alice)
Alice previous txid (contains 1BTC):
3f4fa19803dec4d6a84fae3821da7a
c7577080ef75
14h22VUd4393feMAU
Xb8hbyJo5wmrKtezu
(1BTC to Bob)
27Copyright © 2017 All rights reserved. AIR at en-japan inc.
All blocks contain in their header
the hash of the previous block.
If the red block gets modified, all
subsequent blocks will have to be
recalculated.
Why is the past so immutable?
28Copyright © 2017 All rights reserved. AIR at en-japan inc.
Pseudonymity
Bitcoin is not anonymous but pseudonymous.
Everyone can see all the transactions, who send money to whom, the values of transactions, etc
Your IP address is also inside each packet.
You also need to be careful of blockchain analysis. Many websites already do that and can find the
balance of big users (like exchanges etc).
Coinbase banned users buying drugs with their bitcoins, so they do blockchain analysis.
What people do usually to hide themselves is using Tumblers. (careful, prone to timing attacks and you
have to trust the tumbling service which could be and must be owned by the Feds)
29Copyright © 2017 All rights reserved. AIR at en-japan inc.
Alternatives Blockchains based on Bitcoin’s code
30Copyright © 2017 All rights reserved. AIR at en-japan inc.
Alternatives Blockchains based on Bitcoin’s code
31Copyright © 2017 All rights reserved. AIR at en-japan inc.
Alternatives Blockchains based on Bitcoin’s code
32Copyright © 2017 All rights reserved. AIR at en-japan inc.
Alternatives Blockchains based on Bitcoin’s code
33Copyright © 2017 All rights reserved. AIR at en-japan inc.
Alternatives Blockchains NOT based on Bitcoin’s code
34Copyright © 2017 All rights reserved. AIR at en-japan inc.
Cryptos based on a Tangle
35Copyright © 2017 All rights reserved. AIR at en-japan inc.
Blockchains can be used for
- Voting systems (See https://www.ethereum.org/dao)
- Patents
- Smart Contracts
- Any contract, like a marriage contract with multiple keys owned by multiple people.
- Proving that something happened in the past (e.g Bob worked for company X from 2001 to 2003)
- Developing Escrow systems like Paypal with zero infrastructure/employees.
- Storing data in P2P in a secure manner (can’t be tampered, only the owners can modify)
36Copyright © 2017 All rights reserved. AIR at en-japan inc.
Questions?

More Related Content

What's hot

Bitcoin protocol for developerBitcoin Protocol for Developers
Bitcoin protocol for developerBitcoin Protocol for DevelopersBitcoin protocol for developerBitcoin Protocol for Developers
Bitcoin protocol for developerBitcoin Protocol for DevelopersParadigma Digital
 
Bitcoin and Blockchain
Bitcoin and BlockchainBitcoin and Blockchain
Bitcoin and BlockchainChen Wu
 
Presentation_Topalidis_Giorgos
Presentation_Topalidis_GiorgosPresentation_Topalidis_Giorgos
Presentation_Topalidis_GiorgosGiorgos Topalidis
 
Protocol buffers and Microservices
Protocol buffers and MicroservicesProtocol buffers and Microservices
Protocol buffers and MicroservicesVladimir Dejanovic
 
Fredericksburg LUG Bitcoin slides
Fredericksburg LUG Bitcoin slidesFredericksburg LUG Bitcoin slides
Fredericksburg LUG Bitcoin slidesAlex Akselrod
 
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)Svetlin Nakov
 
Cryptography For The Average Developer - Sunshine PHP
Cryptography For The Average Developer - Sunshine PHPCryptography For The Average Developer - Sunshine PHP
Cryptography For The Average Developer - Sunshine PHPAnthony Ferrara
 
Real world blockchains
Real world blockchainsReal world blockchains
Real world blockchainsDmitry Meshkov
 
Introduction to JWT and How to integrate with Spring Security
Introduction to JWT and How to integrate with Spring SecurityIntroduction to JWT and How to integrate with Spring Security
Introduction to JWT and How to integrate with Spring SecurityBruno Henrique Rother
 
Smart contracts using web3.js
Smart contracts using web3.jsSmart contracts using web3.js
Smart contracts using web3.jsFelix Crisan
 
J.burke HackMiami6
J.burke HackMiami6J.burke HackMiami6
J.burke HackMiami6Jesse Burke
 
Technology of Lightning Network in Tel Aviv, Israel
Technology of Lightning Network in Tel Aviv, IsraelTechnology of Lightning Network in Tel Aviv, Israel
Technology of Lightning Network in Tel Aviv, Israeltakayaimai
 
Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)Svetlin Nakov
 
Cryptography With PHP - ZendCon 2017 Workshop
Cryptography With PHP - ZendCon 2017 WorkshopCryptography With PHP - ZendCon 2017 Workshop
Cryptography With PHP - ZendCon 2017 WorkshopMark Niebergall
 
Common Browser Hijacking Methods
Common Browser Hijacking MethodsCommon Browser Hijacking Methods
Common Browser Hijacking MethodsDavid Barroso
 
Monero Presentation by Justin Ehrenhofer - Oslo, Norway 2017
Monero Presentation by Justin Ehrenhofer - Oslo, Norway 2017Monero Presentation by Justin Ehrenhofer - Oslo, Norway 2017
Monero Presentation by Justin Ehrenhofer - Oslo, Norway 2017Justin Ehrenhofer
 
JSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your LifeJSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your LifeJohn Anderson
 

What's hot (18)

Bitcoin protocol for developerBitcoin Protocol for Developers
Bitcoin protocol for developerBitcoin Protocol for DevelopersBitcoin protocol for developerBitcoin Protocol for Developers
Bitcoin protocol for developerBitcoin Protocol for Developers
 
Bitcoin and Blockchain
Bitcoin and BlockchainBitcoin and Blockchain
Bitcoin and Blockchain
 
The Burden of Proof
The Burden of ProofThe Burden of Proof
The Burden of Proof
 
Presentation_Topalidis_Giorgos
Presentation_Topalidis_GiorgosPresentation_Topalidis_Giorgos
Presentation_Topalidis_Giorgos
 
Protocol buffers and Microservices
Protocol buffers and MicroservicesProtocol buffers and Microservices
Protocol buffers and Microservices
 
Fredericksburg LUG Bitcoin slides
Fredericksburg LUG Bitcoin slidesFredericksburg LUG Bitcoin slides
Fredericksburg LUG Bitcoin slides
 
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
Blockchain Cryptography for Developers (Nakov @ BGWebSummit 2018)
 
Cryptography For The Average Developer - Sunshine PHP
Cryptography For The Average Developer - Sunshine PHPCryptography For The Average Developer - Sunshine PHP
Cryptography For The Average Developer - Sunshine PHP
 
Real world blockchains
Real world blockchainsReal world blockchains
Real world blockchains
 
Introduction to JWT and How to integrate with Spring Security
Introduction to JWT and How to integrate with Spring SecurityIntroduction to JWT and How to integrate with Spring Security
Introduction to JWT and How to integrate with Spring Security
 
Smart contracts using web3.js
Smart contracts using web3.jsSmart contracts using web3.js
Smart contracts using web3.js
 
J.burke HackMiami6
J.burke HackMiami6J.burke HackMiami6
J.burke HackMiami6
 
Technology of Lightning Network in Tel Aviv, Israel
Technology of Lightning Network in Tel Aviv, IsraelTechnology of Lightning Network in Tel Aviv, Israel
Technology of Lightning Network in Tel Aviv, Israel
 
Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)Cryptography for Absolute Beginners (May 2019)
Cryptography for Absolute Beginners (May 2019)
 
Cryptography With PHP - ZendCon 2017 Workshop
Cryptography With PHP - ZendCon 2017 WorkshopCryptography With PHP - ZendCon 2017 Workshop
Cryptography With PHP - ZendCon 2017 Workshop
 
Common Browser Hijacking Methods
Common Browser Hijacking MethodsCommon Browser Hijacking Methods
Common Browser Hijacking Methods
 
Monero Presentation by Justin Ehrenhofer - Oslo, Norway 2017
Monero Presentation by Justin Ehrenhofer - Oslo, Norway 2017Monero Presentation by Justin Ehrenhofer - Oslo, Norway 2017
Monero Presentation by Justin Ehrenhofer - Oslo, Norway 2017
 
JSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your LifeJSON Web Tokens Will Improve Your Life
JSON Web Tokens Will Improve Your Life
 

Similar to The Bitcoin Blockchain Explained

Webinar: Through the looking glass (of the blockchain) - Alessandro Confetti
Webinar: Through the looking glass (of the blockchain) - Alessandro ConfettiWebinar: Through the looking glass (of the blockchain) - Alessandro Confetti
Webinar: Through the looking glass (of the blockchain) - Alessandro ConfettiCodemotion
 
create your own cryptocurrency
create your own cryptocurrencycreate your own cryptocurrency
create your own cryptocurrencyBellaj Badr
 
Introduction to Blockchains
Introduction to BlockchainsIntroduction to Blockchains
Introduction to BlockchainsRamesh Nair
 
Presentation topalidis giorgos
Presentation topalidis giorgosPresentation topalidis giorgos
Presentation topalidis giorgosGiorgos Topalidis
 
The applications of blockchain and crypto currencies
The applications of blockchain and crypto currenciesThe applications of blockchain and crypto currencies
The applications of blockchain and crypto currenciesGrzegorz Gawron
 
Bruno Lowagie (iText) #cfoconferenz
Bruno Lowagie (iText) #cfoconferenzBruno Lowagie (iText) #cfoconferenz
Bruno Lowagie (iText) #cfoconferenzFDMagazine
 
Tutorial blockchain technical overview-ss
Tutorial blockchain technical overview-ssTutorial blockchain technical overview-ss
Tutorial blockchain technical overview-ssHoward Anglin
 
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes Zweng
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes ZwengBlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes Zweng
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes ZwengBlockchainHub Graz
 
Blockchain 101 - public, tokenized blockchains
Blockchain 101 - public, tokenized blockchainsBlockchain 101 - public, tokenized blockchains
Blockchain 101 - public, tokenized blockchainsBrett Colbert
 
Crypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies IntroCrypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies IntroTal Shmueli
 
Bitcoin & Blockchain
Bitcoin & Blockchain Bitcoin & Blockchain
Bitcoin & Blockchain Len Mei
 
Cryptocurrency Mixing
Cryptocurrency MixingCryptocurrency Mixing
Cryptocurrency Mixingashmoran
 
EthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptxEthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptxWijdenBenothmen1
 
The Bitcoin blockchain (en)
The Bitcoin blockchain (en)The Bitcoin blockchain (en)
The Bitcoin blockchain (en)Davide Carboni
 
Every thing bitcoin in baby language
Every thing bitcoin in baby languageEvery thing bitcoin in baby language
Every thing bitcoin in baby languageOssai Nduka
 
Ethereum Blockchain and DApps - Workshop at Software University
Ethereum Blockchain and DApps  - Workshop at Software UniversityEthereum Blockchain and DApps  - Workshop at Software University
Ethereum Blockchain and DApps - Workshop at Software UniversityOpen Source University
 
Eclipsecon Europe: Blockchain, Ethereum and Business Applications
Eclipsecon Europe: Blockchain, Ethereum and Business ApplicationsEclipsecon Europe: Blockchain, Ethereum and Business Applications
Eclipsecon Europe: Blockchain, Ethereum and Business ApplicationsMatthias Zimmermann
 

Similar to The Bitcoin Blockchain Explained (20)

Webinar: Through the looking glass (of the blockchain) - Alessandro Confetti
Webinar: Through the looking glass (of the blockchain) - Alessandro ConfettiWebinar: Through the looking glass (of the blockchain) - Alessandro Confetti
Webinar: Through the looking glass (of the blockchain) - Alessandro Confetti
 
Blockchain
BlockchainBlockchain
Blockchain
 
create your own cryptocurrency
create your own cryptocurrencycreate your own cryptocurrency
create your own cryptocurrency
 
Introduction to Blockchains
Introduction to BlockchainsIntroduction to Blockchains
Introduction to Blockchains
 
Presentation topalidis giorgos
Presentation topalidis giorgosPresentation topalidis giorgos
Presentation topalidis giorgos
 
The applications of blockchain and crypto currencies
The applications of blockchain and crypto currenciesThe applications of blockchain and crypto currencies
The applications of blockchain and crypto currencies
 
Bruno Lowagie (iText) #cfoconferenz
Bruno Lowagie (iText) #cfoconferenzBruno Lowagie (iText) #cfoconferenz
Bruno Lowagie (iText) #cfoconferenz
 
Tutorial blockchain technical overview-ss
Tutorial blockchain technical overview-ssTutorial blockchain technical overview-ss
Tutorial blockchain technical overview-ss
 
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes Zweng
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes ZwengBlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes Zweng
BlockchainHub Graz Meetup #22 - Atomic Swaps - Johannes Zweng
 
Blockchain 101 - public, tokenized blockchains
Blockchain 101 - public, tokenized blockchainsBlockchain 101 - public, tokenized blockchains
Blockchain 101 - public, tokenized blockchains
 
Salp for dummies
Salp for dummiesSalp for dummies
Salp for dummies
 
Crypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies IntroCrypto & Crpyocurrencies Intro
Crypto & Crpyocurrencies Intro
 
Bitcoin & Blockchain
Bitcoin & Blockchain Bitcoin & Blockchain
Bitcoin & Blockchain
 
Cryptocurrency Mixing
Cryptocurrency MixingCryptocurrency Mixing
Cryptocurrency Mixing
 
EthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptxEthereumBlockchainMarch3 (1).pptx
EthereumBlockchainMarch3 (1).pptx
 
The Bitcoin blockchain (en)
The Bitcoin blockchain (en)The Bitcoin blockchain (en)
The Bitcoin blockchain (en)
 
Every thing bitcoin in baby language
Every thing bitcoin in baby languageEvery thing bitcoin in baby language
Every thing bitcoin in baby language
 
Ethereum Blockchain and DApps - Workshop at Software University
Ethereum Blockchain and DApps  - Workshop at Software UniversityEthereum Blockchain and DApps  - Workshop at Software University
Ethereum Blockchain and DApps - Workshop at Software University
 
Bitcoin
BitcoinBitcoin
Bitcoin
 
Eclipsecon Europe: Blockchain, Ethereum and Business Applications
Eclipsecon Europe: Blockchain, Ethereum and Business ApplicationsEclipsecon Europe: Blockchain, Ethereum and Business Applications
Eclipsecon Europe: Blockchain, Ethereum and Business Applications
 

Recently uploaded

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 

Recently uploaded (20)

Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
#StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 

The Bitcoin Blockchain Explained

  • 1. 1Copyright © 2017 All rights reserved. AIR at en-japan inc. The Bitcoin Blockchain
  • 2. 2Copyright © 2017 All rights reserved. AIR at en-japan inc. - We are gonna go in depth in how the bitcoin blockchain works. - For now all you have to know is that the btc blockchain is a p2p distributed read only write only once ledger. Introduction
  • 3. 3Copyright © 2017 All rights reserved. AIR at en-japan inc. - A public key is generated with ECDSA (Elliptic Curve Digital Signature Algorithm) from a random private key Bitcoin address? You can just flip a coin 256 times to get a private key or use a computer :) Note: Total number of possible btc addresses 2^160, it’s bigger than (the number of grains of sand on earth) ^ 2
  • 4. 4Copyright © 2017 All rights reserved. AIR at en-japan inc. Elliptic Curve y^2 = x^3 + ax + b secp256k1 a = 0 b = 7 Max (keysize) More secure than RSA A lot less space used Pk = Sk * G
  • 5. 5Copyright © 2017 All rights reserved. AIR at en-japan inc. - When you make a transaction you sign it with your private key. - A btc address is derived from a public key generated from your private key and encoded in Base58Check Bitcoin address? k K A Private key </= Public key </= Btc address ECC Hashing
  • 6. 6Copyright © 2017 All rights reserved. AIR at en-japan inc. Bitcoin address Generation Steps Public key SHA256 RIPEMD160 1KbYHh7LjcUxpcrKWsxmrhEsrF9BjBS3km RIPEMD = RACE Integrity Primitives Evaluation Message Digest Version Payload SHA256 SHA256 First 4 bytes Version Payload Checksum Base58 Base58Check Encode
  • 7. 7Copyright © 2017 All rights reserved. AIR at en-japan inc. - With a private key we can now sign transactions. - Each transaction contains inputs transactions and outputs transactions. When you create a transaction the inputs are your bitcoins, the outputs contains the btc addresses you want to send these btc to. - It's possible to sign a transaction that will only be valid in the future. You can set a variable called nLockTime to either a timestamp or a block height. Then the transaction will only be included in the blockchain after the block height or timestamp you specified. Transactions
  • 8. 8Copyright © 2017 All rights reserved. AIR at en-japan inc. Transactions 4 bytes Version Specifies which rules this transaction follows 1-9 bytes (VarInt) Input Counter How many inputs are included Variable Inputs One or more transaction inputs 1-9 bytes (VarInt) Output counter How many outputs do we have Variable Outputs One or more outputs 4 bytes nLockTime A unix timestamp or block number
  • 9. 9Copyright © 2017 All rights reserved. AIR at en-japan inc. Transactions Alice needs to pay Bob 5 BTC. She has 6 BTC left in a previous unspent transaction output (UTXO), she decides to use that UTXO as input of a new 5 BTC transaction to Bob. That means she’ll have to create a transaction with 2 UTXO, one is for Bob btc address for 5 BTC, and the second one is for an address she owns, for 1 BTC minus fees. Alice previous txid (contains 6BTC): 3f4fa19803dec4d6a84fae3821da7a c7577080ef75 16au1M18Pcu9wzz79 hAznvdh8nt1opjEcz (5BTC bob) 14h22VUd4393feMAU Xb8hbyJo5wmrKtezu (1BTC - fees Alice) All UTXO balance should always match transaction input balance minus fees.
  • 10. 10Copyright © 2017 All rights reserved. AIR at en-japan inc. - The transaction Alice did is still not broadcasted to the network. So that’s nothing more than a signed check for now. Transactions
  • 11. 11Copyright © 2017 All rights reserved. AIR at en-japan inc. - Contains an amount of bitcoins, a LockScript (ScriptPubKey), and an UnlockScript (ScriptSig) UTXO { "txid" : "263c018582731ff54dc72c7d67e858c002ae298835501d 80200f05753de0edf0", "address" : "mvbnrCX3bg1cDRUu8pkecrvP6vQkSLDSou", "scriptPubKey" : "76a914cbc20a7664f2f69e5355aa427045bc15e7c6c7728 8ac", "amount" : 10.00000000, "confirmations" : 0, } 76a914cbc20a7664f2f69e5355aa427045bc15e7c6c77288ac Is the hex representation of: OP_DUP OP_HASH160 cbc20a7664f2f69e5355a a427045bc15e7c6c772 OP_EQUALVERIFY OP_CHECKSIG
  • 12. 12Copyright © 2017 All rights reserved. AIR at en-japan inc. - Pay to Public Key Hash (P2PKH) - Pay to Public Key - Multi Signature (limit 15 keys) - Pay to Script Hash (P2SH) - Data Output (OP_RETURN) Different transactions
  • 13. 13Copyright © 2017 All rights reserved. AIR at en-japan inc. When Alice pays Bob she generates a LockScript: OP_DUP OP_HASH160 <Bob Public Key Hash> OP_EQUAL OP_CHECKSIG To be able to spend that money, Bob needs to generate the following UnlockScript: <Bob Signature> <Bob public key> Concatenating UnlockScript + LockScript and executing it should return TRUE. Pay to Public Key Hash (P2PKH)
  • 14. 14Copyright © 2017 All rights reserved. AIR at en-japan inc. Same as before but without Hashes, it used to be the standard long time ago when people didn’t have btc addresses but sent directly to pubkeys <Bob Public Key> OP_CHECKSIG To be able to spend that money, Bob needs to generate the following UnlockScript: <Bob Signature> Concatenating UnlockScript + LockScript and executing it should return TRUE. Pay to Public Key (P2PK)
  • 15. 15Copyright © 2017 All rights reserved. AIR at en-japan inc. A very interesting feature. You can create a lockScript that can only be unlocked if multiple keys are used (limit 15). Great way to do joint accounts or escrow systems. M <pubkey 1> <pubkey 2> … <pubkey N> N OP_CHECKMULTISIG M is the threshold of required signatures to spend the output and N the total number of pubkeys. To be able to spend that money, Bob needs to generate the following UnlockScript: OP_0 <Signature 1> <Signature 2>... MultiSignature
  • 16. 16Copyright © 2017 All rights reserved. AIR at en-japan inc. This is a new way to do multi signatures transactions. Pay to Script Hash (P2SH) Without P2SH: LockingScript: 2 Pubkey1 Pubkey2 OP_CHECKMULTISIG UnlockingScript: Sig1 Sig2 With P2SH: Redeem Script: 2 Pubkey1 Pubkey2 OP_CHECKMULTISIG LockingScript: OP_HASH160 <20 bytes hash of redeem script> OP_EQUAL UnlockingScript: Sig1 Sig2 redeem script
  • 17. 17Copyright © 2017 All rights reserved. AIR at en-japan inc. It is possible to simply write data in the blockchain in a transaction script. It’s very useful for uses beyond payments, like stock certificates, proof of existence etc.. OP_RETURN <data> This UTXO can never be spent and you can store a maximum of 80 bytes. Data Output OP_RETURN
  • 18. 18Copyright © 2017 All rights reserved. AIR at en-japan inc. Miners: - Check that transaction is signed with the key matching the inputs (i.e the inputs belong to Alice and the message has not been tampered) - Sum of inputs > Sum of outputs (Sum(inputs) - Sum(outputs) = fees) - The inputs are unspent (would have to read the whole blockchain to check that but nowadays there is an UTXO index for that purpose) Miners and blocks
  • 19. 19Copyright © 2017 All rights reserved. AIR at en-japan inc. - Miner generate a coinbase transaction (no UTXO as input) - SHA256(the content of the block header + a random value) needs to be lower than a specific difficulty value. - One block is mined every 10 minutes. Difficulty adjusted every 2016 blocks. - Each block contains a Merkle Tree root, it’s used to quickly check if a specific transaction is included in a specific block. All transactions are hashed and summarized into one node at the root of the tree. Proof of work
  • 20. 20Copyright © 2017 All rights reserved. AIR at en-japan inc. Genesis block The first mined block has been mined by Satoshi Nakamoto on January 3rd 2009. It’s called the Genesis block. You can find this hidden message in it: “ The Times 03/Jan/2009 Chancellor on brink of second bailout for banks.” This message is here as a proof of the earliest date the block could have been mined
  • 21. 21Copyright © 2017 All rights reserved. AIR at en-japan inc. Sometimes 2 miners find the solution at the same time. 2 blocks found at the same time?
  • 22. 22Copyright © 2017 All rights reserved. AIR at en-japan inc. Sometimes 2 miners find the solution at the same time. In that situation we have a fork. 2 blocks found at the same time?
  • 23. 23Copyright © 2017 All rights reserved. AIR at en-japan inc. The next miner finding a block will have to choose one as a parent block. 2 blocks found at the same time?
  • 24. 24Copyright © 2017 All rights reserved. AIR at en-japan inc. The bitcoin mining software always choose the longest chain by default for the next block. So now we have an orphan block! All transactions in that block have now 0 confirmations and are out of the blockchain! These transactions have to be included in a block again. That’s why you should always wait for 3 confirmations (blocks) at least. 2 blocks found at the same time?
  • 25. 25Copyright © 2017 All rights reserved. AIR at en-japan inc. If a miner had 50% of the mining network they can in theory find a block 50% of the time. That means they can abuse the system and do a double spend. BTC Guild few years ago mined 6 blocks in a row. 2 blocks found at the same time?
  • 26. 26Copyright © 2017 All rights reserved. AIR at en-japan inc. Common double spend Alice previous txid (contains 1BTC): 3f4fa19803dec4d6a84fae3821da7a c7577080ef75 1HYGn4HvcM8eZaAFb GYSGxG1xPTRYXWt3z (1BTC to Alice) Alice previous txid (contains 1BTC): 3f4fa19803dec4d6a84fae3821da7a c7577080ef75 14h22VUd4393feMAU Xb8hbyJo5wmrKtezu (1BTC to Bob)
  • 27. 27Copyright © 2017 All rights reserved. AIR at en-japan inc. All blocks contain in their header the hash of the previous block. If the red block gets modified, all subsequent blocks will have to be recalculated. Why is the past so immutable?
  • 28. 28Copyright © 2017 All rights reserved. AIR at en-japan inc. Pseudonymity Bitcoin is not anonymous but pseudonymous. Everyone can see all the transactions, who send money to whom, the values of transactions, etc Your IP address is also inside each packet. You also need to be careful of blockchain analysis. Many websites already do that and can find the balance of big users (like exchanges etc). Coinbase banned users buying drugs with their bitcoins, so they do blockchain analysis. What people do usually to hide themselves is using Tumblers. (careful, prone to timing attacks and you have to trust the tumbling service which could be and must be owned by the Feds)
  • 29. 29Copyright © 2017 All rights reserved. AIR at en-japan inc. Alternatives Blockchains based on Bitcoin’s code
  • 30. 30Copyright © 2017 All rights reserved. AIR at en-japan inc. Alternatives Blockchains based on Bitcoin’s code
  • 31. 31Copyright © 2017 All rights reserved. AIR at en-japan inc. Alternatives Blockchains based on Bitcoin’s code
  • 32. 32Copyright © 2017 All rights reserved. AIR at en-japan inc. Alternatives Blockchains based on Bitcoin’s code
  • 33. 33Copyright © 2017 All rights reserved. AIR at en-japan inc. Alternatives Blockchains NOT based on Bitcoin’s code
  • 34. 34Copyright © 2017 All rights reserved. AIR at en-japan inc. Cryptos based on a Tangle
  • 35. 35Copyright © 2017 All rights reserved. AIR at en-japan inc. Blockchains can be used for - Voting systems (See https://www.ethereum.org/dao) - Patents - Smart Contracts - Any contract, like a marriage contract with multiple keys owned by multiple people. - Proving that something happened in the past (e.g Bob worked for company X from 2001 to 2003) - Developing Escrow systems like Paypal with zero infrastructure/employees. - Storing data in P2P in a secure manner (can’t be tampered, only the owners can modify)
  • 36. 36Copyright © 2017 All rights reserved. AIR at en-japan inc. Questions?

Editor's Notes

  1. As you can see there is a scripting language integrated into Bitcoin. It’s a very simple non turing complete stack based language. When Alice sent money to Bob she generated that exact LockScript in the transaction. Only Bob can provide the UnlockScript to actually spend the money he received. This is typical to most of bitcoin transactions and it’s called a P2PKH transaction (Pay2PublicKeyHash)
  2. As you can see, with P2SH Alice doesn’t need to generate a very long LockingScript containing all the Pubkeys. She can create it with a simple hash. Only Bob when he wants to spend that money will have to generate a long UnlockingScript. Less bloat on the blockchain, less fees for Alice. Bonus point, Bob can now generate a btc address containing that 20 bytes hash of the redeem script. These type of addresse start with 3. Alice can simply send money there.
  3. Miners do that job for each transaction and put these transactions into blocks. The blockchain is a chain of blocks, each block refers to the previous block by hash. Like each transaction refers to a previous transaction.
  4. They add the (Sum of inputs - Sum of outputs) which represents the total fees in the coinbase transaction + the block reward
  5. A faster blocktime would make transactions clear faster but lead to more frequent forks, whereas a slower block time would decrease the number of forks but make settlement slower.