SlideShare a Scribd company logo
1 of 22
Download to read offline
Bootstrapping a Custom
Proof-of-Stake Blockchain Network
Vuksan Simunović
Software Engineer @ MVP Workshop
August 12, 2019
For some time now, we have been striving to broaden our knowledge about
custom blockchain solutions.
Business-wise, PoS consensus in a blockchain network is a much better
option, although it comes with a set of disadvantages which we had to
overcome during development.
Therefore, this presentation is about the entire process of
implementing a custom blockchain — something that we have
been mastering along the way.
Ethereum blockchain operates under certain rules that cannot be changed.
Rules are useful — that we can agree on. Yet, rules such as the ones proposed by
Proof-of-Stake (PoS) or Proof-of-Work (PoW) consensus cannot be applied to
every single product or business that exists and wants to become
blockchain-based. In that case, you can:
01 02
Start building a new
blockchain from
scratch
(time, energy & money consuming)
Use some existing
frameworks such as
Cosmos-SDK and
Tendermint.
First things first, let’s take a look at
the current state of affairs in PoS
networks.
Business Advantages and Technological
Disadvantages of PoS Networks
Proof-of-Stake networks are often a more convenient solution for
products that strive to introduce blockchain than Proof-of-Work networks.
● The main advantage of PoS is that it consumes less energy
● The main disadvantage of PoS is bootstrapping period
Implementing a Custom Blockchain
Here at MVP Workshop (yes, we are a blockchain R&D studio), we are working
with various blockchain solutions that are based on existing blockchain
platforms, such as Ethereum and Stellar.
But, however powerful, these technologies have certain limitations. For example,
Ethereum enables deploying custom logic using Smart Contracts, but its core
concepts, such as the network’s consensus algorithm, cannot be modified easily.
Having scrutinized the web, we stumbled upon Cosmos Network and decided to
use its building blocks — Tendermint and Cosmos-SDK — to build Electionr.
Simplified Blockchain Architecture
From an architectural perspective, every blockchain
consists of three layers:
● Networking — Responsible for transactions
propagation via peer-to-peer (p2p) communication
between nodes.
● Consensus — A fault-tolerant mechanism used to
reach an agreement on the current state of the
network. Notable examples include Proof-of-Work
(PoW) and Proof-of-Stake (PoS).
● Application — Responsible for updating the network
state by executing transactions in a deterministic
manner. For Ethereum, this is Ethereum Virtual
Machine (EVM).
What Is Tendermint?
Tendermint is a Byzantine-fault-tolerant (BFT) state machine replica. Its
purpose is to provide networking and consensus layers that make up a
generic engine so that developers only have to worry about the
application layer of their blockchain.
What Is Cosmos-SDK?
Cosmos-SDK is a framework for building a blockchain application layer
whose power comes from its modularity.
SDK applications are built by aggregating a collection of interoperable
modules. Each module can be seen as a small state-machine. It maintains
a subset of the state and contains its own transaction processor, while the
SDK is responsible for routing each transaction to its respective module.
The most notable modules are:
Auth — Used to manage accounts.
Bank — Transfers tokens between accounts.
Distribution — Passively distributes rewards in
the system.
Staking — Used to enable blockchain to
support a PoS system.
Slashing — Disincentivizes any malicious
activity by a network actor with value at stake
by penalizing him.
Electionr
We named our custom blockchain implementation Electionr since its
primary objective is to introduce a transparent and fairer process for
bootstrapping a Proof-of-Stake (PoS) network.
Check out our GitHub account
https://github.com/MVPWorkshop/electionr
Electionr - The Problem
If a PoS network is launched with no pre-mine, and block rewards are
issued to validators, then its starting validators can accumulate 100% of
the tokens. If there is no permissionless modus operandi to nominate
validators, then the starting validators may be a colluding cartel or greedy
founders who can dominate the network — especially in the early years
when inflation is still high.
Electionr - The Solution
In order to launch an egalitarian Proof-of-Stake network, validator nodes
are elected using a process called Proof of Determination (PoD) during the
first year.
PoD is based on PoW, but with one major difference — it is stopped before
the major flaws that PoW brings have the chance to emerge, since it is
limited to one year. By using elements of Proof-of-Work to bootstrap the
initial validator set without a pre-mined sum, we can avoid giving starting
validators too much power and unfair advantage from the beginning.
Electionr - The Solution
PoD is used to prepare the PoS network by deploying an election contract,
as well as a bridging contract that links PoS chain to Ethereum.
This PoD process consists of 12 monthly cycles. Each month, the validator
pool is expanded to allow cycle winners to enter and take their roles as
new validators.
Electionr - The Solution
The election contract enables validator-elects to nominate themselves to
become a validator. In order to do that, they need to call the contract’s
public method with the following arguments: their PoS key, validator’s
operator address, nonce, and the hash of these attributes. After the cycle
is over, seven lowest hashes are chosen as new validators. Any
validator-elect can choose to increase their odds by cycling through
nonces off-chain and attempting to find the lowest possible hash before
calling the contract method.
Electionr - The Solution
The bridge contract enables the movement of Ethereum assets to the
liquidity pool on the PoS network. The bridge contract can be either
one-way or two-way. The one-way bridge does not allow removing ETH and
is inherently safer and less complex. The one-way bridge can also be
decommissioned after the network has been bootstrapped. On the other
hand, the two-way bridge gives liquidity to tokens on the PoS network
since it allows them to be sold for ETH via signature consensus. The
two-way bridge is more complex since it requires slashing conditions on
the PoS network to prevent stealing assets.
Peer-to-peer network is a
real pain to draw. Here’s
our try!
Electionr - Implementation
The election (Ethereum) contract is written in Solidity and consists of three public functions:
● electMe() — Checks whether submitted function arguments are valid and positions validator-elect in the right place in a sorted
doubly linked list.
● publishGenesisSigs() — The caller of this function is a validator with the lowest submitted hash during the initial PoD cycle. After
this function is called, the pointer in the doubly linked list is moved to the first non-validator hash, and GenesisValidatorSet
event is emitted, publishing elected validators that should initialize the network. The next cycle begins after that.
● publishSigs() — After the initial cycle period, publishing a new validator set is not limited only to the one with the lowest hash
but is open to anyone. Everything else is rather similar to publishGenesisSigs().
The election (Ethereum)
contract is written in Solidity
and consists of three public
functions:
We hope that you like what you’ve read so far.
Before continuing to the conclusions here’s a chance to visit our
blog and read all about the Electionr Tools, and Validator
Election and Protection.
Conclusion
However interesting, this project proved to be a real challenge.
Understanding the concepts implemented by Tendermint and Cosmos is
not an easy task since their project is continually evolving and new
concepts are often being introduced.
In other words, our team had to keep up with this rapidly evolving
technology and frequently adjust the codebase so that our project stays
up-to-date with Cosmos-SDK, without trying to modify the constantly
changing codebase.
Thank you!
No matter if you have just an idea you would like to validate, or already existing
project you would like us to collaborate on – we are open for a chat.
GET IN TOUCH
Follow us and subscribe for more company updates
@mvpworkshop
@mvpworkshop
@mvpworkshop
And feel free to get in touch
services@mvpworkshop.co

More Related Content

Recently uploaded

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesrafiqahmad00786416
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 

Recently uploaded (20)

Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 

Featured

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 

Featured (20)

PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 

Bootstrapping a custom Proof of Stake (PoS) Blockchain network

  • 1. Bootstrapping a Custom Proof-of-Stake Blockchain Network Vuksan Simunović Software Engineer @ MVP Workshop August 12, 2019
  • 2. For some time now, we have been striving to broaden our knowledge about custom blockchain solutions. Business-wise, PoS consensus in a blockchain network is a much better option, although it comes with a set of disadvantages which we had to overcome during development. Therefore, this presentation is about the entire process of implementing a custom blockchain — something that we have been mastering along the way.
  • 3. Ethereum blockchain operates under certain rules that cannot be changed. Rules are useful — that we can agree on. Yet, rules such as the ones proposed by Proof-of-Stake (PoS) or Proof-of-Work (PoW) consensus cannot be applied to every single product or business that exists and wants to become blockchain-based. In that case, you can: 01 02 Start building a new blockchain from scratch (time, energy & money consuming) Use some existing frameworks such as Cosmos-SDK and Tendermint.
  • 4. First things first, let’s take a look at the current state of affairs in PoS networks.
  • 5. Business Advantages and Technological Disadvantages of PoS Networks Proof-of-Stake networks are often a more convenient solution for products that strive to introduce blockchain than Proof-of-Work networks. ● The main advantage of PoS is that it consumes less energy ● The main disadvantage of PoS is bootstrapping period
  • 6. Implementing a Custom Blockchain Here at MVP Workshop (yes, we are a blockchain R&D studio), we are working with various blockchain solutions that are based on existing blockchain platforms, such as Ethereum and Stellar. But, however powerful, these technologies have certain limitations. For example, Ethereum enables deploying custom logic using Smart Contracts, but its core concepts, such as the network’s consensus algorithm, cannot be modified easily. Having scrutinized the web, we stumbled upon Cosmos Network and decided to use its building blocks — Tendermint and Cosmos-SDK — to build Electionr.
  • 7. Simplified Blockchain Architecture From an architectural perspective, every blockchain consists of three layers: ● Networking — Responsible for transactions propagation via peer-to-peer (p2p) communication between nodes. ● Consensus — A fault-tolerant mechanism used to reach an agreement on the current state of the network. Notable examples include Proof-of-Work (PoW) and Proof-of-Stake (PoS). ● Application — Responsible for updating the network state by executing transactions in a deterministic manner. For Ethereum, this is Ethereum Virtual Machine (EVM).
  • 8. What Is Tendermint? Tendermint is a Byzantine-fault-tolerant (BFT) state machine replica. Its purpose is to provide networking and consensus layers that make up a generic engine so that developers only have to worry about the application layer of their blockchain.
  • 9. What Is Cosmos-SDK? Cosmos-SDK is a framework for building a blockchain application layer whose power comes from its modularity. SDK applications are built by aggregating a collection of interoperable modules. Each module can be seen as a small state-machine. It maintains a subset of the state and contains its own transaction processor, while the SDK is responsible for routing each transaction to its respective module.
  • 10. The most notable modules are: Auth — Used to manage accounts. Bank — Transfers tokens between accounts. Distribution — Passively distributes rewards in the system. Staking — Used to enable blockchain to support a PoS system. Slashing — Disincentivizes any malicious activity by a network actor with value at stake by penalizing him.
  • 11. Electionr We named our custom blockchain implementation Electionr since its primary objective is to introduce a transparent and fairer process for bootstrapping a Proof-of-Stake (PoS) network. Check out our GitHub account https://github.com/MVPWorkshop/electionr
  • 12. Electionr - The Problem If a PoS network is launched with no pre-mine, and block rewards are issued to validators, then its starting validators can accumulate 100% of the tokens. If there is no permissionless modus operandi to nominate validators, then the starting validators may be a colluding cartel or greedy founders who can dominate the network — especially in the early years when inflation is still high.
  • 13. Electionr - The Solution In order to launch an egalitarian Proof-of-Stake network, validator nodes are elected using a process called Proof of Determination (PoD) during the first year. PoD is based on PoW, but with one major difference — it is stopped before the major flaws that PoW brings have the chance to emerge, since it is limited to one year. By using elements of Proof-of-Work to bootstrap the initial validator set without a pre-mined sum, we can avoid giving starting validators too much power and unfair advantage from the beginning.
  • 14. Electionr - The Solution PoD is used to prepare the PoS network by deploying an election contract, as well as a bridging contract that links PoS chain to Ethereum. This PoD process consists of 12 monthly cycles. Each month, the validator pool is expanded to allow cycle winners to enter and take their roles as new validators.
  • 15. Electionr - The Solution The election contract enables validator-elects to nominate themselves to become a validator. In order to do that, they need to call the contract’s public method with the following arguments: their PoS key, validator’s operator address, nonce, and the hash of these attributes. After the cycle is over, seven lowest hashes are chosen as new validators. Any validator-elect can choose to increase their odds by cycling through nonces off-chain and attempting to find the lowest possible hash before calling the contract method.
  • 16. Electionr - The Solution The bridge contract enables the movement of Ethereum assets to the liquidity pool on the PoS network. The bridge contract can be either one-way or two-way. The one-way bridge does not allow removing ETH and is inherently safer and less complex. The one-way bridge can also be decommissioned after the network has been bootstrapped. On the other hand, the two-way bridge gives liquidity to tokens on the PoS network since it allows them to be sold for ETH via signature consensus. The two-way bridge is more complex since it requires slashing conditions on the PoS network to prevent stealing assets.
  • 17. Peer-to-peer network is a real pain to draw. Here’s our try!
  • 18. Electionr - Implementation The election (Ethereum) contract is written in Solidity and consists of three public functions: ● electMe() — Checks whether submitted function arguments are valid and positions validator-elect in the right place in a sorted doubly linked list. ● publishGenesisSigs() — The caller of this function is a validator with the lowest submitted hash during the initial PoD cycle. After this function is called, the pointer in the doubly linked list is moved to the first non-validator hash, and GenesisValidatorSet event is emitted, publishing elected validators that should initialize the network. The next cycle begins after that. ● publishSigs() — After the initial cycle period, publishing a new validator set is not limited only to the one with the lowest hash but is open to anyone. Everything else is rather similar to publishGenesisSigs(). The election (Ethereum) contract is written in Solidity and consists of three public functions:
  • 19. We hope that you like what you’ve read so far. Before continuing to the conclusions here’s a chance to visit our blog and read all about the Electionr Tools, and Validator Election and Protection.
  • 20. Conclusion However interesting, this project proved to be a real challenge. Understanding the concepts implemented by Tendermint and Cosmos is not an easy task since their project is continually evolving and new concepts are often being introduced. In other words, our team had to keep up with this rapidly evolving technology and frequently adjust the codebase so that our project stays up-to-date with Cosmos-SDK, without trying to modify the constantly changing codebase.
  • 21. Thank you! No matter if you have just an idea you would like to validate, or already existing project you would like us to collaborate on – we are open for a chat. GET IN TOUCH
  • 22. Follow us and subscribe for more company updates @mvpworkshop @mvpworkshop @mvpworkshop And feel free to get in touch services@mvpworkshop.co