1052 is the number of the winning ticket. The number of shares is 1333.
But 533185083072510277447466028633619559836558615818 % 1333 still is not 1052 so something went wrong. There should be some obvious mistake.
Silly me believed 1052 was the number of tickets, which is obviously not by the tickets list.
If you run a witness you would have 1/21 chances of cheating the raffle.
That is right, also a witnesses could try to cheat when participating. The latter can be fixed by me publishing a hash of a random number that will be added to the Merkle root. And this is simple to implement. I have not done this since the chance of a witness cheating now is almost zero, but should amounts rise I can do it.
To prevent me form cheating if I were a top 21 witness, users would need to be able to submit hashes and later within a time window provide the corresponding number. That would massively complicate the entire procedure. Right now I don't think this is nessecary as the plan to become a top 21 witness just to cheat 30 cent raffles is a bit redicoulous.
thanks for pointing out the mistake. I found the problem. I was doing the following very simple calculation in python
int(merkle_root,16) % tickets
with the merkle root above and tickets = 1333
the correct result is 469, but python only finds that when tickets is an int. Hoever in my code tickets was assumed to be a float.
Ususally this is no problem but it causes python to use a numerical result that eventually fails for very big numbers. In this case python tells me that
I have now fixed the bug. The old way was still random, but I am not sure it was fair (in the way that all tickets were equally likely to win).
I also changed the way the bot presents the result to make it more understandable what happens.
1052 is the number of the winning ticket. The number of shares is 1333.
But 533185083072510277447466028633619559836558615818 % 1333 still is not 1052 so something went wrong. There should be some obvious mistake.
The real winner is @zero-profit with ticket 469
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
Silly me believed 1052 was the number of tickets, which is obviously not by the tickets list.
If you run a witness you would have 1/21 chances of cheating the raffle.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
That is right, also a witnesses could try to cheat when participating. The latter can be fixed by me publishing a hash of a random number that will be added to the Merkle root. And this is simple to implement. I have not done this since the chance of a witness cheating now is almost zero, but should amounts rise I can do it.
To prevent me form cheating if I were a top 21 witness, users would need to be able to submit hashes and later within a time window provide the corresponding number. That would massively complicate the entire procedure. Right now I don't think this is nessecary as the plan to become a top 21 witness just to cheat 30 cent raffles is a bit redicoulous.
Posted using Partiko Android
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
thanks for pointing out the mistake. I found the problem. I was doing the following very simple calculation in python
int(merkle_root,16) % tickets
with the merkle root above and tickets = 1333
the correct result is 469, but python only finds that when tickets is an int. Hoever in my code tickets was assumed to be a float.
Ususally this is no problem but it causes python to use a numerical result that eventually fails for very big numbers. In this case python tells me that
533185083072510277447466028633619559836558615818 % 1333 = 469
while
533185083072510277447466028633619559836558615818 % 1333. = 1052
I have now fixed the bug. The old way was still random, but I am not sure it was fair (in the way that all tickets were equally likely to win).
I also changed the way the bot presents the result to make it more understandable what happens.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit
You got an upvote from @zero-profit at the courtesy of @frdem3dot0
Find more information about @zero-profit here.
![Screenshot 2018-10-01 14.23.34.png](https://steemitimages.com/640x0/https://cdn.steemitimages.com/DQmSc4feaxw8o2tbvEoCRLed1ix6Cb2r6VDXGm5N6QfBiFA/Screenshot%202018-10-01%2014.23.34.png)
Delegation links: 20SP; 50SP ; 100SP ; 200SP ; 500SP
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit