I've a function in my smartcontract, that pays out ETH to the sender. However it sgould be only callable from registered users on my website, regardless of their ETH-address.
I already tried to send a secret string as parameter, hash it and compare that to an array of hashes. But the problem is that an array of 1000 hashes is very expensive/impossible. So I wonder if there's a better way to do that? Would it maybe possible to generate unique secrets for each transaction, which all fit to ONE single "key" in the contract?
At the moment it's:
bytes32[] public hashedSubmitSecrets;
function requestMoney(string _submitSecret) {
require (hashedSubmitSecrets[i] == keccak256(_submitSecret));
}
function addSubmitSecrets (bytes32[] _arrayOfHashedSecrets) onlyOwner {
for (uint i = 0; i < _arrayOfHashedSecrets.length; i++) {
hashedSubmitSecrets.push(_arrayOfHashedSecrets[i]);
}
}