I would like to have a system that will only sign a transaction if x condition is met. It would need to be as trustless as possible; especially not trusting the user.
Optimally, the system would be a 'black box' that:
- Encrypts & stores the user's private key
- Runs checks to check if a transaction is allowed
- Returns a signed transaction
I have thought of a few implementations:
- On a trusted server
- Locally, on the user's computer
With solutions 1 and 3, the private key will inevitably have to be decrypted to sign the transaction at some point, exposing it to either the blockchain node or the user's computer respectively. Solution 2 is not trustless.
At first, this problem seemed silly and unsolvable to me, but with trustless, zero-knowledge technology on the horizon, I was wondering if there was any way to go about doing this. For example, ZKSync has signaled interest in shifting to a "Privacy-by-Default" implementation. I assume there will be plenty of EVM chains in the future that will be able to store private data securely using ZK technology. However, this may run into the same problem as solution 1 - would the ZKEVM node still be exposed to the private key as the 'black box' contract is signing a transaction?
Integrating the black box is the major roadblock. Each solution that I have thought of involves at least some form of trust. I would love to hear any input on how to solve this problem!