SlideShare a Scribd company logo
1 of 22
The Scorex Project
Alexander Chepurnoy
A Cryptocurrency Engine in Scala
My Background
● Nxt Core Developer
● SmartContract.com / Secureae.com backend dev
● Consensus Research member
Fields of Interest
● Distributed & P2P systems
● Blockchain Tech
● Functional Programming (Haskell / Scala)
● Finite State Machines
● Formal Methods (model checking / Coq)
The Design of a Cryptocurrency
● P2P Network
● Persistent distributed fully-replicate database (aka
Blockchain)
● Transactions over tokens grouped within blocks, a block is
a database version
● Consensus algorithm
● Optional: additional layers on top of transactional
layer(mesages, tokens, code)
A Blockchain Structure
Blockchain As Database
● Persistent(versioned) database
● Genesis state – initial verion of the database
● Block as state modifier: State(h) * Block → State(h+1)
● Very weak consistency!
BlockTree
Consensus About Blockchain
● Proof-of-Work
● Proof-of-Stake
● Hybrid: Proof-of-Work+Proof-of-Activity, Proof-of-
Stake+Proof-of-Activity
Weakest Consensus Property
● After k permutations a state of the blockchain database for
versions 1..N-k is considered to be stable (with some
assumptions made)
● Bitcoin(PoW): k = 6
● Proof-of-Stake: k = ?
Proof-of-Work
● Secured by NP problem
● (not by cryptography magic!)
● Find x by hash(x) is well-known NP problem
● PrimeCoin: Cunningham chains
● Length could be considered as a chain quality measure(in
the blocktree)
Proof-of-Stake
● No mining
● Consensus is within network
● Right to generate a block depends on stake
● hit < target
● CumulativeDificulty is the chain quality measure(in the
blocktree)
Bitcoin: Scripts Attached
Input:
Previous tx: 030b5937d9f4aaa1a3133b...
Index: 0
scriptSig: 0dcd253cdf8ea11cdc710e5e92af7647...
Output:
Value: 5000000000
scriptPubKey: OP_DUP OP_HASH160
a45f2757f94fd2337ebf7ddd018c11a21fb6c283
OP_EQUALVERIFY OP_CHECKSIG
Problem
● Bitcoin has more than 100K LoC's (80K C++ only)
● Nxt 40+K LoCs(Java)
● Even simple(and pretty buggy) Qora is ~20K (Java)
● Each product's code is hard to understand
● Hard to make experiments
● It's easy to make an error
Security Problems
● Consensus algo flaws – FATAL
● Transaction layer flaws – from trivial to critical
● Network layer – ddoses, unconfirmed pool attacks
Bitcoin: Transaction Layer bug
On July 28 2010, two bugs were discovered and
demonstrated on the test network. One exploited a bug in
the transaction handling code and allowed an attacker to
spend coins that they did not own. This was never
exploited on the main network, and was fixed by Bitcoin
version 0.3.5.
After these bugs were discovered, many currently-unused
script words were disabled for safety.
Bitcoin: Transaction Layer Bug
On 15 August 2010, with an exploit over 184 billion
bitcoins were generated in a transaction, and sent to two
addresses on the network. This was the only major
security flaw found and exploited in Bitcoin's history.
● Fixed with hard-fork
Better Quality of Blockchain Impls
● Safer languages(Scala/Ocaml, Haskell, Idris/Coq)
● Formal methods usage
● Prototypes before products
SCOREX
● The cryptocurrency engine in less than 4K lines of Scala code
● To make proof-of-concepts FAST!
● Compact code
● Not production-ready
● CC0 license
Lagonaki Release
● 100% Proof-of-stake
● Simplified account-based transaction model
● Simple payments only
● Curve25519 for signing
● JSON API
● Command-line client
Under The Hood:
● Scala
(only Curve25519/RIPEMD160 impls are in Java)
● Akka
● MapDB
● Spray for HTTP API
● Play Json
● Scalatest
● Logback
Questions?
Scorex meetup-aug-2015

More Related Content

What's hot

State of Ethereum, and Mining
State of Ethereum, and MiningState of Ethereum, and Mining
State of Ethereum, and MiningMediabistro
 
Consensus Algorithms - Nakov at CryptoBlockCon - Las Vegas (2018)
Consensus Algorithms - Nakov at CryptoBlockCon - Las Vegas (2018)Consensus Algorithms - Nakov at CryptoBlockCon - Las Vegas (2018)
Consensus Algorithms - Nakov at CryptoBlockCon - Las Vegas (2018)Svetlin Nakov
 
Can we safely adapt the construction of permissionless blockchain to user dem...
Can we safely adapt the construction of permissionless blockchain to user dem...Can we safely adapt the construction of permissionless blockchain to user dem...
Can we safely adapt the construction of permissionless blockchain to user dem...I MT
 
Defense in Depth: Securing your new Kubernetes cluster from the challenges th...
Defense in Depth: Securing your new Kubernetes cluster from the challenges th...Defense in Depth: Securing your new Kubernetes cluster from the challenges th...
Defense in Depth: Securing your new Kubernetes cluster from the challenges th...CloudOps2005
 
Architecture ethereum dapp
Architecture ethereum dappArchitecture ethereum dapp
Architecture ethereum dappNicolas Wagner
 
Hyperledger Consensus Algorithms
Hyperledger Consensus AlgorithmsHyperledger Consensus Algorithms
Hyperledger Consensus AlgorithmsMabelOza12
 
Module: drand - the Distributed Randomness Beacon
Module: drand - the Distributed Randomness BeaconModule: drand - the Distributed Randomness Beacon
Module: drand - the Distributed Randomness BeaconIoannis Psaras
 
Ergo platform's approach
Ergo platform's approachErgo platform's approach
Ergo platform's approachDmitry Meshkov
 
The Bitcoin Lightning Network
The Bitcoin Lightning NetworkThe Bitcoin Lightning Network
The Bitcoin Lightning NetworkShun Shiku
 
A quick introduction to Consensus Models
A quick introduction to Consensus ModelsA quick introduction to Consensus Models
A quick introduction to Consensus ModelsOded Noam
 
Bitcoin cryptography
Bitcoin cryptographyBitcoin cryptography
Bitcoin cryptographyVadym Hrusha
 
Blockchain consensus algorithms
Blockchain consensus algorithmsBlockchain consensus algorithms
Blockchain consensus algorithmsAnurag Dashputre
 
Bitcoin Wallet &amp Keys
Bitcoin Wallet &amp KeysBitcoin Wallet &amp Keys
Bitcoin Wallet &amp KeysShun Shiku
 
Presentation_Topalidis_Giorgos
Presentation_Topalidis_GiorgosPresentation_Topalidis_Giorgos
Presentation_Topalidis_GiorgosGiorgos Topalidis
 
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018Svetlin Nakov
 
Consensus Algorithms: An Introduction & Analysis
Consensus Algorithms: An Introduction & AnalysisConsensus Algorithms: An Introduction & Analysis
Consensus Algorithms: An Introduction & AnalysisZak Cole
 
An EyeWitness View into your Network
An EyeWitness View into your NetworkAn EyeWitness View into your Network
An EyeWitness View into your NetworkCTruncer
 

What's hot (20)

State of Ethereum, and Mining
State of Ethereum, and MiningState of Ethereum, and Mining
State of Ethereum, and Mining
 
Programming Decentralized Application
Programming Decentralized ApplicationProgramming Decentralized Application
Programming Decentralized Application
 
Lightning Network
Lightning  NetworkLightning  Network
Lightning Network
 
Consensus Algorithms - Nakov at CryptoBlockCon - Las Vegas (2018)
Consensus Algorithms - Nakov at CryptoBlockCon - Las Vegas (2018)Consensus Algorithms - Nakov at CryptoBlockCon - Las Vegas (2018)
Consensus Algorithms - Nakov at CryptoBlockCon - Las Vegas (2018)
 
Can we safely adapt the construction of permissionless blockchain to user dem...
Can we safely adapt the construction of permissionless blockchain to user dem...Can we safely adapt the construction of permissionless blockchain to user dem...
Can we safely adapt the construction of permissionless blockchain to user dem...
 
Defense in Depth: Securing your new Kubernetes cluster from the challenges th...
Defense in Depth: Securing your new Kubernetes cluster from the challenges th...Defense in Depth: Securing your new Kubernetes cluster from the challenges th...
Defense in Depth: Securing your new Kubernetes cluster from the challenges th...
 
Architecture ethereum dapp
Architecture ethereum dappArchitecture ethereum dapp
Architecture ethereum dapp
 
Hyperledger Consensus Algorithms
Hyperledger Consensus AlgorithmsHyperledger Consensus Algorithms
Hyperledger Consensus Algorithms
 
Module: drand - the Distributed Randomness Beacon
Module: drand - the Distributed Randomness BeaconModule: drand - the Distributed Randomness Beacon
Module: drand - the Distributed Randomness Beacon
 
Ergo platform's approach
Ergo platform's approachErgo platform's approach
Ergo platform's approach
 
The Bitcoin Lightning Network
The Bitcoin Lightning NetworkThe Bitcoin Lightning Network
The Bitcoin Lightning Network
 
Blockchain Introduction
Blockchain IntroductionBlockchain Introduction
Blockchain Introduction
 
A quick introduction to Consensus Models
A quick introduction to Consensus ModelsA quick introduction to Consensus Models
A quick introduction to Consensus Models
 
Bitcoin cryptography
Bitcoin cryptographyBitcoin cryptography
Bitcoin cryptography
 
Blockchain consensus algorithms
Blockchain consensus algorithmsBlockchain consensus algorithms
Blockchain consensus algorithms
 
Bitcoin Wallet &amp Keys
Bitcoin Wallet &amp KeysBitcoin Wallet &amp Keys
Bitcoin Wallet &amp Keys
 
Presentation_Topalidis_Giorgos
Presentation_Topalidis_GiorgosPresentation_Topalidis_Giorgos
Presentation_Topalidis_Giorgos
 
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
Consensus Algorithms - Nakov @ jProfessionals - Jan 2018
 
Consensus Algorithms: An Introduction & Analysis
Consensus Algorithms: An Introduction & AnalysisConsensus Algorithms: An Introduction & Analysis
Consensus Algorithms: An Introduction & Analysis
 
An EyeWitness View into your Network
An EyeWitness View into your NetworkAn EyeWitness View into your Network
An EyeWitness View into your Network
 

Similar to Scorex meetup-aug-2015

On Private Blockchains, Technically
On Private Blockchains, TechnicallyOn Private Blockchains, Technically
On Private Blockchains, TechnicallyAlex Chepurnoy
 
Blockchan For Developers
Blockchan For DevelopersBlockchan For Developers
Blockchan For DevelopersAlex Chepurnoy
 
blockchain-and-trusted-computing
blockchain-and-trusted-computingblockchain-and-trusted-computing
blockchain-and-trusted-computingYongraeJo
 
Blockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentationBlockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentationPaperchain
 
Best practices to build secure smart contracts
Best practices to build secure smart contractsBest practices to build secure smart contracts
Best practices to build secure smart contractsGautam Anand
 
Introducing Moonbeam: A Smart Contract Parachain with Ethereum Compatibility
Introducing Moonbeam: A Smart Contract Parachain with Ethereum CompatibilityIntroducing Moonbeam: A Smart Contract Parachain with Ethereum Compatibility
Introducing Moonbeam: A Smart Contract Parachain with Ethereum CompatibilityPureStake
 
Fredericksburg LUG Bitcoin slides
Fredericksburg LUG Bitcoin slidesFredericksburg LUG Bitcoin slides
Fredericksburg LUG Bitcoin slidesAlex Akselrod
 
Understanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
Understanding Proof of Work (PoW) and Proof of Stake (PoS) AlgorithmsUnderstanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
Understanding Proof of Work (PoW) and Proof of Stake (PoS) AlgorithmsGautam Anand
 
Blockchain architected
Blockchain architectedBlockchain architected
Blockchain architectedIBM Sverige
 
Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)Tomoaki Sato
 
Bitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the HoodBitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the HoodGalin Dinkov
 
Blockchain
BlockchainBlockchain
BlockchainSai Nath
 
Structured approach to blockchain and consensus techniques
Structured approach to blockchain and consensus techniquesStructured approach to blockchain and consensus techniques
Structured approach to blockchain and consensus techniquesVasiliy Suvorov
 
How to Create Blockchain Products by Fr8 Network Lead Engineer
How to Create Blockchain Products by Fr8 Network Lead EngineerHow to Create Blockchain Products by Fr8 Network Lead Engineer
How to Create Blockchain Products by Fr8 Network Lead EngineerProduct School
 
How to Build Your Own Blockchain
How to Build Your Own BlockchainHow to Build Your Own Blockchain
How to Build Your Own BlockchainLeonid Beder
 
Eth cc --eth2-tests-and-implementation
Eth cc --eth2-tests-and-implementationEth cc --eth2-tests-and-implementation
Eth cc --eth2-tests-and-implementationBruno Skvorc
 
C13_blockchain introduction public (1).pptx
C13_blockchain introduction public (1).pptxC13_blockchain introduction public (1).pptx
C13_blockchain introduction public (1).pptxhaifaazka
 

Similar to Scorex meetup-aug-2015 (20)

On Private Blockchains, Technically
On Private Blockchains, TechnicallyOn Private Blockchains, Technically
On Private Blockchains, Technically
 
Blockchan For Developers
Blockchan For DevelopersBlockchan For Developers
Blockchan For Developers
 
blockchain-and-trusted-computing
blockchain-and-trusted-computingblockchain-and-trusted-computing
blockchain-and-trusted-computing
 
Blockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentationBlockchain, cryptography and tokens — NYC Bar presentation
Blockchain, cryptography and tokens — NYC Bar presentation
 
Best practices to build secure smart contracts
Best practices to build secure smart contractsBest practices to build secure smart contracts
Best practices to build secure smart contracts
 
Day 1.pptx
Day 1.pptxDay 1.pptx
Day 1.pptx
 
Introducing Moonbeam: A Smart Contract Parachain with Ethereum Compatibility
Introducing Moonbeam: A Smart Contract Parachain with Ethereum CompatibilityIntroducing Moonbeam: A Smart Contract Parachain with Ethereum Compatibility
Introducing Moonbeam: A Smart Contract Parachain with Ethereum Compatibility
 
Fredericksburg LUG Bitcoin slides
Fredericksburg LUG Bitcoin slidesFredericksburg LUG Bitcoin slides
Fredericksburg LUG Bitcoin slides
 
Understanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
Understanding Proof of Work (PoW) and Proof of Stake (PoS) AlgorithmsUnderstanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
Understanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
 
Blockchain architected
Blockchain architectedBlockchain architected
Blockchain architected
 
Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)Ethereum Devcon1 Report (summary writing)
Ethereum Devcon1 Report (summary writing)
 
Bitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the HoodBitcoin Blockchain - Under the Hood
Bitcoin Blockchain - Under the Hood
 
Blockchain
BlockchainBlockchain
Blockchain
 
Structured approach to blockchain and consensus techniques
Structured approach to blockchain and consensus techniquesStructured approach to blockchain and consensus techniques
Structured approach to blockchain and consensus techniques
 
Block chain
Block chainBlock chain
Block chain
 
How to Create Blockchain Products by Fr8 Network Lead Engineer
How to Create Blockchain Products by Fr8 Network Lead EngineerHow to Create Blockchain Products by Fr8 Network Lead Engineer
How to Create Blockchain Products by Fr8 Network Lead Engineer
 
How to Build Your Own Blockchain
How to Build Your Own BlockchainHow to Build Your Own Blockchain
How to Build Your Own Blockchain
 
ETC Summit 18
ETC Summit 18ETC Summit 18
ETC Summit 18
 
Eth cc --eth2-tests-and-implementation
Eth cc --eth2-tests-and-implementationEth cc --eth2-tests-and-implementation
Eth cc --eth2-tests-and-implementation
 
C13_blockchain introduction public (1).pptx
C13_blockchain introduction public (1).pptxC13_blockchain introduction public (1).pptx
C13_blockchain introduction public (1).pptx
 

More from Alex Chepurnoy

Ergo Presentation - Tokyo
Ergo Presentation - TokyoErgo Presentation - Tokyo
Ergo Presentation - TokyoAlex Chepurnoy
 
Ethereum and Its Challenges
Ethereum and Its ChallengesEthereum and Its Challenges
Ethereum and Its ChallengesAlex Chepurnoy
 
Improving Authenticated Dynamic Dictionaries, with Applications to Cryptocurr...
Improving Authenticated Dynamic Dictionaries, with Applications to Cryptocurr...Improving Authenticated Dynamic Dictionaries, with Applications to Cryptocurr...
Improving Authenticated Dynamic Dictionaries, with Applications to Cryptocurr...Alex Chepurnoy
 
Масштабируемость блокчейн-систем: проблемы и решения
Масштабируемость блокчейн-систем: проблемы и решенияМасштабируемость блокчейн-систем: проблемы и решения
Масштабируемость блокчейн-систем: проблемы и решенияAlex Chepurnoy
 
Sigma Protocols and Zero Knowledge
Sigma Protocols and Zero KnowledgeSigma Protocols and Zero Knowledge
Sigma Protocols and Zero KnowledgeAlex Chepurnoy
 

More from Alex Chepurnoy (6)

Ergo Presentation - Tokyo
Ergo Presentation - TokyoErgo Presentation - Tokyo
Ergo Presentation - Tokyo
 
Berlin sigma-2017
Berlin sigma-2017Berlin sigma-2017
Berlin sigma-2017
 
Ethereum and Its Challenges
Ethereum and Its ChallengesEthereum and Its Challenges
Ethereum and Its Challenges
 
Improving Authenticated Dynamic Dictionaries, with Applications to Cryptocurr...
Improving Authenticated Dynamic Dictionaries, with Applications to Cryptocurr...Improving Authenticated Dynamic Dictionaries, with Applications to Cryptocurr...
Improving Authenticated Dynamic Dictionaries, with Applications to Cryptocurr...
 
Масштабируемость блокчейн-систем: проблемы и решения
Масштабируемость блокчейн-систем: проблемы и решенияМасштабируемость блокчейн-систем: проблемы и решения
Масштабируемость блокчейн-систем: проблемы и решения
 
Sigma Protocols and Zero Knowledge
Sigma Protocols and Zero KnowledgeSigma Protocols and Zero Knowledge
Sigma Protocols and Zero Knowledge
 

Recently uploaded

Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacingjaychoudhary37
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024Mark Billinghurst
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2RajaP95
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZTE
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escortsranjana rawat
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx959SahilShah
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxPoojaBan
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and usesDevarapalliHaritha
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AIabhishek36461
 

Recently uploaded (20)

Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
microprocessor 8085 and its interfacing
microprocessor 8085  and its interfacingmicroprocessor 8085  and its interfacing
microprocessor 8085 and its interfacing
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024IVE Industry Focused Event - Defence Sector 2024
IVE Industry Focused Event - Defence Sector 2024
 
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2HARMONY IN THE HUMAN BEING - Unit-II UHV-2
HARMONY IN THE HUMAN BEING - Unit-II UHV-2
 
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
ZXCTN 5804 / ZTE PTN / ZTE POTN / ZTE 5804 PTN / ZTE POTN 5804 ( 100/200 GE Z...
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
(MEERA) Dapodi Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune Escorts
 
Application of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptxApplication of Residue Theorem to evaluate real integrations.pptx
Application of Residue Theorem to evaluate real integrations.pptx
 
Heart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptxHeart Disease Prediction using machine learning.pptx
Heart Disease Prediction using machine learning.pptx
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
power system scada applications and uses
power system scada applications and usespower system scada applications and uses
power system scada applications and uses
 
Past, Present and Future of Generative AI
Past, Present and Future of Generative AIPast, Present and Future of Generative AI
Past, Present and Future of Generative AI
 

Scorex meetup-aug-2015

  • 1. The Scorex Project Alexander Chepurnoy A Cryptocurrency Engine in Scala
  • 2. My Background ● Nxt Core Developer ● SmartContract.com / Secureae.com backend dev ● Consensus Research member
  • 3. Fields of Interest ● Distributed & P2P systems ● Blockchain Tech ● Functional Programming (Haskell / Scala) ● Finite State Machines ● Formal Methods (model checking / Coq)
  • 4. The Design of a Cryptocurrency ● P2P Network ● Persistent distributed fully-replicate database (aka Blockchain) ● Transactions over tokens grouped within blocks, a block is a database version ● Consensus algorithm ● Optional: additional layers on top of transactional layer(mesages, tokens, code)
  • 6. Blockchain As Database ● Persistent(versioned) database ● Genesis state – initial verion of the database ● Block as state modifier: State(h) * Block → State(h+1) ● Very weak consistency!
  • 8. Consensus About Blockchain ● Proof-of-Work ● Proof-of-Stake ● Hybrid: Proof-of-Work+Proof-of-Activity, Proof-of- Stake+Proof-of-Activity
  • 9. Weakest Consensus Property ● After k permutations a state of the blockchain database for versions 1..N-k is considered to be stable (with some assumptions made) ● Bitcoin(PoW): k = 6 ● Proof-of-Stake: k = ?
  • 10. Proof-of-Work ● Secured by NP problem ● (not by cryptography magic!) ● Find x by hash(x) is well-known NP problem ● PrimeCoin: Cunningham chains ● Length could be considered as a chain quality measure(in the blocktree)
  • 11. Proof-of-Stake ● No mining ● Consensus is within network ● Right to generate a block depends on stake ● hit < target ● CumulativeDificulty is the chain quality measure(in the blocktree)
  • 12. Bitcoin: Scripts Attached Input: Previous tx: 030b5937d9f4aaa1a3133b... Index: 0 scriptSig: 0dcd253cdf8ea11cdc710e5e92af7647... Output: Value: 5000000000 scriptPubKey: OP_DUP OP_HASH160 a45f2757f94fd2337ebf7ddd018c11a21fb6c283 OP_EQUALVERIFY OP_CHECKSIG
  • 13. Problem ● Bitcoin has more than 100K LoC's (80K C++ only) ● Nxt 40+K LoCs(Java) ● Even simple(and pretty buggy) Qora is ~20K (Java) ● Each product's code is hard to understand ● Hard to make experiments ● It's easy to make an error
  • 14. Security Problems ● Consensus algo flaws – FATAL ● Transaction layer flaws – from trivial to critical ● Network layer – ddoses, unconfirmed pool attacks
  • 15. Bitcoin: Transaction Layer bug On July 28 2010, two bugs were discovered and demonstrated on the test network. One exploited a bug in the transaction handling code and allowed an attacker to spend coins that they did not own. This was never exploited on the main network, and was fixed by Bitcoin version 0.3.5. After these bugs were discovered, many currently-unused script words were disabled for safety.
  • 16. Bitcoin: Transaction Layer Bug On 15 August 2010, with an exploit over 184 billion bitcoins were generated in a transaction, and sent to two addresses on the network. This was the only major security flaw found and exploited in Bitcoin's history. ● Fixed with hard-fork
  • 17. Better Quality of Blockchain Impls ● Safer languages(Scala/Ocaml, Haskell, Idris/Coq) ● Formal methods usage ● Prototypes before products
  • 18. SCOREX ● The cryptocurrency engine in less than 4K lines of Scala code ● To make proof-of-concepts FAST! ● Compact code ● Not production-ready ● CC0 license
  • 19. Lagonaki Release ● 100% Proof-of-stake ● Simplified account-based transaction model ● Simple payments only ● Curve25519 for signing ● JSON API ● Command-line client
  • 20. Under The Hood: ● Scala (only Curve25519/RIPEMD160 impls are in Java) ● Akka ● MapDB ● Spray for HTTP API ● Play Json ● Scalatest ● Logback