0

A function in the smart contract needs to accept parameters to execute. If I pass this parameter to the contract, but don’t save the parameter on the chain, is it theoretically transparent on the blockchain? Everyone can do it See the value of this parameter.

Is there any way to hide the value of a parameter in a smart contract?

Hopes you can give me some help, thanks!

0

There are no secrets in the blockchain. All data sent to it is visible for everyone.

There is also no way to "don't save the parameter on the chain" if you are sending a transaction to the contract. All data in transactions is public and therefore also your parameters are public.

The only way to not expose your data is to do local read-only calls to the contract which are not sent to the blockchain, but that is kinda pointless as you can't modify the state and the contract is useless if used only locally.

5
  • Thank you for your answer, it has benefited me a lot. – wei wang Dec 4 '20 at 6:27
  • Hi, Lauri! I checked some information and learned that the ring signature can achieve privacy protection on the blockchain to a certain extent. I would like to ask whether it is possible to call functions in smart contracts through ring signature technology to protect data privacy to a certain extent. – wei wang Dec 4 '20 at 11:41
  • There are various schemes to provide some level of privacy, some better and some worse but none of them are easy nor cheap (in terms of gas costs) to implement, I believe – Lauri Peltonen Dec 4 '20 at 11:43
  • If it is to achieve a certain degree of privacy protection on Ethereum, can you give me some reference? I want to protect the data in my smart contract as much as possible, but I haven't found some suitable examples.Thanks! – wei wang Dec 4 '20 at 11:46
  • Sorry, I don't have any reference to provide you with because there really isn't any easy way to do it. In general Ethereum just isn't suited for storing secrets. If you have further questions please post a new question or try to search for an older question for answers – Lauri Peltonen Dec 4 '20 at 11:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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