user615: Is there any way to make datum data only visible to a smart contract that owns the UTXO?
For example, lets say I wanted to make a guessing game. In this game, person A selects a number and creates an output at the smart contract with a prize (some amount of ADA) and a number in the datum of the UTXO. A second player B can then try to guess the number. For each guess, the player has to pay a certain amount of ADA to the contract. If he is right, all the ADA in the contract is given to him. If he is wrong, the ADA he provided is added to the prize pool. In order for the contract to determine if the guess is correct, it should evaluate the number provided by player B to the number stored in the datum UTXO, provided by player A.
However, datum data is public. It can be retrieved by everyone which means player B can look at the datum of the UTXO at the contract, see what number it holds and guarantee a win. Is there a way (in the smart contract) to enshure the number at the UTXO can only be evaluated under the pre-determined conditions of the smart contract code?
For example, could player A encrypt the number using the public key of the smart contract address, where the smart contract could decrypt the data using its private key on evaluation? This isn't possible since a smart contract doesn't have a private key, therefore, is there another way to achieve this?

user28: No, this is not possible right now without verifying just the hash.
Also, an attack vector that comes in mind is that someone will see the tx, validate it before it is included in the blockchain and make the block with the correct response first.

615: <p><strong>Is there any way to make datum data only visible to a smart contract that owns the UTXO?</strong></p>
<p>For example, lets say I wanted to make a guessing game. In this game, person A selects a number and creates an output at the smart contract with a prize (some amount of ADA) and a number in the datum of the UTXO. A second player B can then try to guess the number. For each guess, the player has to pay a certain amount of ADA to the contract. If he is right, all the ADA in the contract is given to him. If he is wrong, the ADA he provided is added to the prize pool. In order for the contract to determine if the guess is correct, it should evaluate the number provided by player B to the number stored in the datum UTXO, provided by player A.</p>
<p>However, datum data is public. It can be retrieved by everyone which means player B can look at the datum of the UTXO at the contract, see what number it holds and guarantee a win. Is there a way (in the smart contract) to enshure the number at the UTXO can only be evaluated under the pre-determined conditions of the smart contract code?</p>
<p>For example, could player A encrypt the number using the public key of the smart contract address, where the smart contract could decrypt the data using its private key on evaluation? This isn't possible since a smart contract doesn't have a private key, therefore, is there another way to achieve this?</p>
 28: <p>No, this is not possible right now without verifying just the hash.</p>
<p>Also, an attack vector that comes in mind is that someone will see the tx, validate it before it is included in the blockchain and make the block with the correct response first.</p>
