Is it possible to get randomness in a smart contract? E.g. I would like the validator to randomly choose between two conditions to use to validate a transaction. Such a capability could be used for example to implement a lottery smart contract.
If so, what are the mechanics of the randomness?
If not, how could the lack of randomness be circumvented to implement something like a lottery smart contract?