I wish to make a contract that will allow two (eventually possibly more) people to gamble on essentially flipping a coin using ethereum. One person will not be "gambling against the contract" but another user of the contract.
Is this possible considering the fact that the blockchain data is public? Both parties should supply randomness and, for example, they both have to supply a 1 or a 0 and, if they are both the same, A wins and otherwise B wins. Will it be possible to stop a malicious party from seeing the first party's input and supplying biased input itself?
Would a limit on the time between the two parties submitting work? Any hacky solutions or musings are welcome.