SlideShare a Scribd company logo
Bitcoin Summer School
Scorex, the Modular Blockchain Framework
Alexander Chepurnoy
(aka kushti)
@chepurnoy
IOHK Research
Section 1. „Scorex In General“
Use Cases
● Implement new consensus protocol and plug it easily into
a prototypical blockchain system to run a system against a
testbed
● In the same way, implement and spread a proof-of-concept
impl. for anew transactional language
Use Cases
● Proof-of-Stake protocols
● Permacoin implementation
The Problem
● Bitcoin(reference impl): > 80K lines of C++ code
● EthereumJ: > 55K of Java code
● Nxt: > 40K lines of Java code
● Every codebase is highly optimized for a concrete
production environment
The Problem
● It is hard to locate, inject, swap functionalities
● Hard to make experiments/prototypes
Scorex in General
● Find fast where to inject
● Modular stacked design
● Externalised cryptography(scrypto)
● One testnet application atm(Lagonaki)
Scorex in General, pt 2
● Everything is open-sourced immediately
● CC0 license
● Maintained by IOHK Research
Competitors
Intel's „Sawtooth Lake“
(https://github.com/IntelLedger)
„a highly modular platform for building, deploying and
running distributed ledgers" (Intel Corp.)
Intel's „Sawtooth Lake“
● Consensus / „transaction family“
● Proof of Elapsed Time (Intel SGX)
● Assets marketplace
● Python
● Apache License 2.0
Section 2. „Scorex In Details“
Scorex is in Scala
● Functional language, strict static typing
● JVM
● Could be enhanced with any JVM language(Java, Clojure,
Kotlin, Groovy, Jython, Frege etc)
Development Philosophy
● Flexible design could be hard to understand
● Simple code could be not flexible or error-prone
● We need to find a balance!
● Give a maximum for free!
Design In General
● Compact core – always for free
● Consensus module - implement or take ready
● Transactional module - implement or take ready
● Network protocols – partly for free
● API – partly for free
● Application – lean!
● Wallet, configs – partly for free
A Module
● Writes and reads certain block parts
● Implements corresponding interface
Code Quality
● Compact code, strict types
● Good test coverage(70-80%)
● Continuous integration
Getting Started
● Docs on GitHub:
https://github.com/ScorexProject/Scorex/wiki/Getting-started
● Java 8 SDK
● sbt is recommended for Scala
Adding Modules
libraryDependencies ++= Seq(
"org.consensusresearch" %% "scorex-basics" % "1.+",
"org.consensusresearch" %% "scorex-consensus" % "1.+",
"org.consensusresearch" %% "scorex-transaction" % "1.+"
)
scorex-basics -core
scorex-consensus - two Proof-of-Stake consensus protocols
scorex-transaction – simplest transactions
Adding Modules
libraryDependencies ++= Seq(
"org.consensusresearch" %% "scorex-basics" % "1.+",
"org.consensusresearch" %% "scorex-perma" % "1.+",
"org.consensusresearch" %% "scorex-transaction" % "1.+"
)
scorex-perma – Permacoin consensus protocol implementation
Application - modules
class MyApplication(val settingsFilename: String) extends Application {
// Your application config
override val applicationName = "my cool application"
override val appVersion = ApplicationVersion(0, 1, 0)
override implicit lazy val settings = new Settings with
TransactionSettings {
override val filename: String = settingsFilename
}
// Define consensus and transaction modules of your application
override implicit lazy val consensusModule = new
NxtLikeConsensusModule()
override implicit lazy val transactionModule = new
SimpleTransactionModule()(settings, this)
Application - API
// Define API routes of your application
override lazy val apiRoutes = Seq(
BlocksApiRoute(this),
TransactionsApiRoute(this),
NxtConsensusApiRoute(this),
WalletApiRoute(this),
PaymentApiRoute(this),
UtilsApiRoute(this),
PeersApiRoute(this),
AddressApiRoute(this)
)
// API types are required for swagger support
override lazy val apiTypes = Seq(
typeOf[BlocksApiRoute],
typeOf[TransactionsApiRoute],
typeOf[NxtConsensusApiRoute],
typeOf[WalletApiRoute],
typeOf[PaymentApiRoute],
typeOf[UtilsApiRoute],
typeOf[PeersApiRoute],
typeOf[AddressApiRoute]
)
Application – network protocols
// Create your custom messages and add them to additionalMessageSpecs
override lazy val additionalMessageSpecs =
TransactionalMessagesRepo.specs
// Start additional actors
actorSystem.actorOf(Props(classOf[UnconfirmedPoolSynchronizer], this))
}
Launch The Application
object MyApplication extends App {
// Provide filename by command-line arguments
val filename = args.headOption.getOrElse("settings.json")
// Create application instance
val application = new MyApplication(filename)
// Run it
application.run()
// Generate account in your wallet
if (application.wallet.privateKeyAccounts().isEmpty)
application.wallet.generateNewAccounts(1)
}
UI
Settings
https://github.com/ScorexProject/Scorex/wiki/Settings
{
"p2p": {
"bindAddress": "0.0.0.0",
"upnp": false,
"upnpGatewayTimeout": 7000,
"upnpDiscoverTimeout": 3000,
"port": 9084,
"knownPeers": [
"23.94.190.226:9185"
],
"maxConnections": 10
},
"walletDir": "/tmp/scorex/wallet",
"dataDir": "/tmp/scorex/data",
"rpcPort": 9085,
"rpcAllowed": [],
"maxRollback": 100,
"blockGenerationDelay": 0,
"genesisTimestamp": 1460952000000,
"apiKeyHash": "GmVvcpx1BRUPDZiADbZ7a6zgQV3Sgj2GhNoEiTH9Drdx",
"cors": false
}
Lagonaki
● Permacoin implementation
● Simplest transactional module, account-2-account
payments
Launch Lagonaki
● docker run -i -p 9085:9085 "scorex/lagonaki:1.2.7"
● debian package
● https://github.com/ScorexProject/Lagonaki
Lagonaki Block Explorer
http://cryptorevolution.me/
Run own network
● src/main/resources/lagonaki.conf
app {
product = "Scorex"
release = "Lagonaki"
version = "1.2.7"
consensusAlgo = "perma"
}
Section 3. „Further Work“
1.2.7 → 1.3.0
● Flexible state models(now account-based)
● Flexible signing schemes(now EdDSA-25519 only)
Ergaki
● Blockchain for protocols
● Rollerchain implementation: safely prunable fullblocks
● Σ-coin implementation: wide class of NIZKPoK for DLOG
statements
● Rent-a-Box fee model
● Improved difficulty adjustment
Scrypto
● Еncoding functions(Base16/58/64)
● Hash functions(Blake2, Keccak etc)
● 25519 from WhisperSystems
● Authenticated data structures(Merkle trees, authenticated
skiplists coming in next release)
Section 4. „Coordination“
Contribution
● Comments
● Todos (search for „todo:“)
● Documentation
● Bugs
● Bitcoin UTXO model implementation (BitcoinJ)
● EVM implementation (EthereumJ)
Reach Us
● Maillist https://scorex-dev.groups.io/g/main
● GitHub https://github.com/ScorexProject
● https://iohk.io/team/
Questions?
https://github.com/ScorexProject/Scorex

More Related Content

PDF
Blockchain For Developers
ODP
Some Open Problems in Blockchains
ODP
Blockchain Properties
ODP
Blockchan For Developers
PDF
Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)
PDF
On Private Blockchains, Technically
ODP
Proof-of-Stake & Its Improvements (San Francisco Bitcoin Devs Hackathon)
ODP
Scorex meetup-aug-2015
Blockchain For Developers
Some Open Problems in Blockchains
Blockchain Properties
Blockchan For Developers
Blockchain For Developers (Talk at Innopolis Blockchain Hackathon 2016)
On Private Blockchains, Technically
Proof-of-Stake & Its Improvements (San Francisco Bitcoin Devs Hackathon)
Scorex meetup-aug-2015

What's hot (20)

ODP
Real world blockchains
ODP
A New Business World Within A Blockchain
PPTX
How to Create AltCoin(Alternative Cryptocurrency)?
PDF
H2020 finsec-ibm- aidan-shribman-finsec-skydive 260820
PDF
Ergo platform's approach
PPTX
An introduction to blockchain
PPTX
Diagnosing HotSpot JVM Memory Leaks with JFR and JMC
PDF
The Bitcoin Lightning Network
PPTX
Concurrency Control in Distributed Database.
PPTX
OpenTelemetry For Operators
PDF
Meetup 19/12/2016 - Blockchain-as-a-service voor Antwerpen?
PDF
Encode Club workshop slides
PPTX
A quick introduction to Consensus Models
PDF
Bitcoin Wallet &amp Keys
PDF
Transacties theorie
PDF
Technical Overview of Tezos
PPTX
Transaction Ordering System
PPTX
Presentation_Topalidis_Giorgos
PPTX
Write Smart Contracts with Truffle Framework
PDF
Blocks, procs && lambdas
Real world blockchains
A New Business World Within A Blockchain
How to Create AltCoin(Alternative Cryptocurrency)?
H2020 finsec-ibm- aidan-shribman-finsec-skydive 260820
Ergo platform's approach
An introduction to blockchain
Diagnosing HotSpot JVM Memory Leaks with JFR and JMC
The Bitcoin Lightning Network
Concurrency Control in Distributed Database.
OpenTelemetry For Operators
Meetup 19/12/2016 - Blockchain-as-a-service voor Antwerpen?
Encode Club workshop slides
A quick introduction to Consensus Models
Bitcoin Wallet &amp Keys
Transacties theorie
Technical Overview of Tezos
Transaction Ordering System
Presentation_Topalidis_Giorgos
Write Smart Contracts with Truffle Framework
Blocks, procs && lambdas
Ad

Viewers also liked (9)

PDF
Масштабируемость блокчейн-систем: проблемы и решения
PPTX
Blockchain Consensus Protocols
PDF
Bitcoin - Introduction, Technical Aspects and Ongoing Developments
PDF
[22/03/2016] Conférence : Blockchain, disruption & révolution
PDF
Blockchain Use Cases: Think of a "Public" Pub/Sub Queue
PPTX
IoT, Fog Computing and the Blockchain
PDF
Demystifying Blockchains
 
PDF
IBM ADEPT
 
PPTX
Blockchain in IoT and Other Considerations by Dinis Guarda
Масштабируемость блокчейн-систем: проблемы и решения
Blockchain Consensus Protocols
Bitcoin - Introduction, Technical Aspects and Ongoing Developments
[22/03/2016] Conférence : Blockchain, disruption & révolution
Blockchain Use Cases: Think of a "Public" Pub/Sub Queue
IoT, Fog Computing and the Blockchain
Demystifying Blockchains
 
IBM ADEPT
 
Blockchain in IoT and Other Considerations by Dinis Guarda
Ad

Similar to Scorex, the Modular Blockchain Framework (20)

PDF
Blockchain with scala
PDF
An Introduction to Upgradable Smart Contracts
PDF
Ibp technical introduction
PDF
Blockchain development 101
PDF
Smart contracts in Solidity
PDF
Hyperledger community update Feb 20, 2018
PPTX
Deploy a blockchain web-app with Hyperledger Fabric 1.4 - Concepts & Code
PDF
Deployablockchainwebappwithhyperledgerfabricpresentation 190820170703
PDF
Ethereum Smart Contracts on Hyperledger Fabric
PPTX
Smart Contracts That Learn
PPTX
lecture7 blockchain ethereum mechanics 101
PPTX
Introduction to Hyperledger Composer
PPTX
Enterprise Blockchain Developer Experience
PDF
Trust Data Sharing and Utilization Infrastructure for Sensitive Data Using Hy...
PPTX
BlockchainConf.tech - Hyperledger overview
PDF
Hyperledger community update 201805
PDF
All about blockchain
 
PDF
Wwc developing hyperledger applications v4
PDF
Blockchain Educational Framework - Course Overview
PPTX
Blockchain Blockchain Blockchain Lec 2.1.pptx
Blockchain with scala
An Introduction to Upgradable Smart Contracts
Ibp technical introduction
Blockchain development 101
Smart contracts in Solidity
Hyperledger community update Feb 20, 2018
Deploy a blockchain web-app with Hyperledger Fabric 1.4 - Concepts & Code
Deployablockchainwebappwithhyperledgerfabricpresentation 190820170703
Ethereum Smart Contracts on Hyperledger Fabric
Smart Contracts That Learn
lecture7 blockchain ethereum mechanics 101
Introduction to Hyperledger Composer
Enterprise Blockchain Developer Experience
Trust Data Sharing and Utilization Infrastructure for Sensitive Data Using Hy...
BlockchainConf.tech - Hyperledger overview
Hyperledger community update 201805
All about blockchain
 
Wwc developing hyperledger applications v4
Blockchain Educational Framework - Course Overview
Blockchain Blockchain Blockchain Lec 2.1.pptx

Recently uploaded (20)

PDF
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
Geodesy 1.pptx...............................................
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
composite construction of structures.pdf
PDF
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
Sustainable Sites - Green Building Construction
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PDF
Digital Logic Computer Design lecture notes
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
OOP with Java - Java Introduction (Basics)
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PDF
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
PPT
Project quality management in manufacturing
TFEC-4-2020-Design-Guide-for-Timber-Roof-Trusses.pdf
UNIT 4 Total Quality Management .pptx
bas. eng. economics group 4 presentation 1.pptx
Geodesy 1.pptx...............................................
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
Operating System & Kernel Study Guide-1 - converted.pdf
composite construction of structures.pdf
BMEC211 - INTRODUCTION TO MECHATRONICS-1.pdf
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Sustainable Sites - Green Building Construction
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Digital Logic Computer Design lecture notes
CYBER-CRIMES AND SECURITY A guide to understanding
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
OOP with Java - Java Introduction (Basics)
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
July 2025 - Top 10 Read Articles in International Journal of Software Enginee...
Project quality management in manufacturing

Scorex, the Modular Blockchain Framework

  • 1. Bitcoin Summer School Scorex, the Modular Blockchain Framework Alexander Chepurnoy (aka kushti) @chepurnoy IOHK Research
  • 2. Section 1. „Scorex In General“
  • 3. Use Cases ● Implement new consensus protocol and plug it easily into a prototypical blockchain system to run a system against a testbed ● In the same way, implement and spread a proof-of-concept impl. for anew transactional language
  • 4. Use Cases ● Proof-of-Stake protocols ● Permacoin implementation
  • 5. The Problem ● Bitcoin(reference impl): > 80K lines of C++ code ● EthereumJ: > 55K of Java code ● Nxt: > 40K lines of Java code ● Every codebase is highly optimized for a concrete production environment
  • 6. The Problem ● It is hard to locate, inject, swap functionalities ● Hard to make experiments/prototypes
  • 7. Scorex in General ● Find fast where to inject ● Modular stacked design ● Externalised cryptography(scrypto) ● One testnet application atm(Lagonaki)
  • 8. Scorex in General, pt 2 ● Everything is open-sourced immediately ● CC0 license ● Maintained by IOHK Research
  • 9. Competitors Intel's „Sawtooth Lake“ (https://github.com/IntelLedger) „a highly modular platform for building, deploying and running distributed ledgers" (Intel Corp.)
  • 10. Intel's „Sawtooth Lake“ ● Consensus / „transaction family“ ● Proof of Elapsed Time (Intel SGX) ● Assets marketplace ● Python ● Apache License 2.0
  • 11. Section 2. „Scorex In Details“
  • 12. Scorex is in Scala ● Functional language, strict static typing ● JVM ● Could be enhanced with any JVM language(Java, Clojure, Kotlin, Groovy, Jython, Frege etc)
  • 13. Development Philosophy ● Flexible design could be hard to understand ● Simple code could be not flexible or error-prone ● We need to find a balance! ● Give a maximum for free!
  • 14. Design In General ● Compact core – always for free ● Consensus module - implement or take ready ● Transactional module - implement or take ready ● Network protocols – partly for free ● API – partly for free ● Application – lean! ● Wallet, configs – partly for free
  • 15. A Module ● Writes and reads certain block parts ● Implements corresponding interface
  • 16. Code Quality ● Compact code, strict types ● Good test coverage(70-80%) ● Continuous integration
  • 17. Getting Started ● Docs on GitHub: https://github.com/ScorexProject/Scorex/wiki/Getting-started ● Java 8 SDK ● sbt is recommended for Scala
  • 18. Adding Modules libraryDependencies ++= Seq( "org.consensusresearch" %% "scorex-basics" % "1.+", "org.consensusresearch" %% "scorex-consensus" % "1.+", "org.consensusresearch" %% "scorex-transaction" % "1.+" ) scorex-basics -core scorex-consensus - two Proof-of-Stake consensus protocols scorex-transaction – simplest transactions
  • 19. Adding Modules libraryDependencies ++= Seq( "org.consensusresearch" %% "scorex-basics" % "1.+", "org.consensusresearch" %% "scorex-perma" % "1.+", "org.consensusresearch" %% "scorex-transaction" % "1.+" ) scorex-perma – Permacoin consensus protocol implementation
  • 20. Application - modules class MyApplication(val settingsFilename: String) extends Application { // Your application config override val applicationName = "my cool application" override val appVersion = ApplicationVersion(0, 1, 0) override implicit lazy val settings = new Settings with TransactionSettings { override val filename: String = settingsFilename } // Define consensus and transaction modules of your application override implicit lazy val consensusModule = new NxtLikeConsensusModule() override implicit lazy val transactionModule = new SimpleTransactionModule()(settings, this)
  • 21. Application - API // Define API routes of your application override lazy val apiRoutes = Seq( BlocksApiRoute(this), TransactionsApiRoute(this), NxtConsensusApiRoute(this), WalletApiRoute(this), PaymentApiRoute(this), UtilsApiRoute(this), PeersApiRoute(this), AddressApiRoute(this) ) // API types are required for swagger support override lazy val apiTypes = Seq( typeOf[BlocksApiRoute], typeOf[TransactionsApiRoute], typeOf[NxtConsensusApiRoute], typeOf[WalletApiRoute], typeOf[PaymentApiRoute], typeOf[UtilsApiRoute], typeOf[PeersApiRoute], typeOf[AddressApiRoute] )
  • 22. Application – network protocols // Create your custom messages and add them to additionalMessageSpecs override lazy val additionalMessageSpecs = TransactionalMessagesRepo.specs // Start additional actors actorSystem.actorOf(Props(classOf[UnconfirmedPoolSynchronizer], this)) }
  • 23. Launch The Application object MyApplication extends App { // Provide filename by command-line arguments val filename = args.headOption.getOrElse("settings.json") // Create application instance val application = new MyApplication(filename) // Run it application.run() // Generate account in your wallet if (application.wallet.privateKeyAccounts().isEmpty) application.wallet.generateNewAccounts(1) }
  • 24. UI
  • 25. Settings https://github.com/ScorexProject/Scorex/wiki/Settings { "p2p": { "bindAddress": "0.0.0.0", "upnp": false, "upnpGatewayTimeout": 7000, "upnpDiscoverTimeout": 3000, "port": 9084, "knownPeers": [ "23.94.190.226:9185" ], "maxConnections": 10 }, "walletDir": "/tmp/scorex/wallet", "dataDir": "/tmp/scorex/data", "rpcPort": 9085, "rpcAllowed": [], "maxRollback": 100, "blockGenerationDelay": 0, "genesisTimestamp": 1460952000000, "apiKeyHash": "GmVvcpx1BRUPDZiADbZ7a6zgQV3Sgj2GhNoEiTH9Drdx", "cors": false }
  • 26. Lagonaki ● Permacoin implementation ● Simplest transactional module, account-2-account payments
  • 27. Launch Lagonaki ● docker run -i -p 9085:9085 "scorex/lagonaki:1.2.7" ● debian package ● https://github.com/ScorexProject/Lagonaki
  • 29. Run own network ● src/main/resources/lagonaki.conf app { product = "Scorex" release = "Lagonaki" version = "1.2.7" consensusAlgo = "perma" }
  • 31. 1.2.7 → 1.3.0 ● Flexible state models(now account-based) ● Flexible signing schemes(now EdDSA-25519 only)
  • 32. Ergaki ● Blockchain for protocols ● Rollerchain implementation: safely prunable fullblocks ● Σ-coin implementation: wide class of NIZKPoK for DLOG statements ● Rent-a-Box fee model ● Improved difficulty adjustment
  • 33. Scrypto ● Еncoding functions(Base16/58/64) ● Hash functions(Blake2, Keccak etc) ● 25519 from WhisperSystems ● Authenticated data structures(Merkle trees, authenticated skiplists coming in next release)
  • 35. Contribution ● Comments ● Todos (search for „todo:“) ● Documentation ● Bugs ● Bitcoin UTXO model implementation (BitcoinJ) ● EVM implementation (EthereumJ)
  • 36. Reach Us ● Maillist https://scorex-dev.groups.io/g/main ● GitHub https://github.com/ScorexProject ● https://iohk.io/team/