SlideShare una empresa de Scribd logo
1 de 37
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

Más contenido relacionado

La actualidad más candente

Presentation_Topalidis_Giorgos
Presentation_Topalidis_GiorgosPresentation_Topalidis_Giorgos
Presentation_Topalidis_Giorgos
Giorgos Topalidis
 

La actualidad más candente (20)

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

Destacado

Destacado (9)

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

Similar a Scorex, the Modular Blockchain Framework

Web Scale Reasoning and the LarKC Project
Web Scale Reasoning and the LarKC ProjectWeb Scale Reasoning and the LarKC Project
Web Scale Reasoning and the LarKC Project
Saltlux Inc.
 
The future of server side JavaScript
The future of server side JavaScriptThe future of server side JavaScript
The future of server side JavaScript
Oleg Podsechin
 

Similar a Scorex, the Modular Blockchain Framework (20)

Web Scale Reasoning and the LarKC Project
Web Scale Reasoning and the LarKC ProjectWeb Scale Reasoning and the LarKC Project
Web Scale Reasoning and the LarKC Project
 
Ratpack Web Framework
Ratpack Web FrameworkRatpack Web Framework
Ratpack Web Framework
 
Distributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and ScalaDistributed & Highly Available server applications in Java and Scala
Distributed & Highly Available server applications in Java and Scala
 
Python Streaming Pipelines with Beam on Flink
Python Streaming Pipelines with Beam on FlinkPython Streaming Pipelines with Beam on Flink
Python Streaming Pipelines with Beam on Flink
 
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
Flink Forward Berlin 2018: Thomas Weise & Aljoscha Krettek - "Python Streamin...
 
BigDataSpain 2016: Stream Processing Applications with Apache Apex
BigDataSpain 2016: Stream Processing Applications with Apache ApexBigDataSpain 2016: Stream Processing Applications with Apache Apex
BigDataSpain 2016: Stream Processing Applications with Apache Apex
 
introduction to node.js
introduction to node.jsintroduction to node.js
introduction to node.js
 
Interactive Java Support to your tool -- The JShell API and Architecture
Interactive Java Support to your tool -- The JShell API and ArchitectureInteractive Java Support to your tool -- The JShell API and Architecture
Interactive Java Support to your tool -- The JShell API and Architecture
 
Docker Logging and analysing with Elastic Stack - Jakub Hajek
Docker Logging and analysing with Elastic Stack - Jakub Hajek Docker Logging and analysing with Elastic Stack - Jakub Hajek
Docker Logging and analysing with Elastic Stack - Jakub Hajek
 
Docker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic StackDocker Logging and analysing with Elastic Stack
Docker Logging and analysing with Elastic Stack
 
MuleSoft Meetup Roma - Processi di Automazione su CloudHub
MuleSoft Meetup Roma - Processi di Automazione su CloudHubMuleSoft Meetup Roma - Processi di Automazione su CloudHub
MuleSoft Meetup Roma - Processi di Automazione su CloudHub
 
Hands on with CoAP and Californium
Hands on with CoAP and CaliforniumHands on with CoAP and Californium
Hands on with CoAP and Californium
 
Ice mini guide
Ice mini guideIce mini guide
Ice mini guide
 
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...
Functioning incessantly of Data Science Platform with Kubeflow - Albert Lewan...
 
Scala at Netflix
Scala at NetflixScala at Netflix
Scala at Netflix
 
Code quality par Simone Civetta
Code quality par Simone CivettaCode quality par Simone Civetta
Code quality par Simone Civetta
 
Actor model in .NET - Akka.NET
Actor model in .NET - Akka.NETActor model in .NET - Akka.NET
Actor model in .NET - Akka.NET
 
The future of server side JavaScript
The future of server side JavaScriptThe future of server side JavaScript
The future of server side JavaScript
 
ApacheCon NA - Apache Camel K: connect your Knative serverless applications w...
ApacheCon NA - Apache Camel K: connect your Knative serverless applications w...ApacheCon NA - Apache Camel K: connect your Knative serverless applications w...
ApacheCon NA - Apache Camel K: connect your Knative serverless applications w...
 
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Spring Boot to Quarkus: A real app migration experience | DevNation Tech TalkSpring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
Spring Boot to Quarkus: A real app migration experience | DevNation Tech Talk
 

Último

notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
ankushspencer015
 

Último (20)

Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance BookingCall Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
Call Girls Walvekar Nagar Call Me 7737669865 Budget Friendly No Advance Booking
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Ramesh Nagar Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...Bhosari ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For ...
Bhosari ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For ...
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
chapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineeringchapter 5.pptx: drainage and irrigation engineering
chapter 5.pptx: drainage and irrigation engineering
 
Design For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the startDesign For Accessibility: Getting it right from the start
Design For Accessibility: Getting it right from the start
 
Intro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdfIntro To Electric Vehicles PDF Notes.pdf
Intro To Electric Vehicles PDF Notes.pdf
 
Unit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdfUnit 2- Effective stress & Permeability.pdf
Unit 2- Effective stress & Permeability.pdf
 
AKTU Computer Networks notes --- Unit 3.pdf
AKTU Computer Networks notes ---  Unit 3.pdfAKTU Computer Networks notes ---  Unit 3.pdf
AKTU Computer Networks notes --- Unit 3.pdf
 
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...Booking open Available Pune Call Girls Koregaon Park  6297143586 Call Hot Ind...
Booking open Available Pune Call Girls Koregaon Park 6297143586 Call Hot Ind...
 
NFPA 5000 2024 standard .
NFPA 5000 2024 standard                                  .NFPA 5000 2024 standard                                  .
NFPA 5000 2024 standard .
 
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
Call Girls Pimpri Chinchwad Call Me 7737669865 Budget Friendly No Advance Boo...
 
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank  Design by Working Stress - IS Method.pdfIntze Overhead Water Tank  Design by Working Stress - IS Method.pdf
Intze Overhead Water Tank Design by Working Stress - IS Method.pdf
 

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/