Pages:
Author

Topic: Concise but complete technical description of various proof-of-stake (PoS) schemes? (Read 2814 times)

hero member
Activity: 574
Merit: 500
The problem is, if McDonald's goes alone then network B basically becomes Disney dollars or a loyalty scheme. Network B transactions are only accepted or have value in one place: McDonald's. And they can decide to suspend that at any time without notice or recourse by shutting down network B (granted, they could take them to court in this case but why take the risk when McDonald's could just continue on network A?) Anyone can choose to accept them if they want, but why would they?

It would be like accepting payments from McD's in airmiles or the like, one of your suppliers will need to accept airmiles as payment or you are digging yourself into a hole. Lots of expenses and nothing of value to others that you can use to pay them. Sooner or later, you will have to stop accepting airmiles and go back to the original (e.g. dollars) just to stay in business.


The economic majority holds the balance of power. There is nothing stopping McDonald's forking. But they can't force anyone to use their chain. And, as shown above, there can't be any interaction between the two chains so the fork would need the economic majority for it to stand a chance of surviving long term. i.e. McDonalds forks and takes a fries supplier, a logistics company, a cow farmer, a butcher and 1 billion customers etc. with them and tries to make a sustainable economy.


Another way of thinking of the forking. It would be the same as McDonald's being on the Nxt network but then announcing they are only going to pay suppliers only in a 3 node, $5000 POS coin that is at #970 on CMC (a small economy of limited number of users). Or going from USD to [Island Nation form of currency].  It doesn't make economic sense for them or for their suppliers to follow. Any payments their suppliers receive in the mean time are likely to be worth nothing in the long term as the economy is too small and is most likely to fail.

I would say it is more of an assumption, it follows logic given the economic rules (self interest in preserving the value you have).

legendary
Activity: 1181
Merit: 1002
I applaud you for attempting to spell
it out in so concrete terms. I think I understand
the argument, but


McDonald's then tries to buy supplies for 100 they got from B. There is no one who wants to accept their transactions as the economy is so small, there are no fries suppliers running nodes on network B. They are all still doing business on network A.

Is this a realistic assumption? wouldn't the fries suppliers have an
incentive to follow and open up an account on branch with McDonald's, so as
not to lose their large customer. And all the people with a liking
to hamburgers?
Especially since they all - including McDonald's -
can still run wallets on the other forks.

I'm just not convinced that economic incentives are enough to
keep everyone on the same boat. To me they could under certain
circumstances encourage splitting. Please note that I don't think
this is a necessarily a bad thing at all.



They could eat for free in economy B -> this alone should incentivize McDonalds not to stay in economy B and switch back to A asap

(btw. those examples make me hungry)
legendary
Activity: 996
Merit: 1013
I applaud you for attempting to spell
it out in so concrete terms. I think I understand
the argument, but


McDonald's then tries to buy supplies for 100 they got from B. There is no one who wants to accept their transactions as the economy is so small, there are no fries suppliers running nodes on network B. They are all still doing business on network A.

Is this a realistic assumption? wouldn't the fries suppliers have an
incentive to follow and open up an account on branch with McDonald's, so as
not to lose their large customer. And all the people with a liking
to hamburgers? Especially since they all - including McDonald's -
can still run wallets on the other forks.

I'm just not convinced that economic incentives are enough to
keep everyone on the same boat. To me they could under certain
circumstances encourage splitting. Please note that I don't think
this is a necessarily a bad thing at all.

hero member
Activity: 574
Merit: 500
Their user base is and economy is drastically reduced.

Why, if you can run multiple wallets on
different branches?


In Wallet A you have 100.

McDonalds forks the network with their 5% stake. So now you have Wallet A with 100 and Wallet B with 100.

You sell a DVD for 100 on the original A network (95% of economy) and buy a burger for 100 on network B.

Your new balances are A = 200, B = 0.

McDonald's then tries to buy supplies for 100 they got from B. There is no one who wants to accept their transactions as the economy is so small, there are no fries suppliers running nodes on network B. They are all still doing business on network A.

McDonald's can't spend that 100 Nxt on chain A as that 100 is still in wallet A (+100 they got for the DVD). The transaction that moved those coins to McDonald's was on network B. McDonald's tries to convert the 100 to fiat to pay their suppliers. All the exchanges still run network A so they aren't interested in converting their forked coins from network B.

McDonald's decides to rejoin chain A rather than go out of business, so all network B's transactions never happened (no nodes running B = no network or history). McDonald's has an economic incentive to stay with the main chain if it wants to stay in business. Users have an economic incentive to stay on the main chain if they want their coins to be useful for transacting with businesses.
legendary
Activity: 996
Merit: 1013
Their user base is and economy is drastically reduced.

Why, if you can run multiple wallets on
different branches?
hero member
Activity: 574
Merit: 500

Why would Silkroad and McDonald's choose to be on different chains? There is an incentive for everyone to be on the same chain. If you deliberately fork with 1% of the stake, you are giving people a disincentive to use your chain as you will only be able to transact with 1% of the economy.

Well maybe McD would announce they'll
have nothing to do with Silkroad and want
a clean, family-friendly fork.

And if that happened, users who wanted
both services would then have to use two wallets,
right?

By the same token, maybe they would start their own interwebs as they want a clean, family friendly net? I don't think this is likely scenario.

If they did do it deliberately, they would be effectively leaving the network and starting on their own. It would be like "Physical Silkroad" moving it's one department store from America to Tahiti. Their user base is and economy is drastically reduced.

Maybe CfB can answer definitively (he wrote Economic Clustering).
legendary
Activity: 996
Merit: 1013

Why would Silkroad and McDonald's choose to be on different chains? There is an incentive for everyone to be on the same chain. If you deliberately fork with 1% of the stake, you are giving people a disincentive to use your chain as you will only be able to transact with 1% of the economy.

Well maybe McD would announce they'll
have nothing to do with Silkroad and want
a clean, family-friendly fork.

And if that happened, users who wanted
both services would then have to use two wallets,
right?
hero member
Activity: 574
Merit: 500
So, a new user starts their node and goes to McDonald's or whoever they want to send transactions to (they both have to be on the same chain for them to be valid). A large enough cluster will reinforce itself for the same reason and forks tend towards 1

So far it is unclear to me how the size of a cluster
eliminates forks.

What about this scenario: Alice wants to buy an ounce
of weed from SilkRoadNXT. So Bob passes him a blockhash
and she can sync with the branch where SilkRoadNXT is.

Afterwards she gets the munchies, so she wants
to buy a burger from McDonalds. She again calls Bob, who
passes her a hash from the chain with McDonalds.

And from now on, she has two NXT wallets or accounts on
her desktop: one for the weed, one for the burgers.  (Until
eating meat gets criminalized of course)

Why would Silkroad and McDonald's choose to be on different chains? There is an incentive for everyone to be on the same chain. If you deliberately fork with 1% of the stake, you are giving people a disincentive to use your chain as you will only be able to transact with 1% of the economy (and the 1% transactions wouldn't be accepted by the 99%).
legendary
Activity: 996
Merit: 1013
So, a new user starts their node and goes to McDonald's or whoever they want to send transactions to (they both have to be on the same chain for them to be valid). A large enough cluster will reinforce itself for the same reason and forks tend towards 1

So far it is unclear to me how the size of a cluster
eliminates forks.

What about this scenario: Alice wants to buy an ounce
of weed from SilkRoadNXT. So Bob passes him a blockhash
and she can sync with the branch where SilkRoadNXT is.

Afterwards she gets the munchies, so she wants
to buy a burger from McDonalds. She again calls Bob, who
gives her a hash from the chain with McDonalds.

And from now on, she has two NXT wallets or accounts on
her desktop: one for the weed, one for the burgers.  (Until
eating meat gets criminalized of course)
hero member
Activity: 574
Merit: 500
Short term consensus in Nxt is still "best chain" or "chain with most work".

Economic Clustering is for long term consensus after a break and you haven't kept up with the blockchain.


So, a new user starts their node and goes to McDonald's or whoever they want to send transactions to (they both have to be on the same chain for them to be valid). A large enough cluster will reinforce itself for the same reason and forks tend towards 1. Once the new user is up to date with the blockchain, economic clustering is no longer required. The user is then competing with McDonald's or whoever to create the "chain with the most work wins" to determine short term consensus.


That is my understanding. CfB has said in the past the BTC and NXT are very similar, if you consider each Nxt a small mining rig.
legendary
Activity: 996
Merit: 1013
OK, I think it's fairly clear that a formal difference between the consensus algorithms for PoW and PoS comes down to whether or not a node "catching-up" may need new information beyond what is encoded in the blockchain.  

A PoS node rejoining the network may need supplementary information beyond what's encoded in the blockchain to determine the best chain (e.g., the economic clustering method), while a PoW node can determine the best chain strictly from what's encoded in the blockchain.  

This brings up my next question: I hear people talk about "weak subjectivity" in relation to PoS.  Is the fact that a new node may need additional information why the term "weak subjectivity" exists?  ...A PoW node can determine the best chain in a strictly objective manner, whereas a PoS node needs to rely on weakly-subjective new information?

Once again, I'm not trying to argue in favour of PoS over PoW or vice versa.  I'm just trying to wrap my head around the specific differences.  


Based on what I've read here, it appears that term "best chain" is
no longer meaningful in NXT. If I understand correctly, it is perfectly
fine for multiple exclusive fork-branches to exist.

On the other hand, even with "economic clustering" there will be, I suppose,
the "best" chain - that's where McDonalds etc are. But that would not be "best"
in any formal sense at all, even if in practice it would be the most
favored one.

If that is so, the consensus algorithms of Bitcoin and NXT aren't
all that comparable.
legendary
Activity: 1181
Merit: 1002
 ...
This brings up my next question: I hear people talk about "weak subjectivity" in relation to PoS.  Is the fact that a new node may need additional information why the term "weak subjectivity" exists?  ...A PoW node can determine the best chain in a strictly objective manner, whereas a PoS node needs to rely on weakly-subjective new information?
...

I don't know if this is a generally accepted "definition" or the true origin of the term, but V. Buterin put it that way:

Quote
Weakly subjective:
a new node coming onto the network with no knowledge except (i) the protocol definition, (ii) the set of all blocks and other “important” messages that have been published and (iii) a state from less than N blocks ago that is known to be valid can independently come to the exact same conclusion as the rest of the network on the current state, unless there is an attacker that permanently has more than X percent control over the consensus set.

Under this model, we can clearly see how proof of stake works perfectly fine: we simply forbid nodes from reverting more than N blocks, and set N to be the security deposit length. That is to say, if state S has been valid and has become an ancestor of at least N valid states, then from that point on no state S’ which is not a descendant of S can be valid.

Source: https://blog.ethereum.org/2014/11/25/proof-stake-learned-love-weak-subjectivity/
legendary
Activity: 2968
Merit: 1198
Let's conduct a thought experiment. Imagine that network splitted for 24 hours and there are 2 competing branches. Thousands transactions are processed, thousands goods are delivered to the buyers. Now the network is merged and we see that the longest chain contains only 30% of the transactions but the shortest the rest 70%. Which network will win? BCNext thinks that the shortest one, coz economic majority will decide to lose less than more (we assume that loss is proportional to number of rolled back transactions), and I tend to agree with him. The reader is free to have another opinion of coz.

Another experiment. 20% of Bitcoin economy that owns 65% of hashing power decided to fork Bitcoin and add unlimited supply of the coins. Let's assume that they would mine 25 BTC per block forever. There are no other differences. What blockchain will a new user download? Of coz the one with unlimited supply because "the longest chain wins". Will the user agree on that? I doubt he will chose 20% of economy instead of 80%. And again we see that economic laws are more important than "mathematical" ones.

These two cases are quite different.

In the first case, both chains are valid according to the protocol definition. In the second case they are not.

It is possible that "economic majority" would win over protocol in the first case, but I'm not sure about that. Although people conducting trade on the shorter branch stand to lose money, and that interest is stronger in the short term, it may still be the case that respecting the integrity of the protocol is viewed as more valuable because that is something that protects everyone, including those losing money in this particular instance, in the long term).

In the second case there is no issue here. A chain that does not conform to the protocol is not a valid chain at all, therefore it can't be the longest chain. It's just garbage.

There is a variation of the second case where the economic majority decides to change the protocol. That is more interesting.
legendary
Activity: 1162
Merit: 1007
OK, I think it's fairly clear that a formal difference between the consensus algorithms for PoW and PoS comes down to whether or not a node "catching-up" may need new information beyond what is encoded in the blockchain.  

A PoS node rejoining the network may need supplementary information beyond what's encoded in the blockchain to determine the best chain (e.g., the economic clustering method), while a PoW node can determine the best chain strictly from what's encoded in the blockchain.  

This brings up my next question: I hear people talk about "weak subjectivity" in relation to PoS.  Is the fact that a new node may need additional information why the term "weak subjectivity" exists?  ...A PoW node can determine the best chain in a strictly objective manner, whereas a PoS node needs to rely on weakly-subjective new information?

Once again, I'm not trying to argue in favour of PoS over PoW or vice versa.  I'm just trying to wrap my head around the specific differences.  
legendary
Activity: 1512
Merit: 1004
Thanks for response.  

I'd like to re-word this in a way that doesn't use the term "software"; the software is an implementation of a protocol.  A node is free to use different software provided it's compatible with the protocol.

I'd also like to re-word your description in a way that doesn't make statements about what is or isn't possible (e.g., the last sentence in your description), unless we can prove this mathematically.  In other words, I only want to describe how a node picks the best chain from multiple candidate chains.  

How's this:

============
Upon rejoing the network, a node considers valid chains where:

(1) the generation signatures form a cryptographic chain linking back to Nxt's genesis block,
(2) all transactions are permitted according to the protocol rules.

If more than one valid chain exists, the operator of the node would analyze each chain, calculating the ratio of transactions that belong to participants that were well-known the the node prior to him leaving, to transactions from other participants.  For each chain, the node applies a deterministic formula to get a score based on these ratios:

   score 1 = fcn(candidate chain 1)
   score 2 = fcn(candidate chain 2)
   …
   score n = fcn(candidiate chain n)

The node would select the chain that had the highest score.  
============

There are 2 rules for consensus in Nxt. Good old "longest chain wins" for short range (used by up-to-date nodes) and "stick to the economic cluster" for long range (used by catching up nodes). There is no a hard line between the rules, but if you suddenly join a wrong branch and make a payment then the counterparty won't see your transaction (you both must be on the same branch). The incentive to stay on the same branch is forced by economical laws, not by mathematical ones. I doubt you can formalize this with pure mathematical notation.
communism need cooperation from all of us. Smiley
hero member
Activity: 574
Merit: 500
@Peter R, you might be interested in an expansion of CfB's last comment here:

https://nxtforum.org/general-discussion/on-economic-clusters-and-the-longest-chain/

It is an "essay about Economic Clustering and The Longest Chain written by BCNext".
legendary
Activity: 996
Merit: 1013
This is good thread  Smiley

Certainly sheds illumination on many things. Smiley
hero member
Activity: 574
Merit: 500
legendary
Activity: 2142
Merit: 1010
Newbie
I don't want to argue the validity of either of these methods; what I'm trying to do is formalize how the methods are different, and I think I've done that.  

Ok. For others I'd like to add that Nxt's approach solves problems like famous Bitcoin Fork 2013 in a decentralized manner (without necessity to have a developer saying what branch to follow).
legendary
Activity: 1162
Merit: 1007
You mentioned that the incentive to stay on the same branch are economic.  I take this to mean that upon rejoining the network, a node cannot determine the correct chain with perfect reliability from several candidate chains using only information contained in the chains.  The node needs to acquire new information (e.g., the last version of Nxt or other information from peers) in order to figure which chain is best.  But I think what you're saying is that this should be "obvious" and sort of like "how do you know if you're connected to the REAL Internet when you rejoin and not a fake one?  Haha...eventually you realize that none of your friends are getting your messages!!"

Scenario 1

Alice has never used Nxt. Bob (her friend) tells how it's cool. Alice downloads client software. Bob sends her hash of one of the recent blocks that his software sees. She copy-pastes the hash into the client and let the software to pick the same chain.

Scenario 2

Charlie is a guy who has no friends. He orders "50 shades of grey" DVD. He runs the client and downloads blocks for the last 6 months. Then he makes the payment to the DVD store. If the store is on the same branch then they will see his payment, otherwise they will inform Charlie that he should pick the branch that contains the block with hash.

Scenario 3

Dave buys 1000 NXT on Coinbase with USD and withdraws them to his wallet. In the interface of the website he sees that the transaction is done. If his wallet doesn't show the transaction then he copy-pastes the hash of a recent block from Coinbase site (or the wallet can pull this automatically) and jumps to the same branch.

Scenario 4

Eve always buys food in Walmart. She adjusts settings of her wallet to connect to Walmart website to ask for recent block hash, just to make sure that they are on the same branch.


This is how Economic Clustering works. It's perfectly legit to have Nxt blockchain forked several times. At some point you have to decide what branch to stick to.

OK, I think I can see clearly how Nxt solves the problem of "after leaving the network for some length of time, how does a node determine the current state of the blockchain?", and how Nxt's solution is different than Bitcoin's.  

A Bitcoin node does not need any new information beyond what is encoded in the candidate blockchains themselves.  It applies a systematic and predefined function/procedure to each candidate blockchain:  

   cumulative work 1 = fcn(candidate chain 1)
   cumulative work 2 = fcn(candidate chain 2)
   …
   cumulative work n = fcn(candidate chain n)

and, for example, if Candidate Chain #2 has the highest value for cumulative work, it picks this chain as the best chain.  

Nxt is different, because the node relies on new information in addition to what's encoded in the candidate blockchains:

   best chain = fcn(candidate chain 1, candidate chain 2, … , candidate chain n, NEW INFORMATION FROM PEERS)

in order to select the best chain.  


I don't want to argue the validity of either of these methods; what I'm trying to do is formalize how the methods are different, and I think I've done that.  

BITCOIN: a node rejoining the network can determine the best chain without any new information beside what is encoded in the candidate blockchains.

NXT: a node rejoining the network needs new information in addition to what's encoded in the candidate blockchains.  
Pages:
Jump to: