SlideShare a Scribd company logo
DEVELOPER’S PERSPECTIVE
BLOCKCHAIN
TEXT
HOW TO BECOME RICH
INVESTOR’S PERSPECTIVE
BITCOINAIRE
BLOCKCHAIN, ANYBODY ?
BITCOINAIRE
MtGox Fraud
Initial Whitepaper
Original Peak
WTF?
Initial Whitepaper
WTF
TEXT
George Soros
LIBERTARIANS
KILL THE BANKS AND BANKERS
TEXT
INVESTORS
UNCORRELATED ASSET
DEVELOPERS
BLOCKCHAIN TECHNOLOGY
TEXT
TEXT
TEXT
BLOCKCHAIN
DOUBLE SPENDING
TEXT
DUPLICATION OF INFORMATION
?
TEXT
SCARICY OF MONEY
TEXT
LEDGER
CENTRALISED
TEXT
TRUST
TEXT
TRUST-AS-A-SERVICE?
TEXT
DISTRIBUTED LEDGER ?
POLITICALLY DECENTRALISED
ARCHITECTURALLY DECENTRALISED LOGICALLY DECENTRALISED
TEXT
CONSENSUS TECHNIQUE…
TEXT
…USING MATH
TEXT
LET’S CODEBASED ON NAIVECHAIN BY @LHARTIKK
@ARTURSKOWRONSKI/NAIVECHAIN-JAVA
TEXT
P2P (WebSockets) P2P (WebSockets)
P2P (WebSockets)
public class Block {
protected int index;
protected String hash;
protected String previousHash;
protected long timestamp;
protected Object data;
protected int nonce;
}
BLOCK PART
BLOCK PART
public class Block {
protected int index;
protected String hash;
protected String previousHash;
protected long timestamp;
protected Object data;
protected int nonce;
}
BLOCK PART
public class Block {
protected int index;
protected String hash;
protected String previousHash;
protected long timestamp;
protected Object data;
protected int nonce;
}
BLOCK PART
public class Block {
protected int index;
protected String hash;
protected String previousHash;
protected long timestamp;
protected Object data;
protected int nonce;
}
BLOCK PART
public class Block {
protected int index;
protected String hash;
protected String previousHash;
protected long timestamp;
protected Object data;
protected int nonce;
}
CHAIN PART
public class Blockchain extends LinkedList<Block> {
public Blockchain(Block block) {
this.add(GENESIS_BLOCK);
}
}
CHAIN PART
public class Blockchain extends LinkedList<Block> {
public Blockchain(Block block) {
this.add(GENESIS_BLOCK);
}
}
CHAIN PART
public class Blockchain extends LinkedList<Block> {
public Blockchain(Block block) {
this.add(GENESIS_BLOCK);
}
}
CHAIN PART
public class Blockchain extends LinkedList<Block> {
public Blockchain(Block block) {
this.add(GENESIS_BLOCK);
}
}
GENESIS BLOCK
public static final Block GENESIS_BLOCK = new Block(
0, //index
“e6337db8a921823784c14378abed4f7d7", //hash
null, //previousHash
1465154705, //timestamp
"Pozdro Bielsko-Biala!”, //data
0 //nonce
);
MINING BLOCK
public class BlockchainService {
Blockchain chain = new Blockchain();
public Block mineBlock(Object data) => {
Block newBlock = nextBlock(chain.getLast(), data);
chain.addBlock(newBlock);
return chain.getLast();
};
}
MINING BLOCK
public class BlockchainService {
Blockchain chain = new Blockchain();
public Block mineBlock(Object data) => {
Block newBlock = nextBlock(chain.getLast(), data);
chain.addBlock(newBlock);
return chain.getLast();
};
}
MINING BLOCK
public class BlockchainService {
Blockchain chain = new Blockchain();
public Block mineBlock(Object data) => {
Block newBlock = nextBlock(chain.getLast(), data);
chain.addBlock(newBlock);
return chain.getLast();
};
}
MINING BLOCK
public static Block nextBlock(Block prevBlock, Object data) {
int nextIndex = previousBlock.index + 1;
String prevHash = prevBlock.getHash();
long nextTime = new Date().getTime();
String nextHash = calculateHash(nextIndex, prevHash, nextTime, data);
return new Block(nextIndex, prevHash, nextHash, nextTime, data);
}
MINING BLOCK
public static Block nextBlock(Block prevBlock, Object data) {
int nextIndex = previousBlock.index + 1;
String prevHash = prevBlock.getHash();
long nextTime = new Date().getTime();
String nextHash = calculateHash(nextIndex, prevHash, nextTime, data);
return new Block(nextIndex, prevHash, nextHash, nextTime, data);
}
MINING BLOCK
public static Block nextBlock(Block prevBlock, Object data) {
int nextIndex = previousBlock.index + 1;
String prevHash = prevBlock.getHash();
long nextTime = new Date().getTime();
String nextHash = calculateHash(nextIndex, prevHash, nextTime, data);
return new Block(nextIndex, prevHash, nextHash, nextTime, data);
}
MINING BLOCK
public static Block nextBlock(Block prevBlock, Object data) {
int nextIndex = previousBlock.index + 1;
String prevHash = prevBlock.getHash();
long nextTime = new Date().getTime();
String nextHash = calculateHash(nextIndex, prevHash, nextTime, data);
return new Block(nextIndex, prevHash, nextHash, nextTime, data);
}
MINING BLOCK
public static Block nextBlock(Block prevBlock, Object data) {
int nextIndex = previousBlock.index + 1;
String prevHash = prevBlock.getHash();
long nextTime = new Date().getTime();
String nextHash = calculateHash(nextIndex, prevHash, nextTime, data);
return new Block(nextIndex, prevHash, nextHash, nextTime, data);
}
CALCULATE HASH
private String calculateHash(int index, String prevHash, long ts, Object data) {
return sha256Hex(index + prevHash + ts + data.hashCode());
}
MINING BLOCK
public static Block nextBlock(Block prevBlock, Object data) {
int nextIndex = previousBlock.index + 1;
String prevHash = prevBlock.getHash();
long nextTime = new Date().getTime();
String nextHash = calculateHash(nextIndex, prevHash, nextTime, data);
return new Block(nextIndex, prevHash, nextHash, nextTime, data);
}
MINING BLOCK
public class BlockchainService {
Blockchain chain = new Blockchain();
public Block mineBlock(Object data) => {
Block newBlock = nextBlock(chain.getLast(), data);
chain.addBlock(newBlock);
return chain.getLast();
};
}
ADDING BLOCK TO CHAIN
public class Blockchain extends LinkedList<Block> {
(...)
public BlockchainResponse addBlock(Block block){
if(isValidNewBlock(getLast(), block)) {
add(block);
}
return new BlockchainResponse(RESPONSE_BLOCKCHAIN, block);
}
(...)
}
ADDING BLOCK TO CHAIN
public class Blockchain extends LinkedList<Block> {
(...)
public BlockchainResponse addBlock(Block block){
if(isValidNewBlock(getLast(), block)) {
add(block);
}
return new BlockchainResponse(RESPONSE_BLOCKCHAIN, block);
}
(...)
}
BLOCK VALIDATION
public static boolean isValidNewBlock(Block previousBlock, Block newBlock){
if (previousBlock.getIndex() + 1 != newBlock.getIndex()) {
return false;
}
if (!previousBlock.getHash().equals(newBlock.getHash())) {
return false;
}
if (calculateHashForBlock(newBlock).equals(newBlock.getHash())) {
return false;
}
return true;
}
BLOCK VALIDATION
public static boolean isValidNewBlock(Block previousBlock, Block newBlock){
if (previousBlock.getIndex() + 1 != newBlock.getIndex()) {
return false;
}
if (!previousBlock.getHash().equals(newBlock.getHash())) {
return false;
}
if (calculateHashForBlock(newBlock).equals(newBlock.getHash())) {
return false;
}
return true;
}
BLOCK VALIDATION
public static boolean isValidNewBlock(Block previousBlock, Block newBlock){
if (previousBlock.getIndex() + 1 != newBlock.getIndex()) {
return false;
}
if (!previousBlock.getHash().equals(newBlock.getHash())) {
return false;
}
if (calculateHashForBlock(newBlock).equals(newBlock.getHash())) {
return false;
}
return true;
}
BLOCK VALIDATION
public static boolean isValidNewBlock(Block previousBlock, Block newBlock){
if (previousBlock.getIndex() + 1 != newBlock.getIndex()) {
return false;
}
if (!previousBlock.getHash().equals(newBlock.getHash())) {
return false;
}
if (calculateHashForBlock(newBlock).equals(newBlock.getHash())) {
return false;
}
return true;
}
ADDING BLOCK TO CHAIN
public class Blockchain extends LinkedList<Block> {
(...)
public BlockchainResponse addBlock(Block block){
if(isValidNewBlock(getLast(), block)) {
add(block);
}
return new BlockchainResponse(RESPONSE_BLOCKCHAIN, block);
}
(...)
}
TEXT
Hash #0
Genesis Block
Hash #1
PrevHash #0
Hash #2
PrevHash #1
BLOCKCHAIN
ADDING BLOCK TO CHAIN
public class Blockchain extends LinkedList<Block> {
(...)
public Response addBlock(Block block){
if(isValidNewBlock(getLast(), block)) {
add(block);
}
return new Response(RESPONSE_BLOCKCHAIN, block);
}
(...)
}
TEXT
New Block
New Block
GOSSIP PROTOCOL
NEW BLOCK HANDLING
public Response handleBlockchainResponse(Blockchain newChain) {
if (newChain.getLast().getIndex() > chain.getLast().getIndex()) {
if (chain.getLast().getHash().equals(newChain.getLast().getPreviousHash())){
chain.addBlock(latestBlockReceived);
return new Response(RESPONSE_BLOCKCHAIN, new Blockchain(chain.getLast()));
}
return exchangeChains(newChain);
}
return new Response(DO_NOTHING);
}
NEW BLOCK HANDLING
public Response handleBlockchainResponse(Blockchain newChain) {
if (newChain.getLast().getIndex() > chain.getLast().getIndex()) {
if (chain.getLast().getHash().equals(newChain.getLast().getPreviousHash())){
chain.addBlock(latestBlockReceived);
return new Response(RESPONSE_BLOCKCHAIN, new Blockchain(chain.getLast()));
}
return exchangeChains(newChain);
}
return new Response(DO_NOTHING);
}
NEW BLOCK HANDLING
public Response handleBlockchainResponse(Blockchain newChain) {
if (newChain.getLast().getIndex() > chain.getLast().getIndex()) {
if (chain.getLast().getHash().equals(newChain.getLast().getPreviousHash())){
chain.addBlock(latestBlockReceived);
return new Response(RESPONSE_BLOCKCHAIN, new Blockchain(chain.getLast()));
}
return exchangeChains(newChain);
}
return new Response(DO_NOTHING);
}
NEW BLOCK HANDLING
public Response handleBlockchainResponse(Blockchain newChain) {
if (newChain.getLast().getIndex() > chain.getLast().getIndex()) {
if (chain.getLast().getHash().equals(newChain.getLast().getPreviousHash())){
chain.addBlock(latestBlockReceived);
return new BlockchainResponse(RESPONSE_BLOCKCHAIN, new Blockchain(chain.getLast()));
}
return exchangeChains(newChain);
}
return new BlockchainResponse(DO_NOTHING);
}
TEXT
Hash #2
EXCHANGE CHAINS
TEXT
New Chain
New Chain
GOSSIP PROTOCOL
REPLACING CHAIN
private Response exchangeChain(Blockchain newBlockchain) {
if (newBlockchain.isValidChain() && newBlockchain.size() > chain.size()) {
chain = newBlockchain;
return new Response(RESPONSE_BLOCKCHAIN, new Blockchain(chain.getLast()));
} else {
return new Response(DO_NOTHING);
}

}
REPLACING CHAIN
private Response exchangeChain(Blockchain newBlockchain) {
if (newBlockchain.isValidChain() && newBlockchain.size() > chain.size()) {
chain = newBlockchain;
return new Response(RESPONSE_BLOCKCHAIN, new Blockchain(chain.getLast()));
} else {
return new Response(DO_NOTHING);
}

}
REPLACING CHAIN
private Response exchangeChain(Blockchain newBlockchain) {
if (newBlockchain.isValidChain() && newBlockchain.size() > chain.size()) {
chain = newBlockchain;
return new Response(RESPONSE_BLOCKCHAIN, new Blockchain(chain.getLast()));
} else {
return new Response(DO_NOTHING);
}

}
VALIDATING CHAIN
public boolean isValidChain(){
if (!this.getFirst().equals(GENESIS_BLOCK)){
return false;
}
for (int i = 1; i < this.size() - 1; i++) {
if (!Block.isValidNewBlock(this.get(i - 1), this.get(i))){
return false;
}
}
return true;
}
VALIDATING CHAIN
public boolean isValidChain(){
if (!this.getFirst().equals(GENESIS_BLOCK)){
return false;
}
for (int i = 1; i < this.size() - 1; i++) {
if (!Block.isValidNewBlock(this.get(i - 1), this.get(i))){
return false;
}
}
return true;
}
VALIDATING CHAIN
public boolean isValidChain(){
if (!this.getFirst().equals(GENESIS_BLOCK)){
return false;
}
for (int i = 1; i < this.size() - 1; i++) {
if (!Block.isValidNewBlock(this.get(i - 1), this.get(i))){
return false;
}
}
return true;
}
REPLACING CHAIN
private Response exchangeChain(Blockchain newBlockchain) {
if (newBlockchain.isValidChain() && newBlockchain.size() > chain.size()) {
chain = newBlockchain;
return new Response(RESPONSE_BLOCKCHAIN, new Blockchain(chain.getLast()));
} else {
return new Response(DO_NOTHING);
}

}
TEXT
LONGER HASH WINS
TEXT
SPINNING NEW BLOCKS
PROOF-OF-WORK
PROOF-OF-WORK
private static HashPair calculateHash(int index, String previousHash, Object data) {
int nonce = 0;
while (true) {
nonce++;
String value = sha256Hex(index + previousHash + data.hashCode() + nonce);
if (value.startsWith(“000")) {
return new HashPair(nounce, value);
}
}
}
PROOF-OF-WORK
private static HashPair calculateHash(int index, String previousHash, Object data) {
int nonce = 0;
while (true) {
nonce++;
String value = sha256Hex(index + previousHash + data.hashCode() + nonce);
if (value.startsWith(“000")) {
return new HashPair(nounce, value);
}
}
}
PROOF-OF-WORK
private static HashPair calculateHash(int index, String previousHash, Object data) {
int nonce = 0;
while (true) {
nonce++;
String value = sha256Hex(index + previousHash + data.hashCode() + nonce);
if (value.startsWith(“000")) {
return new HashPair(nonce, value);
}
}
}
PROOF-OF-WORK
private static HashPair calculateHash(int index, String previousHash, Object data) {
int nonce = 0;
while (true) {
nonce++;
String value = sha256Hex(index + previousHash + data.hashCode() + nonce);
if (value.startsWith(“000")) {
return new HashPair(nonce, value);
}
}
}
PROOF-OF-WORK
private static HashPair calculateHash(int index, String previousHash, Object data) {
int nonce = 0;
while (true) {
nonce++;
String value = sha256Hex(index + previousHash + data.hashCode() + nonce);
if (value.startsWith(“000")) {
return new HashPair(nonce, value);
}
}
}
PROOF-OF-WORK
private static HashPair calculateHash(int index, String previousHash, Object data) {
int nonce = 0;
while (true) {
nonce++;
String value = sha256Hex(index + previousHash + data.hashCode() + nonce);
if (value.startsWith(“000")) {
return new HashPair(nonce, value);
}
}
}
PROOF-OF-WORK
private static HashPair calculateHash(int index, String previousHash, Object data) {
int nonce = 0;
while (true) {
nonce++;
String value = sha256Hex(index + previousHash + data.hashCode() + nonce);
if (value.startsWith(“000")) {
return new HashPair(nonce, value);
}
}
}
TEXT
IDEAL HASH FUNCTION
f( )
f( )?
TEXT
I HAVE HASH! 000004CEEF5782B82C212CE725F15594!
00000ee187308970bb63446f3f910e98000004ceef5782b82c212ce725f15594
TEXT
Hash #0 Hash #1 Hash #2
SECURITY
Hash #0
Hash #1

Prev #0
Hash #2

Prev #1
Hash #3

Prev #2
Hash #4

Prev #3
Hash #1x
Hash #2x

Prev #1x
Hash #3x

Prev #2x
FORK
▸ =
50% OF WHOLE NETWORK
TEXT
BLOCKCHAIN
Hash #1

Prev #2
Hash #2

Prev #3
Hash #0

Prev #1
Hash #0
$ $ $
TEXT
PROBLEMS
TEXT
ENVIRONMENTAL UNFRIENDLY
TEXT
> ENERGY USAGE ICELAND
PROOF-OF-STAKE
PRIMECOIN
TEXT
SCALABILITY ISSUES
TEXT
VERTICAL SCALING HORIZONTAL SCALING
TEXT
VERTICAL SCALING
TEXT
HORIZANTAL SCALING
PROOF-OF-STAKE
DIRECT ACYCLIC GRAPH
LIGHTNING NETWORKS
TEXT
SMART CONTRACTS
INITIAL COIN OFFERINGS
SOFT & HARD FORKS
TEXT
DNS
IOT
SMART

CONTRACT
TEXT
THANK YOU AND
WAITING FOR
QUESTIONS
@ArturSkowronski
arturskowronski.com

More Related Content

What's hot

MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB
 
NodeJS Blockchain.info Wallet
NodeJS Blockchain.info WalletNodeJS Blockchain.info Wallet
NodeJS Blockchain.info Wallet
Sjors Provoost
 
Mythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDBMythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDB
MongoDB
 
Blockchain Technologies for Data Science
Blockchain Technologies for Data ScienceBlockchain Technologies for Data Science
Blockchain Technologies for Data Science
Bruno Gonçalves
 
How to verify computation in the blink of an eye
How to verify computation in the blink of an eyeHow to verify computation in the blink of an eye
How to verify computation in the blink of an eye
Facultad de Informática UCM
 
Cryptography 101 for Java developers
Cryptography 101 for Java developersCryptography 101 for Java developers
Cryptography 101 for Java developers
Michel Schudel
 
Heroku Postgres Cloud Database Webinar
Heroku Postgres Cloud Database WebinarHeroku Postgres Cloud Database Webinar
Heroku Postgres Cloud Database Webinar
Salesforce Developers
 

What's hot (7)

MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
MongoDB .local San Francisco 2020: Using Client Side Encryption in MongoDB 4.2
 
NodeJS Blockchain.info Wallet
NodeJS Blockchain.info WalletNodeJS Blockchain.info Wallet
NodeJS Blockchain.info Wallet
 
Mythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDBMythbusting: Understanding How We Measure the Performance of MongoDB
Mythbusting: Understanding How We Measure the Performance of MongoDB
 
Blockchain Technologies for Data Science
Blockchain Technologies for Data ScienceBlockchain Technologies for Data Science
Blockchain Technologies for Data Science
 
How to verify computation in the blink of an eye
How to verify computation in the blink of an eyeHow to verify computation in the blink of an eye
How to verify computation in the blink of an eye
 
Cryptography 101 for Java developers
Cryptography 101 for Java developersCryptography 101 for Java developers
Cryptography 101 for Java developers
 
Heroku Postgres Cloud Database Webinar
Heroku Postgres Cloud Database WebinarHeroku Postgres Cloud Database Webinar
Heroku Postgres Cloud Database Webinar
 

Similar to Blockchain: Developer's Perspective (Java Edition)

Blockchain: Developer Perspective
Blockchain: Developer PerspectiveBlockchain: Developer Perspective
Blockchain: Developer Perspective
Artur Skowroński
 
Let's Build A Blockchain... in 40 minutes!
Let's Build A Blockchain... in 40 minutes!Let's Build A Blockchain... in 40 minutes!
Let's Build A Blockchain... in 40 minutes!
Michel Schudel
 
BlockChain implementation by python
BlockChain implementation by pythonBlockChain implementation by python
BlockChain implementation by python
wonyong hwang
 
Meta X Blockchain Bootcamp
Meta X Blockchain BootcampMeta X Blockchain Bootcamp
Meta X Blockchain Bootcamp
MetaX
 
Blockchain
BlockchainBlockchain
Blockchain
Scott Turner
 
A Comprehensive Guide To Create Blockchain In Python | Blockchain Development...
A Comprehensive Guide To Create Blockchain In Python | Blockchain Development...A Comprehensive Guide To Create Blockchain In Python | Blockchain Development...
A Comprehensive Guide To Create Blockchain In Python | Blockchain Development...
Mariya James
 
Real time and reliable processing with Apache Storm
Real time and reliable processing with Apache StormReal time and reliable processing with Apache Storm
Real time and reliable processing with Apache Storm
Andrea Iacono
 
Let's build a blockchain.... in 40 minutes!
Let's build a blockchain.... in 40 minutes!Let's build a blockchain.... in 40 minutes!
Let's build a blockchain.... in 40 minutes!
Michel Schudel
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Codemotion
 
Blockchain com JavaScript
Blockchain com JavaScriptBlockchain com JavaScript
Blockchain com JavaScript
Beto Muniz
 
Introduction to Blockchain Web3 Session
Introduction to Blockchain Web3 SessionIntroduction to Blockchain Web3 Session
Introduction to Blockchain Web3 Session
DSCIITPatna
 
JDD2015: Where Test Doubles can lead you... - Sebastian Malaca
JDD2015: Where Test Doubles can lead you...  - Sebastian Malaca JDD2015: Where Test Doubles can lead you...  - Sebastian Malaca
JDD2015: Where Test Doubles can lead you... - Sebastian Malaca
PROIDEA
 
Mobile Web 5.0
Mobile Web 5.0Mobile Web 5.0
Mobile Web 5.0
Michael Galpin
 
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing - Node.j...
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing - Node.j...Cracking JWT tokens: a tale of magic, Node.JS and parallel computing - Node.j...
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing - Node.j...
Luciano Mammino
 
Luciano Mammino - Cracking JWT tokens: a tale of magic, Node.JS and parallel...
Luciano Mammino  - Cracking JWT tokens: a tale of magic, Node.JS and parallel...Luciano Mammino  - Cracking JWT tokens: a tale of magic, Node.JS and parallel...
Luciano Mammino - Cracking JWT tokens: a tale of magic, Node.JS and parallel...
Codemotion
 
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing
Cracking JWT tokens: a tale of magic, Node.JS and parallel computingCracking JWT tokens: a tale of magic, Node.JS and parallel computing
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing
Luciano Mammino
 
BITCOIN FORENSICS : Bsides Delhi Conference
BITCOIN FORENSICS : Bsides Delhi ConferenceBITCOIN FORENSICS : Bsides Delhi Conference
BITCOIN FORENSICS : Bsides Delhi Conference
anupriti
 
RxJava - Subject 入門
RxJava - Subject 入門RxJava - Subject 入門
RxJava - Subject 入門
Fumihiko Shiroyama
 
DIY-Blockchain
DIY-BlockchainDIY-Blockchain
DIY-Blockchain
Maximilian Reichel
 

Similar to Blockchain: Developer's Perspective (Java Edition) (19)

Blockchain: Developer Perspective
Blockchain: Developer PerspectiveBlockchain: Developer Perspective
Blockchain: Developer Perspective
 
Let's Build A Blockchain... in 40 minutes!
Let's Build A Blockchain... in 40 minutes!Let's Build A Blockchain... in 40 minutes!
Let's Build A Blockchain... in 40 minutes!
 
BlockChain implementation by python
BlockChain implementation by pythonBlockChain implementation by python
BlockChain implementation by python
 
Meta X Blockchain Bootcamp
Meta X Blockchain BootcampMeta X Blockchain Bootcamp
Meta X Blockchain Bootcamp
 
Blockchain
BlockchainBlockchain
Blockchain
 
A Comprehensive Guide To Create Blockchain In Python | Blockchain Development...
A Comprehensive Guide To Create Blockchain In Python | Blockchain Development...A Comprehensive Guide To Create Blockchain In Python | Blockchain Development...
A Comprehensive Guide To Create Blockchain In Python | Blockchain Development...
 
Real time and reliable processing with Apache Storm
Real time and reliable processing with Apache StormReal time and reliable processing with Apache Storm
Real time and reliable processing with Apache Storm
 
Let's build a blockchain.... in 40 minutes!
Let's build a blockchain.... in 40 minutes!Let's build a blockchain.... in 40 minutes!
Let's build a blockchain.... in 40 minutes!
 
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
Michel Schudel - Let's build a blockchain... in 40 minutes! - Codemotion Amst...
 
Blockchain com JavaScript
Blockchain com JavaScriptBlockchain com JavaScript
Blockchain com JavaScript
 
Introduction to Blockchain Web3 Session
Introduction to Blockchain Web3 SessionIntroduction to Blockchain Web3 Session
Introduction to Blockchain Web3 Session
 
JDD2015: Where Test Doubles can lead you... - Sebastian Malaca
JDD2015: Where Test Doubles can lead you...  - Sebastian Malaca JDD2015: Where Test Doubles can lead you...  - Sebastian Malaca
JDD2015: Where Test Doubles can lead you... - Sebastian Malaca
 
Mobile Web 5.0
Mobile Web 5.0Mobile Web 5.0
Mobile Web 5.0
 
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing - Node.j...
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing - Node.j...Cracking JWT tokens: a tale of magic, Node.JS and parallel computing - Node.j...
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing - Node.j...
 
Luciano Mammino - Cracking JWT tokens: a tale of magic, Node.JS and parallel...
Luciano Mammino  - Cracking JWT tokens: a tale of magic, Node.JS and parallel...Luciano Mammino  - Cracking JWT tokens: a tale of magic, Node.JS and parallel...
Luciano Mammino - Cracking JWT tokens: a tale of magic, Node.JS and parallel...
 
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing
Cracking JWT tokens: a tale of magic, Node.JS and parallel computingCracking JWT tokens: a tale of magic, Node.JS and parallel computing
Cracking JWT tokens: a tale of magic, Node.JS and parallel computing
 
BITCOIN FORENSICS : Bsides Delhi Conference
BITCOIN FORENSICS : Bsides Delhi ConferenceBITCOIN FORENSICS : Bsides Delhi Conference
BITCOIN FORENSICS : Bsides Delhi Conference
 
RxJava - Subject 入門
RxJava - Subject 入門RxJava - Subject 入門
RxJava - Subject 入門
 
DIY-Blockchain
DIY-BlockchainDIY-Blockchain
DIY-Blockchain
 

More from Artur Skowroński

Kopiąc Trufle - Odkrywanie tajemnic najmniej zrozumiałego elementu GraalVM
Kopiąc Trufle - Odkrywanie tajemnic najmniej zrozumiałego elementu GraalVMKopiąc Trufle - Odkrywanie tajemnic najmniej zrozumiałego elementu GraalVM
Kopiąc Trufle - Odkrywanie tajemnic najmniej zrozumiałego elementu GraalVM
Artur Skowroński
 
The State of the Green IT at the beginning of 2024
The State of the Green IT at the beginning of 2024The State of the Green IT at the beginning of 2024
The State of the Green IT at the beginning of 2024
Artur Skowroński
 
My chcemy grać w Zielone! Czyli stan świata Green Technology końcówką 2023
My chcemy grać w Zielone! Czyli stan świata Green Technology końcówką 2023My chcemy grać w Zielone! Czyli stan świata Green Technology końcówką 2023
My chcemy grać w Zielone! Czyli stan świata Green Technology końcówką 2023
Artur Skowroński
 
GraalVM, CRaC, Leyden and friends
GraalVM, CRaC, Leyden and friendsGraalVM, CRaC, Leyden and friends
GraalVM, CRaC, Leyden and friends
Artur Skowroński
 
Od Czarnoksiężnik z krainy Oz do modeli na produkcji
Od Czarnoksiężnik z krainy Oz do modeli na produkcjiOd Czarnoksiężnik z krainy Oz do modeli na produkcji
Od Czarnoksiężnik z krainy Oz do modeli na produkcji
Artur Skowroński
 
JVM Iceberg... we need to go deeper
JVM Iceberg... we need to go deeperJVM Iceberg... we need to go deeper
JVM Iceberg... we need to go deeper
Artur Skowroński
 
JVM Iceberg... we need to go deeper
JVM Iceberg... we need to go deeperJVM Iceberg... we need to go deeper
JVM Iceberg... we need to go deeper
Artur Skowroński
 
Panie, kto tu Panu tak ... - czyli porozmawiajmy o Legacy
Panie, kto tu Panu tak ... - czyli porozmawiajmy o LegacyPanie, kto tu Panu tak ... - czyli porozmawiajmy o Legacy
Panie, kto tu Panu tak ... - czyli porozmawiajmy o Legacy
Artur Skowroński
 
Panie, kto tu Panu tak ... - czyli porozmawiajmy o Legacy
Panie, kto tu Panu tak ... - czyli porozmawiajmy o LegacyPanie, kto tu Panu tak ... - czyli porozmawiajmy o Legacy
Panie, kto tu Panu tak ... - czyli porozmawiajmy o Legacy
Artur Skowroński
 
Ciąg dalszy nastąpi - o wielowątkowości, Projekcie Loom i kotlinowych Korutynach
Ciąg dalszy nastąpi - o wielowątkowości, Projekcie Loom i kotlinowych KorutynachCiąg dalszy nastąpi - o wielowątkowości, Projekcie Loom i kotlinowych Korutynach
Ciąg dalszy nastąpi - o wielowątkowości, Projekcie Loom i kotlinowych Korutynach
Artur Skowroński
 
Artur Skowroński – Ten Typ tak ma - O systemach typów na przykładzie TypeScri...
Artur Skowroński – Ten Typ tak ma - O systemach typów na przykładzie TypeScri...Artur Skowroński – Ten Typ tak ma - O systemach typów na przykładzie TypeScri...
Artur Skowroński – Ten Typ tak ma - O systemach typów na przykładzie TypeScri...
Artur Skowroński
 
Ten Typ tak ma - O systemach typów na przykładzie TypeScript’a
Ten Typ tak ma - O systemach typów na przykładzie TypeScript’aTen Typ tak ma - O systemach typów na przykładzie TypeScript’a
Ten Typ tak ma - O systemach typów na przykładzie TypeScript’a
Artur Skowroński
 
Type Systems on the example of TypeScript
Type Systems on the example of TypeScriptType Systems on the example of TypeScript
Type Systems on the example of TypeScript
Artur Skowroński
 
Google Assistant po polsku - developerski punkt widzenia
Google Assistant po polsku - developerski punkt widzeniaGoogle Assistant po polsku - developerski punkt widzenia
Google Assistant po polsku - developerski punkt widzenia
Artur Skowroński
 
Google Assistant & Alexa - Asystenci głosowi: możliwości, podobieństwa, różnice
Google Assistant & Alexa - Asystenci głosowi: możliwości, podobieństwa, różniceGoogle Assistant & Alexa - Asystenci głosowi: możliwości, podobieństwa, różnice
Google Assistant & Alexa - Asystenci głosowi: możliwości, podobieństwa, różnice
Artur Skowroński
 
To Be Continued - multithreading with Project Loom and Kotlin's Coroutines
To Be Continued - multithreading with Project Loom and Kotlin's CoroutinesTo Be Continued - multithreading with Project Loom and Kotlin's Coroutines
To Be Continued - multithreading with Project Loom and Kotlin's Coroutines
Artur Skowroński
 
To be Continued - multithreading with Project Loom and Kotlin's Coroutines
To be Continued - multithreading with Project Loom and Kotlin's CoroutinesTo be Continued - multithreading with Project Loom and Kotlin's Coroutines
To be Continued - multithreading with Project Loom and Kotlin's Coroutines
Artur Skowroński
 
Alexa, nice to meet you!
Alexa, nice to meet you! Alexa, nice to meet you!
Alexa, nice to meet you!
Artur Skowroński
 
Alexa, nice to meet(js) you!
Alexa, nice to meet(js) you!Alexa, nice to meet(js) you!
Alexa, nice to meet(js) you!
Artur Skowroński
 
Change Detection Anno Domini 2016
Change Detection Anno Domini 2016Change Detection Anno Domini 2016
Change Detection Anno Domini 2016
Artur Skowroński
 

More from Artur Skowroński (20)

Kopiąc Trufle - Odkrywanie tajemnic najmniej zrozumiałego elementu GraalVM
Kopiąc Trufle - Odkrywanie tajemnic najmniej zrozumiałego elementu GraalVMKopiąc Trufle - Odkrywanie tajemnic najmniej zrozumiałego elementu GraalVM
Kopiąc Trufle - Odkrywanie tajemnic najmniej zrozumiałego elementu GraalVM
 
The State of the Green IT at the beginning of 2024
The State of the Green IT at the beginning of 2024The State of the Green IT at the beginning of 2024
The State of the Green IT at the beginning of 2024
 
My chcemy grać w Zielone! Czyli stan świata Green Technology końcówką 2023
My chcemy grać w Zielone! Czyli stan świata Green Technology końcówką 2023My chcemy grać w Zielone! Czyli stan świata Green Technology końcówką 2023
My chcemy grać w Zielone! Czyli stan świata Green Technology końcówką 2023
 
GraalVM, CRaC, Leyden and friends
GraalVM, CRaC, Leyden and friendsGraalVM, CRaC, Leyden and friends
GraalVM, CRaC, Leyden and friends
 
Od Czarnoksiężnik z krainy Oz do modeli na produkcji
Od Czarnoksiężnik z krainy Oz do modeli na produkcjiOd Czarnoksiężnik z krainy Oz do modeli na produkcji
Od Czarnoksiężnik z krainy Oz do modeli na produkcji
 
JVM Iceberg... we need to go deeper
JVM Iceberg... we need to go deeperJVM Iceberg... we need to go deeper
JVM Iceberg... we need to go deeper
 
JVM Iceberg... we need to go deeper
JVM Iceberg... we need to go deeperJVM Iceberg... we need to go deeper
JVM Iceberg... we need to go deeper
 
Panie, kto tu Panu tak ... - czyli porozmawiajmy o Legacy
Panie, kto tu Panu tak ... - czyli porozmawiajmy o LegacyPanie, kto tu Panu tak ... - czyli porozmawiajmy o Legacy
Panie, kto tu Panu tak ... - czyli porozmawiajmy o Legacy
 
Panie, kto tu Panu tak ... - czyli porozmawiajmy o Legacy
Panie, kto tu Panu tak ... - czyli porozmawiajmy o LegacyPanie, kto tu Panu tak ... - czyli porozmawiajmy o Legacy
Panie, kto tu Panu tak ... - czyli porozmawiajmy o Legacy
 
Ciąg dalszy nastąpi - o wielowątkowości, Projekcie Loom i kotlinowych Korutynach
Ciąg dalszy nastąpi - o wielowątkowości, Projekcie Loom i kotlinowych KorutynachCiąg dalszy nastąpi - o wielowątkowości, Projekcie Loom i kotlinowych Korutynach
Ciąg dalszy nastąpi - o wielowątkowości, Projekcie Loom i kotlinowych Korutynach
 
Artur Skowroński – Ten Typ tak ma - O systemach typów na przykładzie TypeScri...
Artur Skowroński – Ten Typ tak ma - O systemach typów na przykładzie TypeScri...Artur Skowroński – Ten Typ tak ma - O systemach typów na przykładzie TypeScri...
Artur Skowroński – Ten Typ tak ma - O systemach typów na przykładzie TypeScri...
 
Ten Typ tak ma - O systemach typów na przykładzie TypeScript’a
Ten Typ tak ma - O systemach typów na przykładzie TypeScript’aTen Typ tak ma - O systemach typów na przykładzie TypeScript’a
Ten Typ tak ma - O systemach typów na przykładzie TypeScript’a
 
Type Systems on the example of TypeScript
Type Systems on the example of TypeScriptType Systems on the example of TypeScript
Type Systems on the example of TypeScript
 
Google Assistant po polsku - developerski punkt widzenia
Google Assistant po polsku - developerski punkt widzeniaGoogle Assistant po polsku - developerski punkt widzenia
Google Assistant po polsku - developerski punkt widzenia
 
Google Assistant & Alexa - Asystenci głosowi: możliwości, podobieństwa, różnice
Google Assistant & Alexa - Asystenci głosowi: możliwości, podobieństwa, różniceGoogle Assistant & Alexa - Asystenci głosowi: możliwości, podobieństwa, różnice
Google Assistant & Alexa - Asystenci głosowi: możliwości, podobieństwa, różnice
 
To Be Continued - multithreading with Project Loom and Kotlin's Coroutines
To Be Continued - multithreading with Project Loom and Kotlin's CoroutinesTo Be Continued - multithreading with Project Loom and Kotlin's Coroutines
To Be Continued - multithreading with Project Loom and Kotlin's Coroutines
 
To be Continued - multithreading with Project Loom and Kotlin's Coroutines
To be Continued - multithreading with Project Loom and Kotlin's CoroutinesTo be Continued - multithreading with Project Loom and Kotlin's Coroutines
To be Continued - multithreading with Project Loom and Kotlin's Coroutines
 
Alexa, nice to meet you!
Alexa, nice to meet you! Alexa, nice to meet you!
Alexa, nice to meet you!
 
Alexa, nice to meet(js) you!
Alexa, nice to meet(js) you!Alexa, nice to meet(js) you!
Alexa, nice to meet(js) you!
 
Change Detection Anno Domini 2016
Change Detection Anno Domini 2016Change Detection Anno Domini 2016
Change Detection Anno Domini 2016
 

Recently uploaded

The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
laozhuseo02
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Sanjeev Rampal
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
3ipehhoa
 
Output determination SAP S4 HANA SAP SD CC
Output determination SAP S4 HANA SAP SD CCOutput determination SAP S4 HANA SAP SD CC
Output determination SAP S4 HANA SAP SD CC
ShahulHameed54211
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
JeyaPerumal1
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
laozhuseo02
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
3ipehhoa
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
3ipehhoa
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
Arif0071
 
ER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAE
Himani415946
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
nirahealhty
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
Rogerio Filho
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
JungkooksNonexistent
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
natyesu
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
Gal Baras
 
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptxLiving-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
TristanJasperRamos
 

Recently uploaded (16)

The+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptxThe+Prospects+of+E-Commerce+in+China.pptx
The+Prospects+of+E-Commerce+in+China.pptx
 
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and GuidelinesMulti-cluster Kubernetes Networking- Patterns, Projects and Guidelines
Multi-cluster Kubernetes Networking- Patterns, Projects and Guidelines
 
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
急速办(bedfordhire毕业证书)英国贝德福特大学毕业证成绩单原版一模一样
 
Output determination SAP S4 HANA SAP SD CC
Output determination SAP S4 HANA SAP SD CCOutput determination SAP S4 HANA SAP SD CC
Output determination SAP S4 HANA SAP SD CC
 
1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...1.Wireless Communication System_Wireless communication is a broad term that i...
1.Wireless Communication System_Wireless communication is a broad term that i...
 
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shopHistory+of+E-commerce+Development+in+China-www.cfye-commerce.shop
History+of+E-commerce+Development+in+China-www.cfye-commerce.shop
 
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
1比1复刻(bath毕业证书)英国巴斯大学毕业证学位证原版一模一样
 
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
原版仿制(uob毕业证书)英国伯明翰大学毕业证本科学历证书原版一模一样
 
test test test test testtest test testtest test testtest test testtest test ...
test test  test test testtest test testtest test testtest test testtest test ...test test  test test testtest test testtest test testtest test testtest test ...
test test test test testtest test testtest test testtest test testtest test ...
 
ER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAEER(Entity Relationship) Diagram for online shopping - TAE
ER(Entity Relationship) Diagram for online shopping - TAE
 
This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!This 7-second Brain Wave Ritual Attracts Money To You.!
This 7-second Brain Wave Ritual Attracts Money To You.!
 
guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...guildmasters guide to ravnica Dungeons & Dragons 5...
guildmasters guide to ravnica Dungeons & Dragons 5...
 
Latest trends in computer networking.pptx
Latest trends in computer networking.pptxLatest trends in computer networking.pptx
Latest trends in computer networking.pptx
 
BASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptxBASIC C++ lecture NOTE C++ lecture 3.pptx
BASIC C++ lecture NOTE C++ lecture 3.pptx
 
How to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptxHow to Use Contact Form 7 Like a Pro.pptx
How to Use Contact Form 7 Like a Pro.pptx
 
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptxLiving-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
Living-in-IT-era-Module-7-Imaging-and-Design-for-Social-Impact.pptx
 

Blockchain: Developer's Perspective (Java Edition)

  • 2. TEXT HOW TO BECOME RICH INVESTOR’S PERSPECTIVE
  • 7.
  • 11. TEXT
  • 12. TEXT
  • 13. TEXT
  • 15.
  • 16.
  • 19. ?
  • 29. TEXT LET’S CODEBASED ON NAIVECHAIN BY @LHARTIKK @ARTURSKOWRONSKI/NAIVECHAIN-JAVA
  • 30. TEXT P2P (WebSockets) P2P (WebSockets) P2P (WebSockets)
  • 31. public class Block { protected int index; protected String hash; protected String previousHash; protected long timestamp; protected Object data; protected int nonce; } BLOCK PART
  • 32. BLOCK PART public class Block { protected int index; protected String hash; protected String previousHash; protected long timestamp; protected Object data; protected int nonce; }
  • 33. BLOCK PART public class Block { protected int index; protected String hash; protected String previousHash; protected long timestamp; protected Object data; protected int nonce; }
  • 34. BLOCK PART public class Block { protected int index; protected String hash; protected String previousHash; protected long timestamp; protected Object data; protected int nonce; }
  • 35. BLOCK PART public class Block { protected int index; protected String hash; protected String previousHash; protected long timestamp; protected Object data; protected int nonce; }
  • 36. CHAIN PART public class Blockchain extends LinkedList<Block> { public Blockchain(Block block) { this.add(GENESIS_BLOCK); } }
  • 37. CHAIN PART public class Blockchain extends LinkedList<Block> { public Blockchain(Block block) { this.add(GENESIS_BLOCK); } }
  • 38. CHAIN PART public class Blockchain extends LinkedList<Block> { public Blockchain(Block block) { this.add(GENESIS_BLOCK); } }
  • 39. CHAIN PART public class Blockchain extends LinkedList<Block> { public Blockchain(Block block) { this.add(GENESIS_BLOCK); } }
  • 40. GENESIS BLOCK public static final Block GENESIS_BLOCK = new Block( 0, //index “e6337db8a921823784c14378abed4f7d7", //hash null, //previousHash 1465154705, //timestamp "Pozdro Bielsko-Biala!”, //data 0 //nonce );
  • 41. MINING BLOCK public class BlockchainService { Blockchain chain = new Blockchain(); public Block mineBlock(Object data) => { Block newBlock = nextBlock(chain.getLast(), data); chain.addBlock(newBlock); return chain.getLast(); }; }
  • 42. MINING BLOCK public class BlockchainService { Blockchain chain = new Blockchain(); public Block mineBlock(Object data) => { Block newBlock = nextBlock(chain.getLast(), data); chain.addBlock(newBlock); return chain.getLast(); }; }
  • 43. MINING BLOCK public class BlockchainService { Blockchain chain = new Blockchain(); public Block mineBlock(Object data) => { Block newBlock = nextBlock(chain.getLast(), data); chain.addBlock(newBlock); return chain.getLast(); }; }
  • 44. MINING BLOCK public static Block nextBlock(Block prevBlock, Object data) { int nextIndex = previousBlock.index + 1; String prevHash = prevBlock.getHash(); long nextTime = new Date().getTime(); String nextHash = calculateHash(nextIndex, prevHash, nextTime, data); return new Block(nextIndex, prevHash, nextHash, nextTime, data); }
  • 45. MINING BLOCK public static Block nextBlock(Block prevBlock, Object data) { int nextIndex = previousBlock.index + 1; String prevHash = prevBlock.getHash(); long nextTime = new Date().getTime(); String nextHash = calculateHash(nextIndex, prevHash, nextTime, data); return new Block(nextIndex, prevHash, nextHash, nextTime, data); }
  • 46. MINING BLOCK public static Block nextBlock(Block prevBlock, Object data) { int nextIndex = previousBlock.index + 1; String prevHash = prevBlock.getHash(); long nextTime = new Date().getTime(); String nextHash = calculateHash(nextIndex, prevHash, nextTime, data); return new Block(nextIndex, prevHash, nextHash, nextTime, data); }
  • 47. MINING BLOCK public static Block nextBlock(Block prevBlock, Object data) { int nextIndex = previousBlock.index + 1; String prevHash = prevBlock.getHash(); long nextTime = new Date().getTime(); String nextHash = calculateHash(nextIndex, prevHash, nextTime, data); return new Block(nextIndex, prevHash, nextHash, nextTime, data); }
  • 48. MINING BLOCK public static Block nextBlock(Block prevBlock, Object data) { int nextIndex = previousBlock.index + 1; String prevHash = prevBlock.getHash(); long nextTime = new Date().getTime(); String nextHash = calculateHash(nextIndex, prevHash, nextTime, data); return new Block(nextIndex, prevHash, nextHash, nextTime, data); }
  • 49. CALCULATE HASH private String calculateHash(int index, String prevHash, long ts, Object data) { return sha256Hex(index + prevHash + ts + data.hashCode()); }
  • 50. MINING BLOCK public static Block nextBlock(Block prevBlock, Object data) { int nextIndex = previousBlock.index + 1; String prevHash = prevBlock.getHash(); long nextTime = new Date().getTime(); String nextHash = calculateHash(nextIndex, prevHash, nextTime, data); return new Block(nextIndex, prevHash, nextHash, nextTime, data); }
  • 51. MINING BLOCK public class BlockchainService { Blockchain chain = new Blockchain(); public Block mineBlock(Object data) => { Block newBlock = nextBlock(chain.getLast(), data); chain.addBlock(newBlock); return chain.getLast(); }; }
  • 52. ADDING BLOCK TO CHAIN public class Blockchain extends LinkedList<Block> { (...) public BlockchainResponse addBlock(Block block){ if(isValidNewBlock(getLast(), block)) { add(block); } return new BlockchainResponse(RESPONSE_BLOCKCHAIN, block); } (...) }
  • 53. ADDING BLOCK TO CHAIN public class Blockchain extends LinkedList<Block> { (...) public BlockchainResponse addBlock(Block block){ if(isValidNewBlock(getLast(), block)) { add(block); } return new BlockchainResponse(RESPONSE_BLOCKCHAIN, block); } (...) }
  • 54. BLOCK VALIDATION public static boolean isValidNewBlock(Block previousBlock, Block newBlock){ if (previousBlock.getIndex() + 1 != newBlock.getIndex()) { return false; } if (!previousBlock.getHash().equals(newBlock.getHash())) { return false; } if (calculateHashForBlock(newBlock).equals(newBlock.getHash())) { return false; } return true; }
  • 55. BLOCK VALIDATION public static boolean isValidNewBlock(Block previousBlock, Block newBlock){ if (previousBlock.getIndex() + 1 != newBlock.getIndex()) { return false; } if (!previousBlock.getHash().equals(newBlock.getHash())) { return false; } if (calculateHashForBlock(newBlock).equals(newBlock.getHash())) { return false; } return true; }
  • 56. BLOCK VALIDATION public static boolean isValidNewBlock(Block previousBlock, Block newBlock){ if (previousBlock.getIndex() + 1 != newBlock.getIndex()) { return false; } if (!previousBlock.getHash().equals(newBlock.getHash())) { return false; } if (calculateHashForBlock(newBlock).equals(newBlock.getHash())) { return false; } return true; }
  • 57. BLOCK VALIDATION public static boolean isValidNewBlock(Block previousBlock, Block newBlock){ if (previousBlock.getIndex() + 1 != newBlock.getIndex()) { return false; } if (!previousBlock.getHash().equals(newBlock.getHash())) { return false; } if (calculateHashForBlock(newBlock).equals(newBlock.getHash())) { return false; } return true; }
  • 58. ADDING BLOCK TO CHAIN public class Blockchain extends LinkedList<Block> { (...) public BlockchainResponse addBlock(Block block){ if(isValidNewBlock(getLast(), block)) { add(block); } return new BlockchainResponse(RESPONSE_BLOCKCHAIN, block); } (...) }
  • 59. TEXT Hash #0 Genesis Block Hash #1 PrevHash #0 Hash #2 PrevHash #1 BLOCKCHAIN
  • 60. ADDING BLOCK TO CHAIN public class Blockchain extends LinkedList<Block> { (...) public Response addBlock(Block block){ if(isValidNewBlock(getLast(), block)) { add(block); } return new Response(RESPONSE_BLOCKCHAIN, block); } (...) }
  • 62. NEW BLOCK HANDLING public Response handleBlockchainResponse(Blockchain newChain) { if (newChain.getLast().getIndex() > chain.getLast().getIndex()) { if (chain.getLast().getHash().equals(newChain.getLast().getPreviousHash())){ chain.addBlock(latestBlockReceived); return new Response(RESPONSE_BLOCKCHAIN, new Blockchain(chain.getLast())); } return exchangeChains(newChain); } return new Response(DO_NOTHING); }
  • 63. NEW BLOCK HANDLING public Response handleBlockchainResponse(Blockchain newChain) { if (newChain.getLast().getIndex() > chain.getLast().getIndex()) { if (chain.getLast().getHash().equals(newChain.getLast().getPreviousHash())){ chain.addBlock(latestBlockReceived); return new Response(RESPONSE_BLOCKCHAIN, new Blockchain(chain.getLast())); } return exchangeChains(newChain); } return new Response(DO_NOTHING); }
  • 64. NEW BLOCK HANDLING public Response handleBlockchainResponse(Blockchain newChain) { if (newChain.getLast().getIndex() > chain.getLast().getIndex()) { if (chain.getLast().getHash().equals(newChain.getLast().getPreviousHash())){ chain.addBlock(latestBlockReceived); return new Response(RESPONSE_BLOCKCHAIN, new Blockchain(chain.getLast())); } return exchangeChains(newChain); } return new Response(DO_NOTHING); }
  • 65. NEW BLOCK HANDLING public Response handleBlockchainResponse(Blockchain newChain) { if (newChain.getLast().getIndex() > chain.getLast().getIndex()) { if (chain.getLast().getHash().equals(newChain.getLast().getPreviousHash())){ chain.addBlock(latestBlockReceived); return new BlockchainResponse(RESPONSE_BLOCKCHAIN, new Blockchain(chain.getLast())); } return exchangeChains(newChain); } return new BlockchainResponse(DO_NOTHING); }
  • 68. REPLACING CHAIN private Response exchangeChain(Blockchain newBlockchain) { if (newBlockchain.isValidChain() && newBlockchain.size() > chain.size()) { chain = newBlockchain; return new Response(RESPONSE_BLOCKCHAIN, new Blockchain(chain.getLast())); } else { return new Response(DO_NOTHING); }
 }
  • 69. REPLACING CHAIN private Response exchangeChain(Blockchain newBlockchain) { if (newBlockchain.isValidChain() && newBlockchain.size() > chain.size()) { chain = newBlockchain; return new Response(RESPONSE_BLOCKCHAIN, new Blockchain(chain.getLast())); } else { return new Response(DO_NOTHING); }
 }
  • 70. REPLACING CHAIN private Response exchangeChain(Blockchain newBlockchain) { if (newBlockchain.isValidChain() && newBlockchain.size() > chain.size()) { chain = newBlockchain; return new Response(RESPONSE_BLOCKCHAIN, new Blockchain(chain.getLast())); } else { return new Response(DO_NOTHING); }
 }
  • 71. VALIDATING CHAIN public boolean isValidChain(){ if (!this.getFirst().equals(GENESIS_BLOCK)){ return false; } for (int i = 1; i < this.size() - 1; i++) { if (!Block.isValidNewBlock(this.get(i - 1), this.get(i))){ return false; } } return true; }
  • 72. VALIDATING CHAIN public boolean isValidChain(){ if (!this.getFirst().equals(GENESIS_BLOCK)){ return false; } for (int i = 1; i < this.size() - 1; i++) { if (!Block.isValidNewBlock(this.get(i - 1), this.get(i))){ return false; } } return true; }
  • 73. VALIDATING CHAIN public boolean isValidChain(){ if (!this.getFirst().equals(GENESIS_BLOCK)){ return false; } for (int i = 1; i < this.size() - 1; i++) { if (!Block.isValidNewBlock(this.get(i - 1), this.get(i))){ return false; } } return true; }
  • 74. REPLACING CHAIN private Response exchangeChain(Blockchain newBlockchain) { if (newBlockchain.isValidChain() && newBlockchain.size() > chain.size()) { chain = newBlockchain; return new Response(RESPONSE_BLOCKCHAIN, new Blockchain(chain.getLast())); } else { return new Response(DO_NOTHING); }
 }
  • 78. PROOF-OF-WORK private static HashPair calculateHash(int index, String previousHash, Object data) { int nonce = 0; while (true) { nonce++; String value = sha256Hex(index + previousHash + data.hashCode() + nonce); if (value.startsWith(“000")) { return new HashPair(nounce, value); } } }
  • 79. PROOF-OF-WORK private static HashPair calculateHash(int index, String previousHash, Object data) { int nonce = 0; while (true) { nonce++; String value = sha256Hex(index + previousHash + data.hashCode() + nonce); if (value.startsWith(“000")) { return new HashPair(nounce, value); } } }
  • 80. PROOF-OF-WORK private static HashPair calculateHash(int index, String previousHash, Object data) { int nonce = 0; while (true) { nonce++; String value = sha256Hex(index + previousHash + data.hashCode() + nonce); if (value.startsWith(“000")) { return new HashPair(nonce, value); } } }
  • 81. PROOF-OF-WORK private static HashPair calculateHash(int index, String previousHash, Object data) { int nonce = 0; while (true) { nonce++; String value = sha256Hex(index + previousHash + data.hashCode() + nonce); if (value.startsWith(“000")) { return new HashPair(nonce, value); } } }
  • 82. PROOF-OF-WORK private static HashPair calculateHash(int index, String previousHash, Object data) { int nonce = 0; while (true) { nonce++; String value = sha256Hex(index + previousHash + data.hashCode() + nonce); if (value.startsWith(“000")) { return new HashPair(nonce, value); } } }
  • 83. PROOF-OF-WORK private static HashPair calculateHash(int index, String previousHash, Object data) { int nonce = 0; while (true) { nonce++; String value = sha256Hex(index + previousHash + data.hashCode() + nonce); if (value.startsWith(“000")) { return new HashPair(nonce, value); } } }
  • 84. PROOF-OF-WORK private static HashPair calculateHash(int index, String previousHash, Object data) { int nonce = 0; while (true) { nonce++; String value = sha256Hex(index + previousHash + data.hashCode() + nonce); if (value.startsWith(“000")) { return new HashPair(nonce, value); } } }
  • 86. TEXT I HAVE HASH! 000004CEEF5782B82C212CE725F15594! 00000ee187308970bb63446f3f910e98000004ceef5782b82c212ce725f15594
  • 87. TEXT Hash #0 Hash #1 Hash #2 SECURITY Hash #0 Hash #1
 Prev #0 Hash #2
 Prev #1 Hash #3
 Prev #2 Hash #4
 Prev #3 Hash #1x Hash #2x
 Prev #1x Hash #3x
 Prev #2x FORK
  • 88. ▸ = 50% OF WHOLE NETWORK
  • 89. TEXT BLOCKCHAIN Hash #1
 Prev #2 Hash #2
 Prev #3 Hash #0
 Prev #1 Hash #0 $ $ $
  • 99. TEXT SMART CONTRACTS INITIAL COIN OFFERINGS SOFT & HARD FORKS
  • 101. TEXT
  • 102. THANK YOU AND WAITING FOR QUESTIONS @ArturSkowronski arturskowronski.com