Bitcoin Forum
April 28, 2024, 03:34:58 PM *
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)
salsacz
Hero Member
*****
Offline Offline

Activity: 490
Merit: 504


View Profile
January 09, 2014, 11:49:46 PM
 #801

Jean-Luc writes english with french syntax, like many french speaking native people (I am). I'm confident that his mother tongue is probably french with very high probability. It is not the case with CfB. I do not see french syntax in CfB writing. That is my analysis. Maybe I'm wrong, but...

And what about BCNext's style?

Relative to BCNExt, I don't know. I believe he is not english native, Im pretty sure of that. I did not see any clear french syntax in his writing like in Jean-Luc post. Note that I know Jean-Luc refer to Star Trek, but I still believe he might be french native, but maybe other latin base language have similar syntax to french, so my interpretation might be wrong. I know that english is not latin based. Here are some latin based language: Portuguese, Spanish, French, Italian and Romanian. There are others.

By the way, keep up the good work, what you all are doing is amazing. Really!

BCNext lives in European time:
https://bitcointalk.org/index.php?action=profile;u=152600;sa=statPanel

Once he also mentioned someting about Beyonce, that he has got some Russian holidays
1714318498
Hero Member
*
Offline Offline

Posts: 1714318498

View Profile Personal Message (Offline)

Ignore
1714318498
Reply with quote  #2

1714318498
Report to moderator
1714318498
Hero Member
*
Offline Offline

Posts: 1714318498

View Profile Personal Message (Offline)

Ignore
1714318498
Reply with quote  #2

1714318498
Report to moderator
1714318498
Hero Member
*
Offline Offline

Posts: 1714318498

View Profile Personal Message (Offline)

Ignore
1714318498
Reply with quote  #2

1714318498
Report to moderator
The Bitcoin software, network, and concept is called "Bitcoin" with a capitalized "B". Bitcoin currency units are called "bitcoins" with a lowercase "b" -- this is often abbreviated BTC.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714318498
Hero Member
*
Offline Offline

Posts: 1714318498

View Profile Personal Message (Offline)

Ignore
1714318498
Reply with quote  #2

1714318498
Report to moderator
minusbalancer
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
January 10, 2014, 12:39:13 AM
 #802

The whole "futureBlocks" branch of code doesn't work because of the bug.

We should update the commonBlockId once we successfully push the block.
If we will have the "futureBlocks" it will roll out all of the newly added blocks (if any) because of non updated currentBlockId.
Then it will try to add the "futureBlocks" and will fail again. So at the end the whole block chain will be rolled back and peer banned.

It's at line 4570 and further.


Thx, I'll look at that.

I disagree. I don't think it's wrong. I think these situations are simply exclusive. That is, there can't be both: new blocks added and futureBlocks added.
(I was claiming this here: https://bitcointalk.org/index.php?topic=397183.msg4406466#msg4406466)

Imagine you do have the following sequences of blocks returned: b1, b2, b4, b3

All of the blocks are valid and aren't damaged. Existing code won't process this sequence. However adding just 1 line (updating currentBlockId) will make the code work like it was planned.
Jaguar0625
Sr. Member
****
Offline Offline

Activity: 299
Merit: 250


View Profile
January 10, 2014, 12:44:11 AM
 #803

I've also been looking closely at the thread that synchs blocks across peers.

Let me use this format to identify blocks (previous block id, current block id, difficulty). And, in each case, let's assume that 2 NXT nodes are active. Here's what I think is happening

--- SCENARIO 1 ---
A: { (0, 1, 1), (1, 2, 2), (2, 3, 3) }
B: { (0, 1, 1), (1, 2, 2), (2, 3, 3), (3, 3, 4), (4, 4, 5) }

In this case the syncing is straightforward (assuming that the blocks are ordered), because B(3, 3, 4), B(4, 4, 5) will connect to A(2, 2, 3).

--- SCENARIO 2 ---
A: { (0, 1, 1), (1, 2, 2), (2, 3, 3) }
B: { (0, 1, 1), (1, 2, 2), (2, 4, 4), (4, 4, 5), (5, 5, 6) }

In this case, the syncing is a little tricker but still ok. B(2, 4, 4), B(4, 4, 5), B(5, 5, 6) are all added to future blocks. Eventually they are chained to A(1, 2, 2) and A(2, 3, 3) is dropped because the final block in the B chain has a greater difficulty than the final block in the B chain.

--- SCENARIO 3 ---
A: { (0, 1, 1), (1, 2, 2), (2, 3, 3) }
B: { (0, 1, 1), (1, 2, 2), (2, 3, 3), (1, 2, 10) }

In this case, let's say B is malicious and wants to replace A(1, 2, 2) with a different block. In this case, B(1, 2, 10) does not chain to the last block in A so it is put in as a future block. The two possible chains for A are:
A.1: { (0, 1, 1), (1, 2, 2), (2, 3, 3) }
A.2: { (0, 1, 1), (1, 2, 10) }

Since A.2 has a higher difficulty, it will be chosen. As far as I can tell, I don't see anything preventing a malicious attacker from manipulating cumulative difficulty scores in order to get blocks dropped.

This would also work if B was manipulated to have both new chaining blocks and future blocks, e.g.
B: { (0, 1, 1), (1, 2, 2), (2, 3, 3), (3, 4, 4), (1, 2, 10) }

In effect, this would keep transactions (B(3, 4, 4) in the example completely hidden from A.

Or am I missing something?

NEM - nem.io
Jaguar0625
Sr. Member
****
Offline Offline

Activity: 299
Merit: 250


View Profile
January 10, 2014, 12:46:23 AM
 #804

I think we could have better/faster implementation of Curve25519, but it's something that shoulbe further researched

Btw, we have 100'000 NXT bounty for fast JS-implementation. Look at https://bitcointalk.org/index.php?topic=345619.msg4345122#msg4345122 plz.

I also created a separate thread on this in case any one wanted to collaborate, but so far no takers :/.

NEM - nem.io
gimre
Legendary
*
Offline Offline

Activity: 866
Merit: 1002



View Profile WWW
January 10, 2014, 01:05:37 AM
 #805

Imagine you do have the following sequences of blocks returned: b1, b2, b4, b3

All of the blocks are valid and aren't damaged. Existing code won't process this sequence. However adding just 1 line (updating currentBlockId) will make the code work like it was planned.

returned from WHERE?

I assume you were reffering to commonBlockId not currentBlockId

They will either be added after commonBlockId or, if there was a split, proper block will be removed and they will be added AFTER popped blocks.

So I still don't see a problem

NemusExMāchinā
Catapult docs: https://docs.symbol.dev
github: https://github.com/symbol
gimre
Legendary
*
Offline Offline

Activity: 866
Merit: 1002



View Profile WWW
January 10, 2014, 01:35:01 AM
 #806


In this case, let's say B is malicious and wants to replace A(1, 2, 2) with a different block. In this case, B(1, 2, 10) does not chain to the last block in A so it is put in as a future block. The two possible chains for A are:
A.1: { (0, 1, 1), (1, 2, 2), (2, 3, 3) }
A.2: { (0, 1, 1), (1, 2, 10) }

Since A.2 has a higher difficulty, it will be chosen. As far as I can tell, I don't see anything preventing a malicious attacker from manipulating cumulative difficulty scores in order to get blocks dropped.

Maybe I haven't slept enough, but I think you're right, but...

This would imply two things:
  • He would have to be generator of (1,2,10) - ok he can predict that
  • but he would also have to be generator of (1,2,2) (coz verify generation signature would't pass)

so basically he would invalidate his own block...

This would also work if B was manipulated to have both new chaining blocks and future blocks, e.g.
B: { (0, 1, 1), (1, 2, 2), (2, 3, 3), (3, 4, 4), (1, 2, 10) }

In effect, this would keep transactions (B(3, 4, 4) in the example completely hidden from A.

Or am I missing something?

I think this is good example, that those situations (adding to end of chain AND invalidating tail of chain) are (or rather should, as they are not now)
mutually exclusive cases...

NemusExMāchinā
Catapult docs: https://docs.symbol.dev
github: https://github.com/symbol
bithic
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
January 10, 2014, 02:53:09 AM
 #807

Hello, I just came to this thread today. I'm a Java developer, but quite new to crypto and haven't had time to delve into source code yet. This is a good opportunity to start educating myself on the nuts and bolts, so I'm going to dive in. You probably won't hear from me unless I unearth something that might be useful, but I just want to say hi and congratulate you all on the great work that's happening here.
Come-from-Beyond (OP)
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
January 10, 2014, 05:12:41 AM
 #808

Agree.
Then we do have the other bug - outgoing transactions are not deducted from the "genesis" created accounts while calculating the effective balance.

Edit: incoming


It's by design.
Jaguar0625
Sr. Member
****
Offline Offline

Activity: 299
Merit: 250


View Profile
January 10, 2014, 05:32:17 AM
 #809

I am on it but I think it will a lot slower than you want Sad

We'll choose the fastest and will pay part of the bounty then.

I'm also working on it Smiley. I just got the signing part working pretty well today, but now i need to move on the verify part this weekend, which i can see will be a lot trickier.

NEM - nem.io
Meizirkki
Hero Member
*****
Offline Offline

Activity: 616
Merit: 500



View Profile
January 10, 2014, 06:52:36 AM
 #810

Code:
					int curTime = getEpochTime(System.currentTimeMillis());
This occurs three times in the code. Isn't it impossible for int to carry such high value?

According to Orace int max value is:
2^31-1 = 2147483647

Current time in milliseconds is past 1389336607592 atm.
Come-from-Beyond (OP)
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
January 10, 2014, 06:54:36 AM
 #811

Code:
					int curTime = getEpochTime(System.currentTimeMillis());
This occurs three times in the code. Isn't it impossible for int to carry such high value?

According to Orace int max value is:
2^31-1 = 2147483647

Current time in milliseconds is past 1389336607592 atm.

It's measured in seconds and shifted.
Meizirkki
Hero Member
*****
Offline Offline

Activity: 616
Merit: 500



View Profile
January 10, 2014, 07:01:55 AM
 #812

Code:
					int curTime = getEpochTime(System.currentTimeMillis());
This occurs three times in the code. Isn't it impossible for int to carry such high value?

According to Orace int max value is:
2^31-1 = 2147483647

Current time in milliseconds is past 1389336607592 atm.

It's measured in seconds and shifted.
Dammit it's time for me to get some more coffee
minusbalancer
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
January 10, 2014, 07:49:42 AM
 #813

Imagine you do have the following sequences of blocks returned: b1, b2, b4, b3

All of the blocks are valid and aren't damaged. Existing code won't process this sequence. However adding just 1 line (updating currentBlockId) will make the code work like it was planned.

returned from WHERE?

I assume you were reffering to commonBlockId not currentBlockId

They will either be added after commonBlockId or, if there was a split, proper block will be removed and they will be added AFTER popped blocks.

So I still don't see a problem

You are correct. I was referring the commonBlockId. It will take too long too explain.
I am not referring the scenario with 2 nodes. Imagine we do have just 1 node and the sequence is wrong in JSON.

Still it's not 1 of the injected flaws so doesn't matter.
gimre
Legendary
*
Offline Offline

Activity: 866
Merit: 1002



View Profile WWW
January 10, 2014, 09:03:46 AM
 #814

I am on it but I think it will a lot slower than you want Sad

We'll choose the fastest and will pay part of the bounty then.

I'm also working on it Smiley. I just got the signing part working pretty well today, but now i need to move on the verify part this weekend, which i can see will be a lot trickier.

So am I Smiley (but I don't even have signing yet :>)

NemusExMāchinā
Catapult docs: https://docs.symbol.dev
github: https://github.com/symbol
ricot
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
January 10, 2014, 09:06:49 AM
 #815

Agree.
Then we do have the other bug - outgoing transactions are not deducted from the "genesis" created accounts while calculating the effective balance.

Edit: incoming


It's by design.

?!?!?!

So by design the founders have the ability to increase their forging chances 73-fold???
Then this currency is dead Sad
gimre
Legendary
*
Offline Offline

Activity: 866
Merit: 1002



View Profile WWW
January 10, 2014, 09:20:06 AM
 #816

You are correct. I was referring the commonBlockId. It will take too long too explain.
I am not referring the scenario with 2 nodes. Imagine we do have just 1 node and the sequence is wrong in JSON.

I'll take a look at it again

NemusExMāchinā
Catapult docs: https://docs.symbol.dev
github: https://github.com/symbol
Come-from-Beyond (OP)
Legendary
*
Offline Offline

Activity: 2142
Merit: 1009

Newbie


View Profile
January 10, 2014, 09:35:38 AM
 #817

So by design the founders have the ability to increase their forging chances 73-fold???
Then this currency is dead Sad

They don't have this ability. Use math and u'll see why.
ZeroTheGreat
Hero Member
*****
Offline Offline

Activity: 644
Merit: 500


View Profile
January 10, 2014, 12:03:23 PM
 #818

Jean-Luc writes english with french syntax, like many french speaking native people (I am). I'm confident that his mother tongue is probably french with very high probability. It is not the case with CfB. I do not see french syntax in CfB writing. That is my analysis. Maybe I'm wrong, but...

And what about BCNext's style?

Come on... we all know the truth.  BCNext, Jean-Luc, CnB, Fuseleer, RealSolid, Coinhunter, Gavin, satoshi, BitcoineXpress AND rlh are all the same, very-schizo multi-personality.

Sorry... I couldn't resist.
Your forgot tvv  Grin
gimre
Legendary
*
Offline Offline

Activity: 866
Merit: 1002



View Profile WWW
January 10, 2014, 02:57:27 PM
 #819

With the published code no one will be able to generate any block ever.

In getEffectiveBalance() we do have the check for the account age of 1440 (blocks).

Since at the beginning of the functioning the system all of the accounts had 0 age, none of them will be able to generate the block.
No blocks generated => no age increase.

Accounts listed in genesis block can generate blocks, their age is not analyzed.

@minusbalancer: ok, now I get what you've meant, but I think that it's how it SHOULD BE.

I repeat what I've told already few times, in my opinion these two situations are exclusive
  • adding new blocks at the end
  • droppin elements starting at commonBlockId, and adding "new chain" from futureBlocks

So IMHO it's perfectly OK that commonBlockId is NOT updated. (otherwise, you would FSCK up all the "fork fixing")

You were mentioning blocks coming not in order, if something like this happens - IT'S BAD.
It means it's non conformant client, so most probably "previous" version of blockchain will be properly restored,
and that "non-conformant" client will be added to blacklist.

NemusExMāchinā
Catapult docs: https://docs.symbol.dev
github: https://github.com/symbol
ImmortAlex
Hero Member
*****
Offline Offline

Activity: 784
Merit: 501


View Profile
January 10, 2014, 03:41:43 PM
 #820

I repeat what I've told already few times, in my opinion these two situations are exclusive
  • adding new blocks at the end
  • droppin elements starting at commonBlockId, and adding "new chain" from futureBlocks

So IMHO it's perfectly OK that commonBlockId is NOT updated. (otherwise, you would FSCK up all the "fork fixing")
+1
I dreamed on this a lot, and consider this code branches are exclusive. It is not very clean when looking for first ot second time, the logic is not simple if-else statement.
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!