<p>Linking to the discussion on the NXT forum <a href="https://nxtforum.org/general-discussion/academic-questions-regarding-pos-and-nxt" rel="nofollow">https://nxtforum.org/general-discussion/academic-questions-regarding-pos-and-nxt</a></p>

CC BY-SA 3.0
2015-07-25T06:26:49.373Z
2015-07-25T06:26:49.373Z
lyaffe
<p>As you know from your <a href="https://bitcoin.stackexchange.com/questions/38724/how-is-the-next-forger-decided-in-nxt/38730?noredirect=1#comment45486_38730">previous question</a>, a node is entitled to forge a block and submit it to the network when</p>

<p>hit &lt; BaseTarget * EffectiveBalance * TimeSinceLastBlock</p>

<p>where new hit and BaseTarget values are computed from the last block, the hit value being effectively random and the BaseTarget being adjusted to maintain a steady blockchain growth rate of about one new block per minute. </p>

<p>All nodes running the NRS (Nxt Reference Software) use the same formulas to compute these values, and therefore if all of those nodes are on the same fork of the blockchain they will all agree on what the values are. Any new block received from another node is checked to make sure that the rule above was followed. If not, the block is rejected.</p>

<p>It is possible for the blockchain to fork, even when all nodes follow the rules, due to several nodes becoming eligible to forge at about the same time combined with network delays. Or, a subset of nodes could become isolated from the main network for a time.</p>

<p>Once a fork occurs, the competing blockchains will have different tails and all the blocks that make up the tails will have different hit and BaseTarget values. All nodes running NRS will chose the blockchain with the greatest cummulative difficulty, where </p>

<p>cumulativeDifficulty = cumulativeDifficultyOfPreviousBlock + (2^64 / BaseTarget)</p>

<p>cumulativeDifficulty grows with each new block, moreso when BaseTarget is small (more difficult to get a hit).</p>

<p>If a subset of nodes is isolated for a time, those nodes will continue to forge; but because they have a smaller combined balance, initially forging takes longer. BaseTarget will adjust larger to shorten the time between blocks, and thus cumulativeDifficulty will not grow as fast. </p>

<p>When this subset of nodes reconnects with the main network, its fork of the blockchain is considered by the main network (if less than 1440 blocks have been forged during the isolation). But because the main network has a greater combined balance, it will have a greater cumulativeDifficulty and therefore reject the competing blockchain. Likewise, the subset of nodes will consider the main fork and accept it unless more than 1440 blocks have been added on their fork, in which case a blockchain rollback or a fresh blockchain download is required.</p>

<p>This is how consensus is achieved on the network: it is governed by the nodes that have the greatest combined balance.</p>

CC BY-SA 3.0
2015-07-28T18:59:58.223Z
Thanks but you didn't address my concern with "active accounts". Only users that are online can forge. What if nobody is online expect me? I will be the only winner and I will forge a block, right? What's stopping others to accept such block?
Luca Matteis
CC BY-SA 3.0
2015-07-29T21:06:10.790Z
It is very unlikely that no one else will be online, because the big holders of NXT know that their participation is important to protect their investment. But if they did leave for long enough for you to forge a block and then return, they might accept your block if it is correctly forged, but it will be in competition with blocks immediately forged by returning nodes. A fork will likely occur and be resolved by cumulativeDifficulty. If the block you forged did not follow the rules, it will be rejected for that reason, so I don't know what you mean by "easily faked."
mystcoin
CC BY-SA 3.0
2015-07-26T07:58:18.450Z
2015-07-26T07:58:18.450Z
2017-04-13T12:47:34.187Z
mystcoin
<p>From what I understand, in Nxt, blocks are mined (or forged) using a system based on Proof-of-Stake where block creation works similarly to a lottery: people have tickets, and the more tickets you have, the greater the chances of winning and therefore forging a block. Tickets in Nxt are just coins you own in the system.</p>

<p>What I don't understand is that for each block creation, the winner is found from a pool of "active accounts" which so happens to be people that are online at that moment. Based on specific things (like how many coins one has), the winner is then found. My concern is that someone can forge a new block without caring about the "active accounts", he sort of pretends that nobody else is online. So he'll mine it for sure, as he's the only one, and then he'll broadcast it. He keeps doing this for the next blocks and so on.</p>

<p>What's stopping other peers from accepting his chain?</p>

<nxt><proof-of-stake><forging>
How does Nxt agree on a chain when "active accounts" can be easily faked?
Luca Matteis
# How does Nxt agree on a chain when "active accounts" can be easily faked?

(Asked by: username_0 on 2015-07-23)

From what I understand, in Nxt, blocks are mined (or forged) using a system based on Proof-of-Stake where block creation works similarly to a lottery: people have tickets, and the more tickets you have, the greater the chances of winning and therefore forging a block. Tickets in Nxt are just coins you own in the system.

What I don't understand is that for each block creation, the winner is found from a pool of "active accounts" which so happens to be people that are online at that moment. Based on specific things (like how many coins one has), the winner is then found. My concern is that someone can forge a new block without caring about the "active accounts", he sort of pretends that nobody else is online. So he'll mine it for sure, as he's the only one, and then he'll broadcast it. He keeps doing this for the next blocks and so on.

What's stopping other peers from accepting his chain?

**Tags:** nxt, proof-of-stake, forging


---

## 2 answers

### Answer by username_1 on 2015-07-25. Score: 2

Linking to the discussion on the NXT forum <https://nxtforum.org/general-discussion/academic-questions-regarding-pos-and-nxt>


---

### Answer by username_2 on 2015-07-26. Score: 1

As you know from your [previous question](https://bitcoin.stackexchange.com/questions/38724/how-is-the-next-forger-decided-in-nxt/38730?noredirect=1#comment45486_38730), a node is entitled to forge a block and submit it to the network when

hit < BaseTarget \* EffectiveBalance \* TimeSinceLastBlock

where new hit and BaseTarget values are computed from the last block, the hit value being effectively random and the BaseTarget being adjusted to maintain a steady blockchain growth rate of about one new block per minute.

All nodes running the NRS (Nxt Reference Software) use the same formulas to compute these values, and therefore if all of those nodes are on the same fork of the blockchain they will all agree on what the values are. Any new block received from another node is checked to make sure that the rule above was followed. If not, the block is rejected.

It is possible for the blockchain to fork, even when all nodes follow the rules, due to several nodes becoming eligible to forge at about the same time combined with network delays. Or, a subset of nodes could become isolated from the main network for a time.

Once a fork occurs, the competing blockchains will have different tails and all the blocks that make up the tails will have different hit and BaseTarget values. All nodes running NRS will chose the blockchain with the greatest cummulative difficulty, where

cumulativeDifficulty = cumulativeDifficultyOfPreviousBlock + (2^64 / BaseTarget)

cumulativeDifficulty grows with each new block, moreso when BaseTarget is small (more difficult to get a hit).

If a subset of nodes is isolated for a time, those nodes will continue to forge; but because they have a smaller combined balance, initially forging takes longer. BaseTarget will adjust larger to shorten the time between blocks, and thus cumulativeDifficulty will not grow as fast.

When this subset of nodes reconnects with the main network, its fork of the blockchain is considered by the main network (if less than 1440 blocks have been forged during the isolation). But because the main network has a greater combined balance, it will have a greater cumulativeDifficulty and therefore reject the competing blockchain. Likewise, the subset of nodes will consider the main fork and accept it unless more than 1440 blocks have been added on their fork, in which case a blockchain rollback or a fresh blockchain download is required.

This is how consensus is achieved on the network: it is governed by the nodes that have the greatest combined balance.

> **Comments:**
> **username_0**: Thanks but you didn't address my concern with "active accounts". Only users that are online can forge. What if nobody is online expect me? I will be the only winner and I will forge a block, right? What's stopping others to accept such block?  
> **username_2**: It is very unlikely that no one else will be online, because the big holders of NXT know that their participation is important to protect their investment. But if they did leave for long enough for you to forge a block and then return, they might accept your block if it is correctly forged, but it will be in competition with blocks immediately forged by returning nodes. A fork will likely occur and be resolved by cumulativeDifficulty. If the block you forged did not follow the rules, it will be rejected for that reason, so I don't know what you mean by "easily faked."  

---

