is it possible to disguise the input from msg.sender of a function call?

e.g. If we assume I have a smart contract which includes a mapping of registered inmates, and a user-group called prison officers.

Now, I could restrict the lookup of registered inmates to only be accepted from the prison officers user-group.

However, this could still be gamed because they still need to be added to the mapping which requires an input, someone could just go through the single transactions and their input variables to accumulate a list og registered inmates. Is it possible to disguise this input?

1 Answer 1


Basically, no.

Everything in the blockchain is public. Either people can read all the data from transactions or directly from the smart contracts - there's no way to hide any information. That's one of the key aspects of many blockchains: transparency.

You could for example encrypt some of the data before sending it to the blockchain but then the smart contract can't process the data in any way except storage. If the smart contract could decrypt the data it means it has the key which means everyone could see the key.

There are some projects which aim to bring privacy (also at the protocol level, zk-snarks) with various means and with various levels of readiness. You can see some more info for example here: Ethereum facilitation for zk-SNARKs

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.