Post
Topic
Board Altcoin Discussion
Re: Transparent mining, or What makes Nxt a 2nd generation currency
by
jettico
on 31/01/2014, 08:30:09 UTC
I can instead create a FAQ about my code.

Q: Why do you use random() instead of first 8 bytes of SHA256 of the transaction hash as described in the algorithm?
A: Because SHA256 is designed to generate values that are uniformly distributed.

Q: What happens if a==b? Why don't you process this situation?
A: The original algorithm described in wiki doesn't give the answer either. But the possibility of this event is proportional to (2-64)2 (because 8 first bytes of sha256 have 64 bits) which is about 10-38 so it is safe in this code to simple skip such cases for clarity. If you are feeling pedantic you can add the line
Quote
print NBLOCKS-(na+nb)
in the end of the code and it will always (well, ok, with an estimated probability of 1-NBLOCKS*(10-38) = 1-10-32) give you zero.


Hehe, why r u affraid of answering my questions?

No, I'm ignoring your attempt to substitute notions (we both remember that you've done it before, and last time you failed to explain how the substituted notion related to my original post).

Start a new thread and I shall answer it there.

I'm not willing to continue this senseless flood any longer. It doesn't help anyone. If you don't believe me or Cryddit ask someone whom you believe. Ask BCNext, ask Jean-Luc.