You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just out of curiosity, i want to ask, why the need to generate proof first, before a user can confirm withdrawal, if we'd still need to check for a valid proof when trying to process withdrawal in smart contract?
Why not do every thing in just one process since the withdraw function will throw for invalid proof?
The text was updated successfully, but these errors were encountered:
If you mean to ask why the proof can't be generated by the solidity function which handles withdraw, it's because proof generation needs the secret key used during deposit. There is no way that the withdraw function can know what this secret key is, so it must be passed in by the user. However, the user cannot simply pass this secret key directly, because it would be exposed in the clear on the blockchain and susceptible to front-running by miners, who could then redirect the withdraw to their own account. So the secret key is scrambled into a cryptographic proof before sending it over to the blockhain.
But the proof verification happens in the browser right? So i was just thinking in the front end code, rather than put the verification and withdrawal codes in two different js functions, how about a single function which handles both, verifies proof first, and if verification was successful, calls the contract's withdrawal function, otherwise it throws..
Rather than the two step processes of tornado, which verifies proof, before you confirm withdrawal.
Just a UX thought, wanted to confirm if it has security disadvantages.
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hello,
Just out of curiosity, i want to ask, why the need to generate proof first, before a user can confirm withdrawal, if we'd still need to check for a valid proof when trying to process withdrawal in smart contract?
Why not do every thing in just one process since the withdraw function will throw for invalid proof?
The text was updated successfully, but these errors were encountered: