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:

  1. Encrypts & stores the user's private key
  2. Runs checks to check if a transaction is allowed
  3. Returns a signed transaction

I have thought of a few implementations:

  1. On-chain
  2. On a trusted server
  3. 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!

1 Answer 1


Internet Computer seems to be the solution to this:

Contracts can hold private keys and sign messages (Soon)

On Ethereum every contract is public. This means a contract can’t hold private information and hence can’t sign messages because there’s no way to securely store a private key. The consensus mechanism of the IC uses a mechanism known as threshold signing where the validator nodes collaborate to create a (BLS) signature without the entire private key existing at all. In an upcoming feature a similar mechanism will be available for contracts to order the IC to generate threshold ECDSA signatures. These signatures will be verifiable outside the IC just like regular ECDSA signatures. This means you can sign Ethereum or Bitcoin transactions with a contract on the IC or you can create JWTs, verifiable credentials or x.509 certificates.

On privacy:

On Ethereum, everyone can run a full node, and therefore everything is public. Privacy can only be achieved by keeping data off-chain or by using cryptography. On the IC, nodes are permissioned by the NNS and only parts of the IC are public. Besides the API a contract developer defines for the contract itself, the following data is public

  • The subnet of the contract
  • The name of the contract
  • The hash of the WASM module of the contract
  • The controllers of the contract

In particular, neither the actual byte code nor the (cycles) balance of a contract is public. However, as mentioned earlier, the IC will support public subnets in the future. These subnets will make the raw IC block data available.


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.