Catapult Elephant Update (Part 1)

Part 1 of 3

NEM Catapult

Elephant Update

Understanding PoS+ Algorithm

Document link: here.

Translations:
Japanese: here.
Mandarin: here.
Spanish: here.
Russian: here.
Italian: here.

Stomping Elephant (1 of 3):

Understanding PoS+ Algorithm

Latest Core Engine Milestone

Catapult is the upcoming full-featured core NEM engine. The development milestones are chronologically alphabetized and code-named for organization and recognition. Most recently, the Dragon update soared past us, and now the fifth milestone is fast approaching. In this series, we will introduce and examine the changes in the imminent milestone, Elephant.

Proof-of-Stake+ (PoS+)

NEM1 uses a modified proof-of-stake consensus algorithm called Proof of Importance (PoI). Recall that in a basic Proof-of-Stake (PoS) consensus algorithm, the formation of a subsequent block in a blockchain is stochastically assigned to a coin-holding “stakeholder” of the blockchain weighed by a combination of factors relating to the stakeholders’ wealth. PoI was so named because the block creators (all block creators are sourced from the pool of local and delegated “harvesters”) are selected on the basis of each account’s “importance” in the NEM network.

The novel algorithm determines the score based on a network theory that considers each account’s recent transactions, “vested stake”, and transaction partners. It was cleverly innovated by NEM’s devs to overcome the pitfalls of the Proof of Work (PoW) and PoS consensus systems, but the PoI system as in NEM1 needed improvement.

Problems

  1. Scalability: While PoI compares favorably to PoW in terms of scalability, PoI is not projected to scale well in the long run. The computation of importance for large numbers of harvesters puts an exponential strain on the network. For instance, if the minimum required balance for harvesters were 10,000 XEM, the number of harvesters could potentially near 900,000 in the worst-case scenario; the collection of relevant transactions and subsequent calculation of importance scores for all eligible accounts would simply cost too much memory and computing power.
  2. Harvesting distribution: PoI was originally designed to disrupt the unfair advantage given to coin hoarders in the standard PoS consensus system. However, the present PoI protocol does not involve smaller accounts to the extent originally intended, making PoI behave much too similarly to PoS.

Solution

From an ecosystem’s health perspective, there were three primary factors to consider:

  1. Stake: Owners with larger balances create stability and have more incentive to see the ecosystem flourish.
  2. Transactions: Usage of the network should be encouraged
  3. Nodes: More active nodes lead to a more robust and stable network.

The combination of these factors should determine an account’s stake in the ecosystem and their appropriate reward. Hence, the new algorithm factors in three sub-scores for all high-value accounts:

  1. Stake Score (S`): Percentage of the effective balance of all high value accounts at time P.
  2. Transaction Score (T`): Percentage of total transaction fees among all high-value accounts in period P-1 to P.
  3. Node Score (N`): Percentage of total beneficiaries among all blocks in P-1 to P.

In summary, the new algorithm rewards accounts for having stake, participating in the network, and running active nodes.

This consensus protocol is much more efficient. In NIS1, power iterations are calculated by creating an outlink matrix that defines the transaction graph. Catapult simplifies the calculation, using transaction fees as a proxy of activity. As a result, the scalability of NEM’s consensus protocol is significantly improved.

Furthermore, the algorithm selects harvesters more fairly. It is constructed so that the combination of the Activity Score and the Node Score has a multiplier effect when the Stake Score is low but becomes insignificant when the Stake Score is high. The mathematical adjustments were made in accordance with observations made in NIS1; the influence drops sharply between effective balances of 10,000 to 100,000 and phases out almost entirely at 200,000. Consequently, the rich-get-richer problem is corrected.

The improved consensus protocol considers accounts’ stakes in the network, but with more variables than the standard PoS protocol. Thus, the consensus protocol for Catapult is aptly named PoS+, and it will perform as how the PoI was originally envisioned to. More efficient than PoW and more egalitarian than the PoS, the upgraded PoI will enhance the NEM blockchain experience for all users powering the network.

For more details about the PoS+ algorithm, please visit the NEM Developer Center. In the next part of this series, we will introduce the notable upcoming features such as metadata and Mosaic Restriction.

References

https://nemtech.github.io/concepts/consensus-algorithm.html

https://nemtech.github.io/concepts/harvesting.html

13 Likes

Thanks for the update! Looks very interesting. Will read up on the technical side more :slight_smile:

1 Like

Good stuff.

One question re: “the influence drops sharply between effective balances of 10,000 to 100,000 and phases out almost entirely at 200,000.”

What would keep a stake holder from simply splitting his funds into multiple smaller accounts to avoid the influence drop? Couldn’t you make multisig transactions to create activity with all of these accounts? Curious to see exactly how it works…

1 Like

You would need to run a node with every small account = extra costs.
Plus creating fake activity = fees = extra costs

So it doesn’t really make sense to split a big account if you don’t have real transactions. You would (hopefully) lose more XEM than you win.

I also wrote a blog about POS+ to help the community to understand.

POS + is made up of three parts. An account can get an increased chance to make a block based
upon 1) stake of coins, 2) how active an account is, and additionally 3) if they also run their node.

It is more efficient than PoI

The POI algorithm used a lot of computational power; this could be a problem in the long run. It was keeping track of multiple different metrics to weight each transaction on the NEM blockchain to determine which accounts were “important” and which were not. This was useful because we know that “important” accounts were contributing to the ecosystem. In the new POS+ algorithm, activity in the network is still valued and being measured, but now the metrics have been reduced to an outflow of tx fees paid as we know that “important” accounts are ones making txs and therefore paying fees. In summary, therefore, it is easier to just track tx fees instead of other very complicated and math-heavy metrics to figure out which accounts are more important and contributing to the network activity.

Account activity is not the only important thing though. We also know that stake, which is essentially the amount of coins an account has, was always an important part of POI, and is usually the only important thing in POS. In POS+ stake will remain an important part of the formula but it doesn’t stop there. In addition to account activity and stake, POS+ will also reward those running nodes.

Incentivizes running full nodes

Most blockchains have no incentive for running full nodes. This has famously been a problem in Bitcoin, Ethereum, and other blockchains where running a full node is a hobbyist and altruistic endeavor. (Note: Miners get rewarded for producing hash power, not running a full node, so almost all choose not to run a node.)

When NEM was first launched, this problem was originally outsourced to an additional layer, to a program called Supernodes. Supernodes, while being successful at ensuring we had lots of nodes, paid rewards that were not directly a part of the blockchain consensus protocol of POI. The Supernodes program has been providing an important service to NEM and is also planned to continue in some form in Catapult, though the full details have yet to be finalized. But now with the addition of improvements from POS+, we are happy to say that those running even a regular node will now be directly rewarded by the system!

And as another added bonus to make running a regular node more attractive, the more delegated harvesters a node collects, the more profitable running a node will be. This incentive comes in two ways. The first is that now node operators can collect a small fee from each block a delegated account makes while harvesting on that node. The second is that the sum of all the delegated harvesters’ importance on a node are aggregated in a way that helps to increase the overall chances of making a block on the node. And again as mentioned before, this all happens by consensus now without delegating to a second layer.

(Note: Delegated harvesting on Catapult is a safe and secure contract for any account with POS+ to request a running node to make their account create blocks and therefore collect fees in the blocks.)

Weighted towards smaller accounts

The best part of POS+ is that it is all weighted towards smaller accounts. If an account has a very large amount of stake, (think a large exchange) its bonus for outflow of tx fees and running its own node is not nearly as a big percentage bump as say a small but active account running its own node. This rewards the small-timers who are active in both building on the NEM ecosystem and supporting the network favorably compared to large investors that just stake their coins using delegated harvesting. This helps solve the “rich getting richer” problem that is ever-present in POS and the “POW doesn’t reward hobbyists for running a full node” problem that is present in most POW coins.

NEM devs have really outdone themselves with this solution, and I think it is something the community can be proud to share.

4 Likes

I’m still confused on “POS+” in catapult.
for example if i hold 50k xem, and enable remote harvesting on catapult, it this profitable?
seems holders are loosers in new nem(catapult) :frowning: