Stacking: a New Consensus Algorithm for Blockchains

Very much excited !!

2 Likes

Yep, you’re right. Stacker payouts are weighted on holdings, so in that sense it’s similar to “staking”.

@muneeb is there a danger that PoX, like with PoS, that this type of thing will be viewed as not “fair” because for example, founders and whale investors have a huge advantage with their disproportionate amount of owned STX? That was how I felt about, as an example, with the Masternode model used by Dash and other chains. That of a reward process that favors the “rich” becoming richer. I’m holding off on judgement here and just want to instigate discussion about this.

3 Likes

PoS isn’t like PoX in that STX holders don’t automagically get more STX. Also, STX holders have to do some “work” to get BTC – they have to bless the preferred chain tip periodically, which requires running a full node (or using a trusted one). This adds value to the network because it helps miners and users agree on which fork is the “real” fork (and, Stacking rewards only materialize if there’s 80% agreement or higher). Also, unlike PoS, STX holders don’t get to mine blocks – they have no say on which transactions get mined, or what blocks get produced.

3 Likes

Posting @jude 's other response on Discord =>

yes, Stackers get BTC, and they get more BTC in expectation if they have more STX stacked. However, that only happens if (1) they actively participate in blessing the dominant fork, and (2) there’s broad agreement between miners and stackers over what the fork is (i.e. 80% or higher mining support). What Stacking does for the network’s consensus is it rewards the entire ecosystem for coming to agreement on the fork (beyond just miners or block-producers)
moreover, in order to do (1) and (2) correctly, Stackers would need to either run full nodes themselves, or have access to nodes they trust, which also helps enhance the network’s availability
@dant is correct – the purpose of Stacking is to provide incentives to keep the network running smoothly
Stacking isn’t passive income either – Stackers have to carry out tasks (1) and (2) over and over again to remain eligible
Also, this is currently just a proposal for now – not a single line of code has been written for it. We’re definitely open to feedback, suggestions, and improvements :thumbsup:

2 Likes

I think there may be a misunderstanding here.

If miners are all acting on perfect information, the worth of the BTC a Stacker ought to receive in PoX should be equal to the worth of the STX produced by mining the block, at the time the block was produced. The worth of those STX is determined by how much people are willing to pay for them. This, in turn, is influenced by a wide variety of factors beyond Stacking – in particular, people need to buy STX to deploy and run smart contracts on the Stacks chain.

So, what Stacking really ought to be doing here is distributing the proceeds of STX sales to Stackers (which will fluctuate with market demands). Because people can pool their STX, basically anyone who has any STX is a potential participant (importantly, this includes all developers and users in the ecosystem, not just miners). This organizing principle reminds me of a co-op – the community of Stackers, miners, developers, and users all cooperate to help the Stacks chain make progress, and they share the proceeds of STX that get sold as a result.

4 Likes

I think one improvement to the proposal would be to add the requirement that a Stacks holder must have/register an on chain Blockstack ID in order to participate in Stacking.

5 Likes

One thing that isn’t clear from this proposal, but should be added, is that in PoX, miners should burn some fraction b of the BTC regardless. This way, if a miner (1) gets lots of STX and (2) gets lucky enough that the 5 addresses in a round all belong to the miner, the miner won’t be able to mine “for free.” Instead, they’d at best get a discount of (1 - b)%.

2 Likes

Am I right that miners get 2 rewards: transaction fees from users and new minted STX tokens while paying out bitcoin to stackers? And after some years, there will be no new minted STX tokens, miners will get only transaction fees from users?

Hi,

Where, in particular, do you see my misunderstanding?

Also, Stacking most certainly seems to pass the test of passive income in the same way as running a POS node would. Everything that earns you something while you sleep is passive income, even if you set it up and maintain it once in a while. But I might still have misunderstood. From my understanding of this new system, it is like POS but without nodes actually creating blocks but only “blessings” aka endorsements.

Hi there, thanks for your reply!

Correct me if I’m wrong, but in your prior comment you seem to be predicating your analysis on the assumption that stacking and staking are operating under the same economic principles. This is not the case.

In staking (e.g. in Tezos), the amount of tokens you receive is proportional the amount you stake. As long as you’re an honest participant and work to produce blocks, you will receive new tokens in proportion to how much you staked earlier. In your analysis, you go on to reason about how this would translate into an increase in wealth for the staker – namely, the wealth increase is proportional to the worth of the XTZs you’re getting.

This is not true for stacking. The amount of BTC you receive is equal to how much the miners believe the STX are worth at the moment your address is up for consideration in stacking. As a Stacker, the protocol gives you no say in how much STX you receive. A small Stacker could easily receive a much larger BTC payout than a large Stacker if the miners change how much BTC they transfer. The only thing Stacking more STX gets you is more chances per reward cycle to get a BTC payout, but it does not make any guarantees of how much BTC you’d receive.

I’d argue that Stacking requires more work (i.e. more coordination) than PoS, since Stackers can only receive BTC if the network is healthy. The Stacks chain can and will make progress without the Stackers’ help, whereas in PoS systems, staking rewards are guaranteed if the chain makes any progress at all.

In the proposal, Stackers are neither creating blocks nor ordering transactions, and the Stacks chain will make progress even if no one participates in Stacking. So, this is fundamentally different than PoS.

1 Like

This is correct.

STX Miners participate in the PoX mining mechanism. They process Stacks 2.0 blocks, collect transaction fees, and earn newly minted STX. They participate in PoX mining mechanism by transferring Bitcoin to Stacks holders (only active Stackers) following consensus rules.

That’s not correct.

The Stacks token economics has ~2B total supply for year 2050 and inflation continues at the minimum rate beyond that as well. That’s the default plan. Details here.

1 Like

I’m answering a question from r/blockstack here as well:

I think these are good ideas. Both pooling and 100k chunks. I am still curious to learn more about what the stackers need to do specifically and about the distribution (payouts) for contribution. I am excited to learn more. Hats off to the team!

Thanks! We’re excited as well.

In the current proposals, Stacks holders (Stackers) have three requirements:

  1. They park (i.e., don’t move) 94K STX for a minimum amount of time (I believe the current default is one or a few months). Same requirement if pooling.

  2. They run a full-node of Stacks 2.0. For pooling, the pool operator runs this node.

  3. They sign and broadcast transactions on the Stacks 2.0 chain to signal information like what main/dominant fork they’re on. Such information is extremely valuable to honest STX miners and plays a part in the consensus algorithm.

2 Likes

Hello jude and thanks for your answers,

Im not sure I understand the difference between miners and stackers. Are miners those actually running a node and stackers the pool members who, together, reach 94k, or multiples thereof? If yes, for simplicity’s sake, let’s assume miners=stackers.

This is the part I do not (yet) get. From my understanding it works like this

  1. Pool or single entity has the required 94k
  2. Pool decides to run a node, nominates 1 operator amongst themselves
  3. Operator runs node and hopes to be (randomly) selected for a regular inflation payment
  4. Operator distributes rewards to pool members

You then say:

this is also confusing, more multiples of 94k should in the long run yield more chances and thus more earnings. I get that you are saying it will depend on market price of STX at the time but lets assume stable price, then more multiples of 94k should yield higher earnings. Am I missing something?

I don’t understand how much more work is required? What do you mean? Can you elucidate? Do you think running a POS node is just install and click? It is much more than that…I am curious how Stacking implies more work…

Yes, I got it, so it is ilke an endorsement-light. Sure.

Thanks

1 Like

Hi there,

From Blockstack Community Townhall, January 2020, it said miner B who is not selected must burn all their payment. So a large portion of bitcoin still burns as only from selected one is transferred to stackers? Why not transfer all bitcoin from all miners to stackers instead?

Thank you for all your answers.

1 Like

Does such a “discount” effectively reduce the security - aka the cost to rewrite history, censor transactions when compared to proof of burn?

Do you have a pointer to a discussion of the security of the current network (virtual chain on bitcoin), vs the original proposed proof of burn stacks v2.0 vs the new proposed PoX stacks v2.0 network?

2 Likes

Hi @argonau7,

Stackers and miners are generally not the same entities, since they each have different responsibilities, operational expenditures, and motivations.

Miners do the following:

  • Run full nodes with mining software
  • Relay blocks and transactions
  • Spend some BTC every block to attempt to publish a block
  • Replicate their blocks and microblocks in a timely manner
  • Earn STX coinbases and transaction fees

In particular, miners are always spending BTC, and miners are always online. These are ongoing expenses, which are compensated by the protocol via STX coinbases and transaction fees. Their incentive to do this at all is that they always receive STX on the fork they mine, even in the absence of Stacking.

Stackers to the following:

  • Monitor the set of forks that arise in the chain
  • Coordinate with other Stackers and miners out-of-band to identify forks to bless
  • Bless the fork they believe will receive greater than 80% of all mining power

A Stacker’s operational costs come from identifying the set of forks and coordinating with other Stackers to bless a >80% fork. At worst, this is the cost of running a full node that doesn’t relay anything, plus the cost of a BTC transaction fee to send out the blessing. As you point out, this cost can be amortized across a set of Stackers who collectively offload this responsibility to a pool operator. Even then, some Stackers may choose to not run a node at all, and instead simply trust a block explorer to tell them which forks exist and whether or not a fork has >80% support. But regardless, Stackers do not receive STX; in expectation, they receive the BTC-denominated market rate for STX collected by miners.

Stackers participate opportunistically – their participation is welcome, but not required for the Stacks blockchain to work. If anything, it helps miners make better decisions on which fork to mine on if there is contention.

In the earlier comment, I was contrasting Stacking from PoS. In PoS, you get the same number of tokens regardless of market prices. In Stacking, you don’t. But yes, if you assume that miners collectively spend the same amount of BTC per block in a Stacking reward cycle, then Stackers with more slots will receive more BTC.

Yes, I do think running a PoS node is “install and click.” I think the fact that can be much more than that for certain blockchains is an artifact of the design of the installer, not the design of the protocol. This is because in correct PoS blockchains do not fork. A PoS blockchain behaves like your typical run-of-the-mill BFT database, where forks only arise if the safety properties of these systems are violated (at which point, out-of-band human intervention is required to fix it). If (1) you know the current validator set’s public keys, and (2) the 66%+ majority of all current and future validators remain honest, then your node will always be on the 66%+ fork. There’s no need for a human-in-the-loop to tell the node periodically which validator set(s) to trust. The only human involvement is deciding what to do with the earned PoS tokens.

This is not true with Stacking, since the Stacks blockchain can and will fork even under correct operation (this is a feature, not a bug, since forking allows the blockchain to repair itself in-band). Therefore, Stackers need to be able to make decisions as to which fork they’ll bless. This decision is influenced by a variety of both in-band and out-of-band factors, such as (but not limited to the following):

  • Will other Stackers bless this fork?
  • Will miners honor the blessings, or work against them?
  • Which Stacking pool do I join, and how do I join/leave it?

There is not protocol-determinable “right answer” to these, since Stacking isn’t part of the consensus protocol (recall that miners make progress with or without Stackers).

Hope this clarifies things!

2 Likes

Yes, discounts reduce safety, since miners can spend less to mine blocks than other miners who don’t receive the discount. However, discount-mining is superior to free-mining from a safety-perspective, since you can bound the advantage a miner can have if their Stacking addresses come up for rewards. Proof-of-burn is the most secure form of proof-of-transfer, since there is no possibility of a discount then.

The security models for virtual chains and PoB/PoX are fundamentally different, since virtual chains do not have a protocol-determined way to identify “fork quality.” Choosing the right fork requires human intervention in virtual chains.

PoB is more secure than PoX, since all miners pay at the same rate. However, there exists variants of PoX that can limit how much of a discount a miner could receive to the point where, practically speaking, PoX would work out just fine. Requiring a fraction b to be burned is one such variant. Requiring O(b^e) to be burned is anther option, where e > 0 is a protocol-defined constant.

2 Likes

This is a good question. Stacks chain sortitions are globally-scoped – there is one sortition per Bitcoin block, and it picks a Stacks block out of all candidate Stacks blocks across all Stacks forks that exist. As proposed in this SIP, miners only transfer Bitcoin if they mine on a fork with a significant majority support. If this were not the case, then a miner with a very small amount of mining power (let’s say 1%) could slowly but surely mine its own fork and Stack only the STX that exist on that fork up until the point where the fork would pass the “prepare” phase and enter the “reward” phase. At this point, the miner could mine blocks for free – they could take out a loan for a huge amount of BTC (e.g. 10,000 BTC) and then PoX it to mine on their own fork during the “reward” phase. Because they were the only Stacker on their fork, they’d receive all of the BTC back. But because sortitions are globally-scoped, what would happen is that this 1% miner would effectively deny service to all other forks besides theirs for the duration of their fork’s reward cycle, which would not only stop blocks on the dominant fork from being mined, but could also be used to eventually overtake the dominant fork and reorg the entire chain (all for free, minus the cost of BTC transaction fees). This cannot be allowed to happen, so SIP 007 specifically limits Stacking to occur on forks with over 80% mining support.

3 Likes

I think this will likely be the case. In my mind the model is roughly number of STX parked * work done (0 or 1). If a Stacks holder is not actively running a full-node and signaling the information then she is not actively participating and won’t earn any BTC reward. But if the holder is participating then the payouts will likely be proportional to STX parked.

No, a large amount of Bitcoin is not burned. That’s for corner cases. The goal here is for the bulk of Bitcoin that is used to get distributed to active Stacks holders that are participating in the consensus algorithm.

2 Likes

Hi everyone!

Love the proposal and love the idea of updating the proof-of-burn system to a proof-of-transfer system. Seems like a clear upgrade.

On that note, I have a few comments on this proposal. The biggest one I’ve included below, which outlines what I see as an issue with the “prepare” round and the reward set that can cause the system to inevitably devolve into proof of stake.

In the SIP-007 proof-of-transfer proposal, it appears that the “prepare” process can be gamed in order to provide unfair advantages to miners with more funds, thus leading to a system where the rich get richer.

To illustrate this, we can consider a simplified version where there is 1 address in the reward set per cycle. Not that the same issue applies with 5 addresses per reward set, but to a lesser degree, and we will build up to this condition below.

Imagine that every block there is only 1 address randomly selected from the eligible “whale” addresses (addresses with 0.02% holdings). Then, each round, most miners would be able to give up their Bitcoin for a chance at winning the Stacks, while the owner of the recipient address would be able to send all of their Bitcoin and send it to themselves in order to virtually guarantee that they will be rewarded the Stacks.

In this scenario, the miner risked nothing and gained the Stacks reward for free. It is easy to see how the system would devolve into a steady state in which the only miners operating are those with whale addresses and where those whale miners are only participating in rounds in which they are the only guaranteed recipients. One could argue that this isn’t a total breakdown of the system, but is in actuality simply a devolution into proof-of-stake with pooling.

It is also important to consider that this should not just be a theoretical devolution, but rather a necessary devolution if one assumes any reasonably efficient mining market (like Bitcoin).

Now we can consider the scenario with 5 addresses per reward set. The path to devolution is not as apparent here, and it would undoubtedly take a bit longer to play out, but the same properties apply.

In each round, most miners would be able to give up their Bitcoin for a chance to win the stacks, while the owners of 1/5 of the recipient addresses would be able to send 20% more for the same amount of risk, thus getting 1.25x the votes as everyone else. Every round, there should be up to 5 miners who have the ability to get 1.25x the votes that round. And in certain rounds, certain miners would get even more because they would own more than 1 recipient address for the round:

  • 1/5 owned = 1.25x advantage (can transfer 1.25 Bitcoin and only risk 1)
  • 2/5 owned = 1.67x advantage (can transfer 1.67 Bitcoin and only risk 1)
  • 3/5 owned = 2.5x advantage (can transfer 2.5 Bitcoin and only risk 1)
  • 4/5 owned = 5x advantage (can transfer 5 Bitcoin and only risk 1)

We should assume an efficient market with the Bitcoin-to-Stacks conversion. A big part of this is that at any point in time, miners could choose to purchase Stacks on exchanges rather than mine. This means that after a certain number of rounds, the amount of Bitcoin spent should vary around some average amount, as miners seek to predict how many Bitcoin will be transferred for Stacks and thus how much expected profit they will make by participating in any given block.

With this knowledge of the average amount, it should be apparent that miners with a recipient address in the set should be the only miners who participate, as they will be the ones with a 1.25x advantage.

Miners who do not do this analysis and who do not practice discerning mining will progressively realize that they are losing money, as they are receiving mining rewards at below market rate, and will then go to the exchanges to purchase stacks instead. The only miners left will be the whale address miners who focus on the blocks with their own recipient addresses. This will essentially be a proof-of-stake mining system, with a layer of obfuscation.

This process can be exacerbated if miners band together and create alliances. Together, these miners would be able to own 2/5 addresses or more in certain blocks, and so would be able to gain 1.67x advantages, which would be even less feasible for other miners to compete with. The larger the miner alliances, the larger the advantages.

All in all, over time, the senders who play the simulated proof-of-stake game and only mine in the blocks in which they own recipient addresses will be the ones who continually make profits while the miners who do not play the game (and instead play the honest proof-of-transfer game) will continually make losses.

Now onto the solution.

The way to fix this would be to add a third phase in the beginning in which miners must commit to a given round and post collateral before the recipient addresses in that round are revealed. If this is done, then the collateral can be seized if the miner does not actually participate in the round.

The collateral can be posted in Stacks by having the miner send a commitment transaction from an address with a Stacks balance. The protocol has control over the Stacks balances, so it has the capacity to seize the collateral in the instance that a miner fails to send the Bitcoin in the round.

The amount of Stacks required to be posted as collateral could be the same amount as the potential reward for that block. This would ensure that there is no possible way that any miner could cheat and come out net positive.

In summary, the collateral posting system would prevent miners from selectively participating only in rounds in which they get a percentage of the proceeds. It would mean that every round is effectively the same to all participants. And it should mean that the system does not devolve into proof-of-stake.

3 Likes