Bitcoin Forum
May 03, 2024, 01:29:15 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Warning: One or more bitcointalk.org users have reported that they believe that the creator of this topic displays some red flags which make them high-risk. (Login to see the detailed trust ratings.) While the bitcointalk.org administration does not verify such claims, you should proceed with extreme caution.
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 [17] 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 »
  Print  
Author Topic: Nxt source code flaw reports  (Read 113306 times)
ImmortAlex
Hero Member
*****
Offline Offline

Activity: 784
Merit: 501


View Profile
January 04, 2014, 06:12:27 PM
 #321

Including any transaction hash into the signature would be quite messy and opens exploits that leave out or generate additinal transactions to influence the signature in their favor.
Yes, if we simple allow to include payload hash to gen sig, we effectively return PoW to Nxt.
1714699755
Hero Member
*
Offline Offline

Posts: 1714699755

View Profile Personal Message (Offline)

Ignore
1714699755
Reply with quote  #2

1714699755
Report to moderator
Bitcoin addresses contain a checksum, so it is very unlikely that mistyping an address will cause you to lose money.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714699755
Hero Member
*
Offline Offline

Posts: 1714699755

View Profile Personal Message (Offline)

Ignore
1714699755
Reply with quote  #2

1714699755
Report to moderator
1714699755
Hero Member
*
Offline Offline

Posts: 1714699755

View Profile Personal Message (Offline)

Ignore
1714699755
Reply with quote  #2

1714699755
Report to moderator
1714699755
Hero Member
*
Offline Offline

Posts: 1714699755

View Profile Personal Message (Offline)

Ignore
1714699755
Reply with quote  #2

1714699755
Report to moderator
Come-from-Beyond (OP)
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
January 04, 2014, 06:15:04 PM
 #322

Could someone please confirm whether either of my two solutions work and whether they are already, in fact, implemented in the latest source code?

Ur approach would transform Nxt into a PoW coin.
Anon136
Legendary
*
Offline Offline

Activity: 1722
Merit: 1217



View Profile
January 04, 2014, 06:18:05 PM
 #323

Now for the interesting 75% part:
You can calculate in advance, which nonce each of your accounts would have and then choose the best one. So statistically speaking, all your accounts are behaving like accounts with your 0.98% stake in them. And you can freely choose between any of the 100.000 accounts in advance, already knowing the nonce. The chance that one of them has a nonce so good that it's better than all the others is extremely high: If you'd (theoretically speaking) combine all of those 100,000 accounts with 0.98% stake each, you have a stake of 98,000 % (yes, I know, that's more than 100%, but that's the whole point of having the prior knowledge Smiley). So the total stake of the currency for that next block becomes 98,000 % (you) + 99.02 % (others) = 98,099.02 %. Which means, you suddenly own nearly 99.9 % of the stake and have the respective chance of forging that block.

So with that methodology, we have a forging chance of 25%*0.98%+75%*99.9% = 75.17 %.

Good catch. Looks like this trick will work if u r the only one who uses this strategy. Will freezing recently moved coins for 1440 blocks solve the issue?

PS: It's not the injected flaw, but still post ur Nxt account for 10K reward plz.

Wait a minute.... another possibly better solution could be for the generation signature to include a hash of the transactions contained in the block.

1) Suppose you've forged the current block B1 with account a1, but have not broadcast it.
2) Next, you compute corresponding generating signature sig(B1).
3) From this, you calculate the subordinate account a2 (one of your 100 pre-generated accounts) that generates the next block B2.
4) However, the transaction to move your NXT stake from a1 -> a2 (so you are able to solve B2) must to be part of B1.
5) So, you need to update the current block C with transaction a1 -> a2 and re-generate the generating sig(B1).
6) However, you've now changed B1, so you need to goto step (3) and repeat the process.

Thus, we have thwarted the adversary with a chicken-or-egg/halting-problem kind of puzzle.

Does this work as a solution?

Maybe a hash of the transactions is already included in the generation signature, in which case there was no issue in the first place.

Also, https://bitcointalk.org/index.php?topic=397183.msg4307553#msg4307553 seems to indicate that my earlier recollection that there is a 1440 block forging penalty for transferred coins is true.

Quote
In essence it works by having the author of the next block be selected by comparing the public key that he is using to hold his stake to the public key of the author of the previous block. In-order to prevent the new block author from simply creating a public key that would win and loading that public key with his stake BTCNext introduced the idea of effective stake. Only stake that has remained stationary for 1440 blocks (24 hours) has the right to author a block. Would be attackers can not calculate 1440 blocks into the future because they have no idea who is going to author the very next block, let alone the next 1440 blocks. Inorder to prevent an attacker from creating a "trap" where if he manages to become lucky enough to author one block in the future than he has prepared a set of funded addresses which would "catch" the subsequent blocks, we don't only rely on the previous block authors signature alone, but build an entirely separate "block chain" which is the result of hashing every public key ever used to author a block.

However, the source code defines getEffectiveBlance() with

Quote
...
         if (Block.getLastBlock().height - height < 1440) {

            return 0;

         }
...
which seems to imply the 1440 penalty is on the account, rather than on the NXT balance.

Could someone please confirm whether either of my two solutions work and whether they are already, in fact, implemented in the latest source code?

I'm not entirely sure that i understand exactly what you are proposing, but while you are quoting my work anyway, i think it may be important to point out this particularly important part

Quote
You see, you can't just hash the previous block and use the digest as the parameter for selecting the winner of the right to author the next block because, the block authors would contrive transactions in that block that digested into a hash that gave him the the right to author the next block. In-fact you cant base it off of a digest of any part of the block that the author has free reign over or you will run into the same problem.

This would include transactions because the block author has the choice of which transactions to include and which not to include.

Rep Thread: https://bitcointalk.org/index.php?topic=381041
If one can not confer upon another a right which he does not himself first possess, by what means does the state derive the right to engage in behaviors from which the public is prohibited?
xibeijan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1001


View Profile
January 04, 2014, 06:37:26 PM
 #324


Ok people... take a break from all the advanced thoughts... and help us coding-challenged people for a sec.!    Cheesy


Can someone please point to the exact lines in the code where it is established that empty accounts cannot forge?

Is the Genesis account is excluded from forging?  What is the condition set for accounts with negative balance?


Just wondering what happens if someone unlocks the Genesis account... in respect to the code under examination, of course.


thnx   Wink

The genesis account has a negative balance (because it created the currency supply from a zero balance I suppose).  Peers do not allow accounts with negative balances to transmit NXT.  Makes sense to me.

Notable projects 2019: Semux, Dero, Wagerr, BEAM
xibeijan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1001


View Profile
January 04, 2014, 06:40:44 PM
 #325

Could someone please confirm whether either of my two solutions work and whether they are already, in fact, implemented in the latest source code?

Ur approach would transform Nxt into a PoW coin.

There are two solutions.  The first would not convert it to a PoW coin.

The second, again, would not, but it would do away with transparent forging; a sensible thing to do if it's insecure.  Maybe that's what you mean?

Notable projects 2019: Semux, Dero, Wagerr, BEAM
theKnownUnknown
Newbie
*
Offline Offline

Activity: 16
Merit: 0


View Profile
January 04, 2014, 06:42:36 PM
 #326

I am new to cryptocurrencies, so please excuse my noob question:

What happens if two distinct nodes forge the same block at the same time (assume both are allowed to, though both blocks are valid)?
Come-from-Beyond (OP)
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
January 04, 2014, 06:44:26 PM
 #327

Could someone please confirm whether either of my two solutions work and whether they are already, in fact, implemented in the latest source code?

Ur approach would transform Nxt into a PoW coin.

There are two solutions.  The first would not convert it to a PoW coin.

The second, again, would not, but it would do away with transparent forging; a sensible thing to do if it's insecure.  Maybe that's what you mean?

Ah, I overlooked that u proposed 2 solutions.
Come-from-Beyond (OP)
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
January 04, 2014, 06:45:36 PM
 #328

I am new to cryptocurrencies, so please excuse my noob question:

What happens if two distinct nodes forge the same block at the same time (assume both are allowed to, though both blocks are valid)?

They'll create a fork in a chain of predictions, which is a good thing. This is why block timestamps r seconds, not milliseconds.
theKnownUnknown
Newbie
*
Offline Offline

Activity: 16
Merit: 0


View Profile
January 04, 2014, 06:48:50 PM
 #329

I am new to cryptocurrencies, so please excuse my noob question:

What happens if two distinct nodes forge the same block at the same time (assume both are allowed to, though both blocks are valid)?

They'll create a fork in a chain of predictions, which is a good thing. This is why block timestamps r seconds, not milliseconds.

And who gets the fees?
xibeijan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1001


View Profile
January 04, 2014, 06:49:16 PM
 #330


Could someone please confirm whether either of my two solutions work and whether they are already, in fact, implemented in the latest source code?

I'm not entirely sure that i understand exactly what you are proposing, but while you are quoting my work anyway, i think it may be important to point out this particularly important part

I think the answer to your next question will make it clear.

Quote
You see, you can't just hash the previous block and use the digest as the parameter for selecting the winner of the right to author the next block because, the block authors would contrive transactions in that block that digested into a hash that gave him the the right to author the next block. In-fact you cant base it off of a digest of any part of the block that the author has free reign over or you will run into the same problem.

This would include transactions because the block author has the choice of which transactions to include and which not to include.

I don't say to base it only on the transactions, but to include the transactions as part of the input.  Including the transactions as part of the gen sig would help prevent the security issue proposed by dicot.

But maybe there's something I don't understand about it, which would not be surprising given there's no formal account or whitepaper.

Notable projects 2019: Semux, Dero, Wagerr, BEAM
Come-from-Beyond (OP)
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
January 04, 2014, 06:51:11 PM
 #331

And who gets the fees?

This will be determined by the next block.
theKnownUnknown
Newbie
*
Offline Offline

Activity: 16
Merit: 0


View Profile
January 04, 2014, 07:03:50 PM
 #332

And who gets the fees?

This will be determined by the next block.

And how gets the forked chain joined together again?
Come-from-Beyond (OP)
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
January 04, 2014, 07:14:16 PM
 #333

And who gets the fees?

This will be determined by the next block.

And how gets the forked chain joined together again?

Nodes will see a longer branch and orphane one of the blocks.
ricot
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
January 04, 2014, 07:16:46 PM
 #334

And who gets the fees?

This will be determined by the next block.

And how gets the forked chain joined together again?

It doesn't.

One of the two blocks will have a better cumulative difficulty (comparable to a nonce in BTC) and will "win". So the worse block becomes an orphan and every client just builds on the better block.
This process hsould happen quite often because of network latency and such.
xibeijan
Legendary
*
Offline Offline

Activity: 1232
Merit: 1001


View Profile
January 04, 2014, 07:18:41 PM
 #335

Peers do not allow accounts with negative balances to transmit NXT.  Makes sense to me.

Yes... but peers can transmit NXT to the Genesis account... thus destroying those NXT.

That would have been a nice flaw to plant for us!  Wink

Allowing the Genesis to forge... destorying every single NXT when generating a block!!!   Grin

I don't think the genesis account can ever forge, since it's max balance will be zero (if everyone sent their NXT there to be destroyed).

Generally, I think that keeping the genesis account around in this way is a good feature.  It's a way for NXT to be destroyed, decreasing the money supply, if desired.  It's completely up to users if they want to send they NXT there for destruction.  In contrast, I'm not sure forgetting/losing your brainwallet password counts as destroyed money.

Notable projects 2019: Semux, Dero, Wagerr, BEAM
ricot
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
January 04, 2014, 07:27:45 PM
Last edit: January 04, 2014, 07:59:03 PM by ricot
 #336

I just found something else which is at least an inefficiency in the network and could potentially be exploited...

I looked at the cumulative difficulty checks.
When actively querying peers for blocks, the checks seem ok (except for that 720 block issue that we already discussed).
However, when I myself forged a block, I'll call the processBlock methods of my peers to get it into the network.
processBlock doesn't check cumulative difficulty, it just checks if it's the next block (i.e. newBlock.previousBlock == lastBlock).
So if it gets a worse block first, it will ignore the better block coming from me.
This, combined with the "we accept blocks that are 15 seconds into the future" can be exploited:
Say Anna can generate a block that is valid in 15 seconds. She immediately sends it to all peers, which accept that block, obviously.
Poor Bob can generate a block that is valid in 10 seconds, but waits until that time to send out that block.
Now all the peers that Bob sends his superior block to will just ignore it, if they have Anna's block and the only way for Bob to publish his block is to be asked by peers for blocks.
So sending blocks before there's time seems to increase forging chances... I think...

[edit]
Totally forgot to write the solution Wink
Check the cumulative difficulty in a way similar to actively getting blocks from a peer in the passive case. Wink

[edit2]
And here is the attack and the results:
Anna keeps spamming all the peers she knows with her blocks. She probably gets blacklisted by all her peers, but fortunately processBlock doesn't care about that. (slight hint at another thing you might want to fix: the blacklisting isn't checked in a lot of cases)
So Anna will get a block that shouldn't have belonged to her iff:
- her chance to forge that block is at most 15 seconds past the chance of the real block
- the forger of the real block (Bob) sits behind a firewall, so that he can't receive calls from his peers querying him for blocks
- Anna manages to send her block to all of Bob's peers before he does

So it definately increases Anna's chances and the methodology also spams the network. Neither is something you want to have. Smiley
To figure out by how much Anna's chances are increased, we'd need to estimate the ratio of blocks forged behind firewalls,
let's say, that's 30%. (I've got no clue about the real number, so feel free to replace it with anything you want)
Anna has a chance to forge 15 seconds longer, at an average 60 second forge duration. This means a 1.25x increase in chance of block generation. Combined with the 30% chance of the other block being forged behind a firewall, Anna can increase her forging chances by 7.5%.
Not much, but definately enough to start spamming the network. Wink
theKnownUnknown
Newbie
*
Offline Offline

Activity: 16
Merit: 0


View Profile
January 04, 2014, 07:33:20 PM
 #337

And who gets the fees?

This will be determined by the next block.

And how gets the forked chain joined together again?

It doesn't.

One of the two blocks will have a better cumulative difficulty (comparable to a nonce in BTC) and will "win". So the worse block becomes an orphan and every client just builds on the better block.
This process hsould happen quite often because of network latency and such.

Ah, now I found it in the code. cumulative difficulty was the buzzword I needed. Thanks a lot Come-from-Beyond and  ricot.
gbeirn
Full Member
***
Offline Offline

Activity: 126
Merit: 100


View Profile
January 04, 2014, 08:01:15 PM
 #338

So, the fee is constant in USD.  What do you think the fee in USD should be?

Stakeholders decide.

UNTIE THE FEE FROM FIAT!!!

I think it should be done on a curve, starting with a base percentage of the NXT being transferred and curving down in percentage as the transaction amount increases.  As far as the specific curve, I dont know.  I dont like the fee being tied to any specific fiat at all.

Do to this we would have to reserve the very last few decimal places for fees though.

So for example,
And I am by no means proposing use of these particular numbers (I am just using these particular ones for ease of explanation) dividing NXT down to 8 decimal places, the last 3 would only be used for fees, meaning the smallest amount of NXT that can be transferred is to 5 decimal places, or .00001.
So now, to transfer .00001 NXT (which is the smallest amount that could be transferred in this particular scheme) would cost a fee of, lets say 0.005%  So the total transferred in this case would be .00001005 and I would also suggest a curve to be used to decrease the fee as the amount to be transferred is increased.  

This removes all ties to fiat, which I think should be the goal

In theory, this sounds like a good idea but the problem is transactional/account spam.  This makes it easy to buy 10 Nxt and send near 1,000,000 transactions to random accounts.  With a fee that is set at 1 Nxt, you're not going to be able to spam the network for long which is the current setup.

Instead, I recommend an analytical system implemented that monitors the amount and value of daily transactions and then sets a new minimum fee value that changes day-to-day (or on some other period.)  You can do this using some basic statistics AND you can also use statistics to trim odd, edge-cases on the rare days that "whales" move around 10,000,000 coins.

PS- I've been following/working with Microcash for years.  My last post regarding the development of Microcash was on scaling the amount of distributed, new coins that were generated each day.  

I know that this is about fees and not generating currency, but the concept of adjusting system metrics, based off daily transactional statistics is something I've looked at and thought about for a loooooong time.  I think we could do the same type of thing here.

I suggested a similar approach in the other main thread when people wanted to change the fee to a fiat based number. Basically a 'difficulty based' adjustment like in the other cryptocoins but for the transaction fee.

Edit: I would love to share ideas with you. Feel free to PM me if we shouldn't clutter up this thread with that. (Unless that's OK).

NXT VPS Server Donations can be sent here: 6044921191674841550
At the end of each month I will donate some of them back to the community.
This is separate from my main wallet so you can keep track of them. I will keep them in there and only use them for hosting.
opticalcarrier
Full Member
***
Offline Offline

Activity: 238
Merit: 100



View Profile
January 04, 2014, 08:07:35 PM
 #339

Ok people... take a break from all the advanced thoughts... and help us coding-challenged people for a sec.!    Cheesy


Can someone please point to the exact lines in the code where it is established that empty accounts cannot forge.

Is the Genesis account excluded from forging?  What is the forging conditions set for an account with negative balance?


Just wondering what happens if someone unlocks the Genesis account... in respect to the code under examination, of course.


thnx   Wink

 Shocked if someone unllocks genesis account, could they send negative NXT to everone to reduce everyone's balance to zero?
ricot
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
January 04, 2014, 08:08:52 PM
 #340

Ok people... take a break from all the advanced thoughts... and help us coding-challenged people for a sec.!    Cheesy


Can someone please point to the exact lines in the code where it is established that empty accounts cannot forge.

Is the Genesis account excluded from forging?  What is the forging conditions set for an account with negative balance?


Just wondering what happens if someone unlocks the Genesis account... in respect to the code under examination, of course.


thnx   Wink

 Shocked if someone unllocks genesis account, could they send negative NXT to everone to reduce everyone's balance to zero?

No, the transaction amount as well as the sender's balance have to be positive. Neither is the case in your apocalyptic scenario. Wink
Pages: « 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 [17] 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 »
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!