Pages:
Author

Topic: Nxt source code flaw reports - page 49. (Read 113359 times)

newbie
Activity: 56
Merit: 0
January 04, 2014, 04:08:52 PM
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
full member
Activity: 238
Merit: 100
January 04, 2014, 04:07:35 PM
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?
full member
Activity: 126
Merit: 100
January 04, 2014, 04:01:15 PM
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).
newbie
Activity: 16
Merit: 0
January 04, 2014, 03:33:20 PM
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.
newbie
Activity: 56
Merit: 0
January 04, 2014, 03:27:45 PM
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
legendary
Activity: 1232
Merit: 1001
January 04, 2014, 03:18:41 PM
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.
newbie
Activity: 56
Merit: 0
January 04, 2014, 03:16:46 PM
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.
legendary
Activity: 2142
Merit: 1009
Newbie
January 04, 2014, 03:14:16 PM
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.
newbie
Activity: 16
Merit: 0
January 04, 2014, 03:03:50 PM
And who gets the fees?

This will be determined by the next block.

And how gets the forked chain joined together again?
legendary
Activity: 2142
Merit: 1009
Newbie
January 04, 2014, 02:51:11 PM
And who gets the fees?

This will be determined by the next block.
legendary
Activity: 1232
Merit: 1001
January 04, 2014, 02:49:16 PM

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.
newbie
Activity: 16
Merit: 0
January 04, 2014, 02:48:50 PM
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?
legendary
Activity: 2142
Merit: 1009
Newbie
January 04, 2014, 02:45:36 PM
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.
legendary
Activity: 2142
Merit: 1009
Newbie
January 04, 2014, 02:44:26 PM
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.
newbie
Activity: 16
Merit: 0
January 04, 2014, 02:42:36 PM
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)?
legendary
Activity: 1232
Merit: 1001
January 04, 2014, 02:40:44 PM
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?
legendary
Activity: 1232
Merit: 1001
January 04, 2014, 02:37:26 PM

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.
legendary
Activity: 1722
Merit: 1217
January 04, 2014, 02:18:05 PM
legendary
Activity: 2142
Merit: 1009
Newbie
January 04, 2014, 02:15:04 PM
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.
hero member
Activity: 784
Merit: 501
January 04, 2014, 02:12:27 PM
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.
Pages:
Jump to: