# Privacy-preserving Paymaster Source: https://ethglobal.com/showcase/privacy-preserving-paymaster-hap9s Kiwi News: https://news.kiwistand.com/stories/Privacy-preserving-Paymaster?index=0x64626a162028b3af373c901a4d18ad2ebf9ecdb5c709cf6906fd9a608d9607531a459a32 Submitted by accountless.eth on 2023-05-15 UTC, 6 upvotes, 0 comments ## Summary This is a project write-up for a privacy-preserving paymaster that lets users withdraw from mixers such as Tornado Cash into a fresh address without holding ETH for gas. Users generate a zero-knowledge proof of the withdrawal and encode it in the paymaster data, and the paymaster validates the proof, executes the withdrawal, pays the gas fee, and deploys a new smart account to receive the funds. The build uses the ERC4337 standard, contracts inherited from eth-infinitism with overridden validation logic, a modified trampoline browser extension to create the UserOp, and open-source Tornado Cash code for deposits and proof generation. The contracts have been deployed to Goerli, Polygon Mumbai, Optimism Goerli, Gnosis Chain, Linea, Mantle testnet and Scroll testnet. ## Article When withdrawing from mixers such as Tornado Cash or privacy-preserving rollups, privacy is best protected when the funds are withdrawn to a completely fresh address, with no previous transaction history. This is however difficult to achieve as the fresh address does not have any ETH to pay gas fee, where they often need to rely on a relayer and still leak privacy. To tackle this problem, we leverage the ERC4337 standard to build a paymaster module. Users are able to generate a zero knowledge proof that allows withdrawal from the mixer, encode this proof in the data passed to the paymaster. The paymaster validate that the withdrawal is valid, and execute the withdrawal for the user, paying the corresponding gas fee and deploying a new smart account where the funds will be received. We built a privacy-preserving paymaster that helps to create funded new smart accounts. We override the paymaster validation logic from contracts inherited from eth-infinitism, where we parse the zero knowledge proof submitted by the user and execute the withdrawal on behalf of the user. We also use the trampoline browser extension to create the UserOp that is sent to the bundler. We modified the paymaster data parsing on trampoline. On the funds withdrawal workflow, we use open-source tornado cash implementation to handle the deposit and withdrawal proof generation. We deployed the contracts to Goerli, Polygon Mumbai, Optimism Goerli, Gnosis chain, Linea, Mantle testnet and Scroll testnet.