Consensus

Leader Election

Metadium was created based on the RAFT consensus algorithm. Users can use META tokens to access the network and use identity-related features, such as creating and updating their META ID. The authority of block creators (nodes) is limited to the authority recognized and designated by Metadium, and nodes generate blocks and protect the network through motivation.

Consensus Algorithm

Stake based Proof of Authority (SPoA)

Metadium's block creation is possible only by authority members who have staked a certain amount of Meta, the Metadium coin, or more and have been approved in advance.

Authority

Metadium's Authority refers to a consortium that performs the same role as a miner in PoW, a consensus algorithm such as Bitcoin/Ethereum. In Metadium, the process of being included or deleted from an authority is determined by voting by existing authority members. Afterwards, when Staking is confirmed, any of the existing authority members propose a member add proposal to the governance contract, and if more than 50% of existing authority members approve, it will be registered as a new authority member.

When the Authority receives transactions created by users, it verifies the transaction details and temporarily stores the verified transactions in the mempool. When an Authority member is elected as a leader by RAFT, they create a block header containing the hash information of the previous block. This process is done automatically through software, and there is no need for authority members to monitor the network’s status continuously. However, the authority member must manage the firewall and account's private key to ensure the block-generating computer is not used maliciously.

Leader Selection

Taking Bitcoin's PoW as an example, a miner who generates a block header hash that satisfies the difficulty calculated by the protocol can create blocks and propagate blocks. Since no separate authority exists to generate blocks, blocks are created through mutual competition. For this reason, resources are inevitably wasted in the block creation competition, and since work that satisfies the difficulty conditions must be proven, physical restrictions are placed on the block creation time (average Bitcoin 10 minutes/Ethereum 15 seconds). As a result, PoW has a scalability trilemma, and the introduction of PoS and sharding are being proposed and studied as realistic ways to solve this problem.

Since Metadium started with the purpose of providing ID services globally, it was determined that it would be impossible to provide the desired service in the public domain using methods such as PoW or PoS. Initially, consensus methods such as DPoS, PoA, and PBFT were considered, but Metadium designed SPoA (Stake based PoA), a new Consortium consensus algorithm that borrows the advantages of DPoS and PoA as the most suitable consensus algorithm. SPoA basically establishes an authority through transparent identity information and legal contracts and introduces the concept of staking to prevent inappropriate behavior by participating authority members.

Metadium uses etcd, an implementation of RAFT, as a leader selection algorithm to select the leader who creates blocks.

Reward Distribution

Existing consensus algorithms have a structure in which the entity that created the block takes both the block reward and the collected fee. For this reason, in systems not based on competition, such as DPoS and PoA, the most critical problem to be solved is to fairly sharing the power of block creation. However, this limitation increases the number of messages that must be exchanged between BPs (Block Producers), which must process transactions at high speed and create blocks, and frequently changes the leader to evenly divide block creation opportunities in situations where traffic is piled up in the queue. This causes problems that prevent optimal performance. To compensate for these shortcomings, SPoA is designed always to give the same rewards to authority members, no matter which of them creates a block. In other words, in the current version, whenever a block is created, regardless of the amount of staking, the block reward and collected fee are distributed equally as 1/n (n is the number of authority members).

The accounts that receive rewards (1 per member) are all registered by voting, except for the governance coinbase account that initially distributed the system contracts to the governance contract, and the authority member who creates the block updates the balance state of the corresponding accounts and sends them to patricia. The calculation result is reflected in the root hash value of the trie.

All full nodes, including authority members, verify the header of the received block. If it is detected that the rules recorded in the governance contract are not accurately reflected, the block is discarded. Additionally, voting allows one member to be removed and the staked Meta confiscated.

Block Generation

To achieve immediacy in DID creation by self-sovereign identity authentication, we have maintained the logic of creating blocks within 100ms when a transaction occurs and at 5-second intervals when there is no transaction. However, contrary to Metadium's initial intention, many resources were used not only for transactions occurring with DID but also for other transactions, which caused a situation in which the Metadium blockchain accumulated garbage data indiscriminately.

Metadium blockchain strengthens network security by fixing the block creation cycle to 2 seconds, making it difficult for malicious attackers with more computing power to modify blocks, and also reduces the load on the network by increasing the block creation time.. Additionally, by adjusting the block creation time, we ensure the network’s stability and the consensus process’s reliability.

Block Verification

When a block created by a leader is propagated to the network through p2p, each full node (including authority members) that receives it must independently verify and determine the validity of the block. Authority nodes that are not leaders check whether the block was created by a member selected as a leader among the members recorded in governance and if they self-verify and determine that rewards are distributed normally. Transaction details are reflected in the entire system’s state, and the blocks are propagated to neighboring nodes.

The non-authority full node that received this checks whether the signature of the member included in the header is correct, verifies the transaction details, and if it determines that the transaction recorded in the block was created according to the rule, it saves the block to the local disk and spreads it to neighboring nodes.

When verifying propagated blocks, there are two things that all full nodes must first verify before proceeding with the above process: Leader_Limit and Max_Consecutive_Blocks.

  • Leader_Limit is defined as follows. In RAFT, when a specific member is determined as the leader, an epoch in which a block can be created is given. The purpose is to prevent this epoch from being given consecutively. In other words, all blocks are valid only if they satisfy the Leader_Limt below.

Leader_Limit = floor(SIGNER_COUNT / 2) + 1 (Number of consecutive epochs out of which a leader may only occupy one)

  • Max_Consecutive_Blocks is the maximum number of blocks the same leader can continuously create in one epoch. This value is a variable introduced to limit the height at which the branched blocks can grow when the network branches due to the hacking of member nodes. Both values ​​are managed by a governance contract and can be changed by voting.

The two methods mentioned above are designed to ensure block finality and minimize the potential damage maliciously behaving authority members can cause to the network.

Staking

To become an Authority member, staking META is one of the prerequisites. Staking can be done by calling pre-defined functions in the governance contract, known at the system level while transferring META. Staking META is only possible through the Governance Dapp, and the minimum/maximum amount available for staking can be changed through voting. Voting power is determined based on the amount of locked META staked, and whether the staked META is locked or unlocked depends on the outcome of the voting process.

Voting (On-Chain Governance)

The Metadium governance contract stores system variables that can be altered by Voting. It also contains functions related to the participation, withdrawal, and replacement of Authority members. Each Authority member possesses Voting Power proportional to the amount they have staked. Each voting session lasts for a voting duration (1 day to 7 days), and a proposal passes if it obtains more than 50% approval from the total amount of staked Meta during that period.

Metadium Governance dApp: https://governance.metadium.com/

Only Authority members can initiate voting. When applying for voting, the voting duration can be specified within the minimum/maximum range, and if unspecified, it defaults to the minimum value. The start and end of the voting period begin when a member first casts a vote and continues for a maximum voting duration. Even within the voting duration, if there is a majority decision (more than 50%), the voting ends, and subsequent actions are taken. Since only one voting can be conducted at a time by default, a new one cannot be initiated if there is ongoing voting.

Last updated