We're working with the project in which we're storing some confidential details (different for each user)in smart contract, we don't want to show this information to anyone else even miner, thus we are planing to use pure
function. As pure function will not change the state of the Blockchain and miner won't execute pure function's transaction.
But that all are our assumption, we would like to understand how pure function works!
For instance, consider following smart contract.
contract Sample {
function mul(uint _a, uint _b) external pure returns(uint) {
return (_a * _b);
}
}
1) Where the pure function get executed?
2) Anything which change the state of the blockchain is verified by miners. Will miner perform any role in this type of execution?
3) If miner will execute it, will they able to see the value of a
and b
?
Edit:
We're working on some requirement, where each user can claim the reward, but we don't want to make it visible(reward amount) to other users, only admin and particular user who got reward only should be knowing the same.
pure
function?