Unity Consensus — Proof-of-Concept

This article was first published on Stories by Aion on Medium
-----

Unity Consensus — Proof-of-Concept

Introduction

In this article, I’m going to walk you through the Aion Unity Proof-of-Concept (PoC) implementation. If you haven’t heard about Aion Unity, read this “zero-to-hero” blog post.

The PoC comprises of four components:

  • A stake registry contract which manages the staker registration and handles stake/unstake requests,
  • A new block structure, along with a set of validation rules, to account for two block types — PoW blocks and PoS blocks,
  • A staking client, analogous to mining software, that eagerly generates PoS blocks when it is eligible to do so,
  • An implementation of the difficulty adjustment algorithm and fork choice rule.

The objective of the PoC is to validate the key metrics presented in the Aion Unity paper and to simulate different attack scenarios. The metrics studied include block time, block reward distribution, and orphaned block rate.

The PoC Implementation

Stake Registry Contract

The Stake Registry Contract is the smart contract that manages the staker registration and processes vote/unvote requests (a.k.a. stake/unstake respectively). Any coin-holder with a minimum balance is allowed to register as a staker to participate in Unity consensus. Others can vote or unvote for a registered staker. Liquid coins become locked stake after a vote operation, and return to being liquid after an unvote operation, subject a to lock-up period.

The source code of the stake registry contract is available here. Although the smart contract is written in Solidity, it will later be rewritten in Java, to run on the AVM. Also, the enforcement of minimum registration stake and the unvote lock-up period are not implemented in the PoC.

Extended Block Structure

In Aion Unity, the blockchain structure is a singly linked list of PoW blocks and PoS blocks, with no intervening requirement. To distinguish a PoS block from a PoW block, we extended the original Aion block structure with additional fields. Specifically,

  • A ...

-----
To keep reading, please go to the original article at:
Stories by Aion on Medium

Comments (No)

Leave a Reply