Thank you very much for your good idea, @BrewMaster
I will improve it
Can you give me some advisor for random a number base on random transaction hash? application use for Lottery, user buy lottery app want transparent and want to know how to draw a special number
i have to admit that the idea of using more than one blockchain was intriguing since usually the concern in similar methods is miners cheating the lottery but using more than one can eliminate that.
but your implementation technique is bad. i suggest you find similar projects and look at how they did it.
off the top of my head you could do something like this for a lottery system:
- first set 2 block heights in the future for 2 blockchains (i am using 2 because i don't think using more is nessasary). eg. bitcoin block 588050 and etherum block 8263370
- get people to participate in the lottery
- close it down and wait for these blocks to be found. publish the list of the participants while you wait.
- take hash of each block, concatenate them together as bytes then hash the result using any hash function like SHA256
- convert the result to a number (google how hex to number works) calculate the remainder of it by the total number of participants, that is your winner.
* you can also hash the list of participants and concatenate that to the block hashes. which is similar to what freebitco.in does with their lottery.