elective-stereophonic
elective-stereophonic
Academic questions regarding PoS and Nxt  
Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest Stable Nxt Client: Nxt 1.11.15 | Latest Experimental Nxt Client: Nxt 1.12.0e

Author Topic: Academic questions regarding PoS and Nxt  (Read 2896 times)

lmatteis

  • Newbie
  • *
  • Karma: +3/-0
  • Offline Offline
  • Posts: 4
    • View Profile
Academic questions regarding PoS and Nxt
« on: July 21, 2015, 01:00:41 pm »

I'm studying PoS systems from an academic point of view. Have been chatting with some bitcoin-biased people which seem rather critical of PoS systems, but have also been studying on my own and have extensively read things on the Nxt wiki. I have a few technical questions that I can't seem to answer myself:

  • Can rich accounts reorg the blockchain? Apart from the ethical disincentive for doing this (you'd be devaluating your own wealth), is it technically possible to do this in Nxt? If not, what's preventing one with lots of coins to reorg the blockchain?
  • When I'm forging, is it a constant stream of revenue or do I have to wait 1440 blocks between each reward? And, do all people that are "unlocked" and online get a % of the reward for a single block generation, or only a random person?
  • If it's the case that only a random person (account) gets to generate the block, wouldn't having a larger percentage of unlocked accounts (from a single person) increase the chances of obtaining the reward? (I'm not sure I understand what is "random" in the forging process)
  • I have read that an account with more than 50% of the coins in the network, will be forging blocks forever (nobody but him will be able to forge). Why is this? I thought the probability was random between users who had stake? Or is it the one with most coins that always gets to mine the next block?
« Last Edit: July 21, 2015, 01:03:26 pm by lmatteis »
Logged

Damelon

  • Hero Member
  • *****
  • Karma: +792/-54
  • Offline Offline
  • Posts: 2314
    • View Profile
    • Nxt Inside
Re: Academic questions regarding PoS and Nxt
« Reply #1 on: July 21, 2015, 01:46:18 pm »

I'm studying PoS systems from an academic point of view. Have been chatting with some bitcoin-biased people which seem rather critical of PoS systems, but have also been studying on my own and have extensively read things on the Nxt wiki. I have a few technical questions that I can't seem to answer myself:

  • Can rich accounts reorg the blockchain? Apart from the ethical disincentive for doing this (you'd be devaluating your own wealth), is it technically possible to do this in Nxt? If not, what's preventing one with lots of coins to reorg the blockchain?
  • When I'm forging, is it a constant stream of revenue or do I have to wait 1440 blocks between each reward? And, do all people that are "unlocked" and online get a % of the reward for a single block generation, or only a random person?
  • If it's the case that only a random person (account) gets to generate the block, wouldn't having a larger percentage of unlocked accounts (from a single person) increase the chances of obtaining the reward? (I'm not sure I understand what is "random" in the forging process)
  • I have read that an account with more than 50% of the coins in the network, will be forging blocks forever (nobody but him will be able to forge). Why is this? I thought the probability was random between users who had stake? Or is it the one with most coins that always gets to mine the next block?


Hello lmattels,
Great to see you are doing some research into Nxt :)
You might want to have a look at the papers written by kushti (who also is an academic) about Nxt and PoS: https://nxtforum.org/consensus-research/
Contact him himself if needed or ask me, I can get you into contact if the forum contact proves difficult.

You could also look in here for more info: https://nxtforum.org/nxt-whitepaper/
Some of the people who contributed there are still active on the forums and can also answer more questions.

Lastly, you might want to look at our whitepaper, which has a lot of technical info: https://www.dropbox.com/s/cbuwrorf672c0yy/NxtWhitepaper_v122_rev4.pdf

Hope that helps :)
Logged
Member of the Nxt Foundation | Donations: NXT-D6K7-MLY6-98FM-FLL5T
Join Nxt Slack! https://nxtchat.herokuapp.com/
Founder of Blockchain Workspace | Personal Site & Blog

yassin54

  • Hero Member
  • *****
  • Karma: +240/-14
  • Offline Offline
  • Posts: 2503
  • I am Homer, Sorry my english is Bad!!
    • View Profile
Re: Academic questions regarding PoS and Nxt
« Reply #2 on: July 21, 2015, 01:53:37 pm »

Welcome to Nxt!  ;)

TheCoinWizard

  • Hero Member
  • *****
  • Karma: +97/-55
  • Offline Offline
  • Posts: 614
  • Learn by questioning everything!
    • View Profile
Re: Academic questions regarding PoS and Nxt
« Reply #3 on: July 21, 2015, 02:27:55 pm »

I'm studying PoS systems from an academic point of view. Have been chatting with some bitcoin-biased people which seem rather critical of PoS systems, but have also been studying on my own and have extensively read things on the Nxt wiki. I have a few technical questions that I can't seem to answer myself:
  • Can rich accounts reorg the blockchain? Apart from the ethical disincentive for doing this (you'd be devaluating your own wealth), is it technically possible to do this in Nxt? If not, what's preventing one with lots of coins to reorg the blockchain?
That might be possible if you get 51% of the forgers on your side, but according to the nxt protocol you can only go back 1440 blocks in time for your reorg.
This has once been asked by some members when bter got hacked for some 40.000.000 nxt... It was not done and the hacker gave back all but 8M of it.
If you want to have some fun, go read those 90 pages  :D
https://nxtforum.org/news-and-announcements/forgers-have-been-faced-with-a-choice/
  • When I'm forging, is it a constant stream of revenue or do I have to wait 1440 blocks between each reward? And, do all people that are "unlocked" and online get a % of the reward for a single block generation, or only a random person?
Here you can see forging in real time:
https://nxtportal.org/monitor/
So every block you have a chance that you will write in the block in the blockchain and get the fees from the transactions in that block. This chance depends on your confirmed balance, ie the nxt you have on your account for more than 1440 blocks. It also depends on all the other forgers confirmed balances. If you get generate new block with fees you can immediately spend these fees, but the fees will have to wait 1440 blocks to count to your confirmed balance.
  • If it's the case that only a random person (account) gets to generate the block, wouldn't having a larger percentage of unlocked accounts (from a single person) increase the chances of obtaining the reward? (I'm not sure I understand what is "random" in the forging process)
here a bit more on the foring algo:
https://nxtforum.org/index.php?topic=9540.0
If your question is simply do 2 accounts with each 1M forge more than 1 account with 2M than I believe the answer is...
No, on the contrary. The 2M should earn a little bit more than double one 1M account.
If your question is can 2 accounts with each 1M collaborate and hereby forge by more than 1 account with 2M than I believe the answer is...
Possibly, in the case a 1M account is 1st to forge and the other 1M account is second to forge, the first account could skip generating a block. Hereby granting them a longer block time for the 2nd 1M account to generate. Although the idea was to penalize the skipping account from forging 1440 block. I do not know if that penalty is implemented and do not think that it would matter if it was done with hundreds/thousands of 10k nxt accounts.
  • I have read that an account with more than 50% of the coins in the network, will be forging blocks forever (nobody but him will be able to forge). Why is this? I thought the probability was random between users who had stake? Or is it the one with most coins that always gets to mine the next block?
Standard he would just forge about 50% of the blocks.
But if that person does a 51% attack, having 51% of the forging stake, then he could technically do this. That is because the standard consensus is the 51% stake. BTC has the same possibility with 51% work attack.
The attacker can only block transactions from getting on the blockchain, but cannot create fake ones. Also, as a reaction, the 49% stake could update their to no longer accept any blocks from the attacking stake and we would have 2 NXTs now... Two forks, one being forged only by the attacker, and one with all the rest on it.
In general it isn't as big of a problem because we can identify the stake that is attacking, whereas in POW i believe this is harder.
because we can seperate the attacking stake from the none attacking stake, whereas in proof of work you cannot.
« Last Edit: July 21, 2015, 02:37:09 pm by TheCoinWizard »
Logged
Welcome to the After Nxt Calendar era...
Which started in the year 222 of the French Republic, Frost month, on the fifth day of the first week, better known as the 2456621th Julian day,
even better known as 24 November 2013 at 12:00:00 UTC.

lmatteis

  • Newbie
  • *
  • Karma: +3/-0
  • Offline Offline
  • Posts: 4
    • View Profile
Re: Academic questions regarding PoS and Nxt
« Reply #4 on: July 23, 2015, 04:06:55 pm »

So every block you have a chance that you will write in the block in the blockchain and get the fees from the transactions in that block. This chance depends on your confirmed balance, ie the nxt you have on your account for more than 1440 blocks. It also depends on all the other forgers confirmed balances. If you get generate new block with fees you can immediately spend these fees, but the fees will have to wait 1440 blocks to count to your confirmed balance.

I think I'm still confused by this part. Say a user wins a block. Would they then be able to also win the next block, or do they have to wait 1440 before they can win another block?
Logged

ThomasVeil

  • Hero Member
  • *****
  • Karma: +183/-11
  • Offline Offline
  • Posts: 1400
    • View Profile
Re: Academic questions regarding PoS and Nxt
« Reply #5 on: July 23, 2015, 06:52:24 pm »

So every block you have a chance that you will write in the block in the blockchain and get the fees from the transactions in that block. This chance depends on your confirmed balance, ie the nxt you have on your account for more than 1440 blocks. It also depends on all the other forgers confirmed balances. If you get generate new block with fees you can immediately spend these fees, but the fees will have to wait 1440 blocks to count to your confirmed balance.

I think I'm still confused by this part. Say a user wins a block. Would they then be able to also win the next block, or do they have to wait 1440 before they can win another block?

"Confirmed Balance" is the balance you can forge with. So if you earn fees they'll have to wait for the 1440 blocks until they're added to the confirmed balance. But your other funds that were used to forge a block can still forge the next block, should you be so lucky.

1440 blocks are roughly one day. So it adds safety, in that no one can just fake one block - give themselves all coins, and then control the chain since they forge all blocks.
Logged
ARDOR-BPV3-837M-QZTQ-9DQ69  oxpal.com

martismartis

  • Hero Member
  • *****
  • Karma: +73/-10
  • Offline Offline
  • Posts: 1238
    • View Profile
Re: Academic questions regarding PoS and Nxt
« Reply #6 on: July 23, 2015, 06:59:40 pm »

So every block you have a chance that you will write in the block in the blockchain and get the fees from the transactions in that block. This chance depends on your confirmed balance, ie the nxt you have on your account for more than 1440 blocks. It also depends on all the other forgers confirmed balances. If you get generate new block with fees you can immediately spend these fees, but the fees will have to wait 1440 blocks to count to your confirmed balance.

I think I'm still confused by this part. Say a user wins a block. Would they then be able to also win the next block, or do they have to wait 1440 before they can win another block?

"Confirmed Balance" is the balance you can forge with. So if you earn fees they'll have to wait for the 1440 blocks until they're added to the confirmed balance. But your other funds that were used to forge a block can still forge the next block, should you be so lucky.

1440 blocks are roughly one day. So it adds safety, in that no one can just fake one block - give themselves all coins, and then control the chain since they forge all blocks.

In other words, only 1440 blocks old NXT are forging. If you have 1M of 1440 blocks old nxt and forge a block, you don't need to wait another 1440 blocks to forge next block, because your nxt are already old enough :)
Logged

lmatteis

  • Newbie
  • *
  • Karma: +3/-0
  • Offline Offline
  • Posts: 4
    • View Profile
Re: Academic questions regarding PoS and Nxt
« Reply #7 on: July 23, 2015, 08:19:49 pm »

So every block you have a chance that you will write in the block in the blockchain and get the fees from the transactions in that block. This chance depends on your confirmed balance, ie the nxt you have on your account for more than 1440 blocks. It also depends on all the other forgers confirmed balances. If you get generate new block with fees you can immediately spend these fees, but the fees will have to wait 1440 blocks to count to your confirmed balance.

I think I'm still confused by this part. Say a user wins a block. Would they then be able to also win the next block, or do they have to wait 1440 before they can win another block?

"Confirmed Balance" is the balance you can forge with. So if you earn fees they'll have to wait for the 1440 blocks until they're added to the confirmed balance. But your other funds that were used to forge a block can still forge the next block, should you be so lucky.

1440 blocks are roughly one day. So it adds safety, in that no one can just fake one block - give themselves all coins, and then control the chain since they forge all blocks.

My concern is that someone could still broadcast a chain different from the current one being accepted (say, different in the last ~20 blocks). An attacker could just forge the last ~20 blocks and pretend he was the only active user at that time, and therefore was the only one who could forge such blocks. What's preventing this from happening?
Logged

Riker

  • Core Dev
  • Hero Member
  • *****
  • Karma: +439/-42
  • Offline Offline
  • Posts: 1796
    • View Profile
Re: Academic questions regarding PoS and Nxt
« Reply #8 on: July 23, 2015, 08:45:31 pm »

Risking answering a superficial answer, its sufficient to say that other peers will reject this 20 blocks chain since they can calculate that the forger forged the blocks before its due time.
This is explained in many places, but in a nutshell, each forger is calculating a target number composed of a sha256 of the concatenation of its passphrase and the last block signature, this hash is converted to a number and multiplied by the forger's stake. This calculation is compared to the current "target" value which determines the time this forger has to wait before forging the next block, thus preventing it from forging many blocks in a row. Each node validates this calculation before accepting a block.
Logged
NXT Core Dev
Account: NXT-HBFW-X8TE-WXPW-DZFAG
Public Key: D8311651 Key fingerprint: 0560 443B 035C EE08 0EC0  D2DD 275E 94A7 D831 1651

lmatteis

  • Newbie
  • *
  • Karma: +3/-0
  • Offline Offline
  • Posts: 4
    • View Profile
Re: Academic questions regarding PoS and Nxt
« Reply #9 on: July 23, 2015, 09:10:25 pm »

Risking answering a superficial answer, its sufficient to say that other peers will reject this 20 blocks chain since they can calculate that the forger forged the blocks before its due time.
This is explained in many places, but in a nutshell, each forger is calculating a target number composed of a sha256 of the concatenation of its passphrase and the last block signature, this hash is converted to a number and multiplied by the forger's stake. This calculation is compared to the current "target" value which determines the time this forger has to wait before forging the next block, thus preventing it from forging many blocks in a row. Each node validates this calculation before accepting a block.

Hrm but I mean, couldn't the forger simply simulate the time difference that would then allow other peers to accept it?
Logged

Riker

  • Core Dev
  • Hero Member
  • *****
  • Karma: +439/-42
  • Offline Offline
  • Posts: 1796
    • View Profile
Re: Academic questions regarding PoS and Nxt
« Reply #10 on: July 23, 2015, 09:24:51 pm »

Risking answering a superficial answer, its sufficient to say that other peers will reject this 20 blocks chain since they can calculate that the forger forged the blocks before its due time.
This is explained in many places, but in a nutshell, each forger is calculating a target number composed of a sha256 of the concatenation of its passphrase and the last block signature, this hash is converted to a number and multiplied by the forger's stake. This calculation is compared to the current "target" value which determines the time this forger has to wait before forging the next block, thus preventing it from forging many blocks in a row. Each node validates this calculation before accepting a block.

Hrm but I mean, couldn't the forger simply simulate the time difference that would then allow other peers to accept it?

I don't think so, since peers won't accept blocks which their time stamp is in the future.
Logged
NXT Core Dev
Account: NXT-HBFW-X8TE-WXPW-DZFAG
Public Key: D8311651 Key fingerprint: 0560 443B 035C EE08 0EC0  D2DD 275E 94A7 D831 1651

ThomasVeil

  • Hero Member
  • *****
  • Karma: +183/-11
  • Offline Offline
  • Posts: 1400
    • View Profile
Re: Academic questions regarding PoS and Nxt
« Reply #11 on: July 24, 2015, 09:25:35 am »

Maybe answering from another angle than lyaffe (he can correct me if I'm wrong :)): Surely the other nodes check the forged blocks they get. So they won't just accept a different chain with different blocks than they already have. They can also check the time that has passed - because that comes from the last hash, so is verifiable with the blockchain. Meaning you can't just squeeze in more blocks than there should be. And neither will nodes accept blocks with some magical transactions. You would just end up on your own fork.

The only node you could potentially fool is a new one coming into the network: You would present your fake chain, and somehow have to block off access to the other nodes/chains, so that yours is accepted. We had some discussions about that one - and the consensus was that it would need NSA kind of skills to isolate a node like that - and your effect would be limited to that node.
Logged
ARDOR-BPV3-837M-QZTQ-9DQ69  oxpal.com

monsterer

  • Full Member
  • ***
  • Karma: +18/-2
  • Offline Offline
  • Posts: 175
    • View Profile
Re: Academic questions regarding PoS and Nxt
« Reply #12 on: September 10, 2015, 09:32:53 am »

Risking answering a superficial answer, its sufficient to say that other peers will reject this 20 blocks chain since they can calculate that the forger forged the blocks before its due time.
This is explained in many places, but in a nutshell, each forger is calculating a target number composed of a sha256 of the concatenation of its passphrase and the last block signature, this hash is converted to a number and multiplied by the forger's stake. This calculation is compared to the current "target" value which determines the time this forger has to wait before forging the next block, thus preventing it from forging many blocks in a row. Each node validates this calculation before accepting a block.

Hrm but I mean, couldn't the forger simply simulate the time difference that would then allow other peers to accept it?

I don't think so, since peers won't accept blocks which their time stamp is in the future.

Reopening an old thread...

How far in the future/past? P2P time stamps are inherently unreliable - bitcoin has something like an 11 minute window on acceptable block timestamps.
Logged
https://metaexchange.info/
NXT<->BTC instant exchange - low spread, no registration

bcdev

  • Hero Member
  • *****
  • Karma: +162/-22
  • Offline Offline
  • Posts: 666
    • View Profile
Re: Academic questions regarding PoS and Nxt
« Reply #13 on: September 10, 2015, 08:45:26 pm »

How far in the future/past?
Code: [Select]
Constants.java:
        public static final int MAX_TIMEDRIFT = 15; // allow up to 15 s clock difference

BlockchainProcessorImpl.java:
        if (block.getTimestamp() > curTime + Constants.MAX_TIMEDRIFT) {
            Logger.logWarningMessage("Received block " + block.getStringId() + " from the future, block timestamp is " + block.getTimestamp()
                    + ", current time is " + curTime + ", system clock may be off");             
            throw new BlockOutOfOrderException("Invalid timestamp: " + block.getTimestamp()     
                    + " current time is " + curTime, block);                                     
        }   
15 seconds into the future. Into the past it's of course infinite, because you have to be able to synchronize after being offline.
P2P time stamps are inherently unreliable
Every Ubuntu has NTP client installed by default. If someone's time is off, he'll have problems, the rest of the network will still work.
« Last Edit: September 10, 2015, 08:49:04 pm by bcdev »
Logged
 

elective-stereophonic
elective-stereophonic
assembly
assembly