Context
A proposal for the private state synchronization problem using Fuzzy Message Detection (FMD) and Trusted Execution Environments (TEEs) is put forward in this thread.
To send message m to user \mathsf{uid}, the idea is to attach to m a ciphertext flag \vec{f} generated with an FMD public key pk_\mathsf{{fmd}} associated to the receiver identity \mathsf{uid}. \vec{f} is tested with the detection keys associated to pk_\mathsf{{fmd}} to filter out irrelevant messages.
The novelty being in that the detection keys are handed to TEEs to mitigate key leakage, and, with a very minor modification of the FMD test, we can set large false-positive rates at each TEE for increased privacy, but, by combining their filtered output, achieve low overall false-positive rates in the resulting system.
What problems can arise?
When the anoma Resource Machine is shielded, the message m consists of encrypted data in the valueRef
field of the resource object, and it is sent anonymously to the receiver with, say, user identifier \mathsf{uid}.
There are at least two problems that arise when senders (resource owners) delegate the creation of the resource to untrusted solvers (resource creators). The fact the transfer is anonymous just makes things more complicated.
Problem 1: The rightful receiver problem. A sender asks a solver: ‘‘here is the plaintext message pt, please send it to user \mathsf{uid}’’. How can we enforce the solver sends pt to \mathsf{uid}?
Note that it is the sender who needs to convinced. Indeed, only the sender should know the right (anonymous) receiver. Therefore, if we were to solve this problem using ZKPs somehow, then it must be the sender who verifies the proof.
This post is NOT about this problem.
Problem 2: The flag consistency problem. A solver misbehaves and sends an encrypted message m inconsistent with the FMD flag ciphertexts \vec{f}. Thus, the message is addressed to the rigth user \mathsf{uid}, but flag \vec{f} is generated with the FMD public key pk'_{\mathsf{fmd}} of a different user \mathsf{uid}'.
Messages with inconsistent flags are potentially filtered out during the FMD test. Thus, whereas a full scan retrieves the inconsistent message addressed to user \mathsf{uid}, a filtered scan may not. To some extent, this desincentives users to use any efficient FMD-based solution to retrieve their messages, and be stuck with the inefficient full scan and trial-decrypt solution.
Note. The rightful receiver and the flag consistency problems above can be subsumed under the sound delegation problem, which asks how can we enforce untrusted solvers to behave honestly when creating resources. Thus, any solution to either of the former problems can be used to build a solution to the (more general) latter problem.
Solving the flag consistency problem
I will not provide a specific solution. Instead I will describe a generic approach. If we believe it makes sense, then we can think about how to make it concrete, and how to optimize it.
User identities and public keys
Clearly, user public keys must be somehow publicly associated to the user identity \mathsf{uid}. This applies to both
- verifiable encryption public keys pk_\mathsf{ve} in the shielded RM,
- and FMD public keys pk_\mathsf{fmd}.
Otherwise, senders/solvers would not know what keys they should use.
For example, such association forms the basis of the trial-decrypt message retrieval. Users decrypt the candidate ciphertext and check whether that yields something meaningful. This works for the obvious reason. If user \mathsf{uid} has verifiable encryption keypair (sk_\mathsf{ve},pk_\mathsf{ve}), and the ciphertext ct is encrypted under pk'_\mathsf{ve}, then m:=\mathsf{Dec}_{sk_\mathsf{ve}}(ct) is likely to be meaningless if pk_\mathsf{ve}\neq pk'_\mathsf{ve}.
A failed (or incomplete) solution
In this thread reply an attempt to solve the consistency problem is sketched. Unfortunately, it does not seem work.
The suggestion was to encrypt the FMD public key pk_\mathsf{fmd} inside the verifiable ciphertext ct that contains the message. The informally given NP statement therein was (slightly rephrased to align notation):
The cursive highlights the problem: a misbehaving encryptor (e.g. solver) could encrypt a different FMD key pk'_\mathsf{fmd} corresponding to another user \mathsf{uid}' and prove that. So we are back to square one.
Linking public keys
The root problem in the failed attempt above is that there is no link between the FMD public key pk_\mathsf{fmd} and the verifiable encryption public key pk_\mathsf{ve}. What I mean is that, even though they are associated to the same user, there is no programatic link between both keys.
Without such link, I do not see an obvious way to guarantee that an untrusted encryptor (e.g. solver) uses keys for the same user. So we are going to consider a specific linking strategy that ties together both public keys. A user with identifier \mathsf{uid} is publicly associated with a master public key pk_M. There are two key derivation processes
and
For now, let us leave undefined the key derivation processes \mathsf{deriveVE}, \mathsf{deriveFMD}. We just assume they take as part of their inputs the user master keypair (sk_M,pk_M).
A working generic solution
The idea is to generate a ZKP to attest to the consistency between the verifiable encryption public key and the FMD public key. Thus, to attest that both keys are linked in the way explained above, and hence belong to the same user.
Concretely, a ZKP for the following NP relation:
The instance (public input) of the relation is the pair (ct,\vec{f}). The verifiable encryption ciphertext and the FMD flag ciphertexts.
The witness (private input) of the relation is the user master keypair, the verifiable encryption keypair, the FMD keypair, the message, and the randomness to encrypt and generate the flag. The tuple (sk_M,pk_M,m,sk_\mathsf{fmd},pk_\mathsf{fmd},sk_\mathsf{ve},pk_\mathsf{ve},r_1,r_2).
Note that no information about the user \mathsf{uid} is leaked in the instance (ct,\vec{f}), nor in the zero-knowledge proof \pi_{FC}. This is because the three public keys (master, verifiable encryption, and FMD) are passed as witness, the verifiable encryption scheme is key-private, and the FMD scheme is detection-ambiguous.
Commit-and-prove approach
Let \mathsf{commit} be a binding and hiding commitment scheme with fixed commitment key pk_C. The relation \mathcal{R}_{FC} can be broken in two, provided we include a commitment to the master public key in the instances. One relation for the statements regarding verifiable encryption:
and another relation for the statements regarding FMD flag generation:
In principle it should lead to smaller circuits, and proofs \pi_{VE} and \pi_{FMD} can be generated in parallel. Of course, the verifications should be done using the same commitment c. The commitment key pk_C should also be the same, but it can be re-used for different users.
Because c is hiding no information about the master public key pk_M is leaked in the instances (pk_C,c,ct) and (pk_C,c,\vec{f}). Hence no information about the user \mathsf{uid} is leaked.
Avoiding passing secret keys as witnesses
It would be good if users do not have to disclose their master, decryption and FMD secret keys to whoever generates the ZKPs (e.g. untrusted solvers). This can be achieved if we have a public key derivation processes for pk_{\mathsf{ve}}, pk_{\mathsf{fmd}} solely from the master public key pk_M:
and
For correctness it should hold that \mathsf{publicDeriveX}(pk_M) = \mathsf{deriveX}(pk_M)[0] for \mathsf{X}\in\{\mathsf{VE,FMD}\}. This way, the relation \mathcal{R}_{FC} (and \mathcal{R}_{VE},\mathcal{R}_{FMD}) defined above can be stated in terms of the public derivation algorithms, that do not use secret keys at all.
We may use similar ideas to the process of generating unhardened Bitcoin Hierarchical Deterministic Wallets.