Witness Encryption

An encryption scheme where public keys are instances (public inputs of a circuits) and private keys are witnesses (the private inputs and intermediate computation steps).


Witness encryption is a generalization of public key encryption.

Recall that for public key encryption, we pick one specific hard problem to generate private-public key pairs. For example, if we choose the discrete logarithm in elliptic curves (EC), the private key is a scalar and the public key is a point . We assume that finding given is hard and use this fact to construct encryption schemes.

In witness encryption, we allow to encrypt to any -problem (see Decision Problems). For example, we could encrypt to an arithmetic circuit — the same ones we use for SNARKs (!). The public key would be the public inputs, while the private key is the private inputs and all intermediate computation steps.

More formally, the public key is any instance of an relation, and the private key is a corresponding witness. Note that depending on the relation, a single public key (instance) could have multiple private keys (witnesses). Depending on your use case this could be a nasty bug or a great feature!

Here is a table summarizing the above discussion:

SchemeHard ProblemPublic KeyPrivate Key
EC public key encryptionEC discrete logarithmPoint Scalar
Circuit-based encryptionCircuit satisfiabilitypublic inputsprivate inputs and intermediate wires
Generic witness encryptionany -probleminstance witness

Witness Encryption in Practice

Witness encryption schemes are not yet practical. Cryptographers are hard at work to make these schemes usable.

However, we do have variants that are already available:

  • commitment-based witness encryption (CWE). In CWE, the public key is an instance and a commitment . The corresponding private key is a value such that was a commitment to and was a valid witness for .

    CWE example. Following our circuit example: the public key would be the public inputs and a commitment to the private inputs + intermediate steps.

  • signature-based witness encryption (SWE). In SWE, the public key is a signature key and a string s. The corresponding private key is a signature on s by the secret key that corresponds to .

    SWE example. SWE has been used to build timelock encryption, otherwise known as “encrypting to the future” [DHMW22] [GMR23].