Introduction
The privacy protocols on public blockchains have been a topic of interest for quite some time - due to good reasons as well as bad. One one hand, privacy is a fundamental right and a key component of financial freedom. On the other hand, privacy on public blockchains have attracted as venue for crypto money laundering - owing to absence of any anti-money laundering measures in place.
A few measures for compliance for privacy protocols have been attempted in the past - limits, sanctioned addresses, view-access etc. However, these measures have been largely ineffective due to the fact that all of it can either be circumvented easily or are voluntary.
I assume you have basic knowledge of how privacy protocols work on public blockchains.
Privacy Pools Design
Almost all of the privacy pools on public blockchains are designed with a similar
architecture. You have a shielded account that has two keys - a spend key and view key.
The funds are in the form of notes (like digital coins) with some value
where
A shielded account (with spend public key
A nullifier
where
To spend a note, the owner proves
- The commitment
of note is in the tree (i.e. the note exists and is valid) - The nullifier
of note has not been recorded on-chain. - The sum of the values of all notes being spent is equal to the sum of the values of all notes being created (i.e. no new money is created).
The receiver of the note scans the chain for new incoming notes and attempts to decrypt then using its view key. If the decryption is successful, the note is added to the receiver's shielded account balance. The receiver can then spend the note.
Setup
The goal of this compliance mechanism is to allow de-anonymization of the transactions by decrypting their notes without cooperation of the user and without giving decryption key to any single party.
Actors:
-
Revoker Revoker is the actor that is responsible for requesting the decryption of notes involved in a transaction. The revoker is also the actor that will perform the actual decryption of notes as a final step and hence only it sees the decrypted notes.
-
Guardians Guardians are the actors that make this mechanism distributed. The guardians hold the shares of a decryption key. This decryption key that whose shares are split among the guardians, decrypts a per-transaction key that actually decrypts the notes.
Setup
Before the system can be used, the guardian key shares need to generated and distributed among the anointed guardians. Although a centralize dealer can split and share secrets using the Shamir Secret Sharing scheme, something like Distributed Key Generation (DKG) might be a better approach for our setting.
Suppose we have
Revoker also has its own key
El Gamal
We will use El Gamal encryption scheme to encrypt a key that is used to encrypt the notes. Here's how El Gamal works.
Encryption
Suppose
Our ciphertext
Decryption
To decrypt using the private key
It works because:
El Gamal With Aggregate Key
Now suppose we want an El Gamal based encryption scheme where a public key represents a group or multiparty and all parties need to contribute to decryption without revealing their private keys. It turns out to be pretty simple!
Let's take an example of two parties with keypairs
As apparent from above the private key
Like before encryption remain same - group public key
Now, to decrypt each party contributes the partial decryption share
After all
It works because:
so the term
Mechanism
Our mechanism works even for an involuntary subject i.e. de-anonymization or decryption of encrypted transaction data does not require user's coordination.
It works by requiring the user to encrypt the output notes with certain public key whose corresponding private is unknown to everyone. Lets start by defining the two actors or entities involved at compliance side:
Revoker
Revoker is the actor that is responsible for requesting the decryption of notes to a committee of "guardians" involved in a transaction. This transaction maybe involved in an illicit transaction or required by regulation to be decrypted. A revoker could be a regulatory body or some other law enforcement. Only a revoker sees the final decrypted notes.
We assume revoker has its own keypair
Guardians
Guardians are the actors that make this mechanism distributed. The guardians hold the shares of a decryption key. This decryption key is never revealed, only split shares are available to the guardians.
Lets say each of the
Encryption Keys
For each transaction client generates a random key
As earlier discussed in our aggregated El Gamal encryption scheme, to decrypt the ciphertext to
reveal
Since revoker is a single party it can use its private key
The case for guardians to calculate
Constructing The Compliant Transaction
With setup in place a client makes the private transactions compliant in this manner:
1. Encrypt output notes
The client encrypts the output notes of the transaction with randomly generated
2. Encrypt the note encryption key
The key
3. Construct compliance proof
Now as we said earlier, enforce via proof that encryptions were performed correctly. Apart from
transaction related inputs to circuit, the randomly chosen
4. Broadcast compliance data included transaction
Broadcast the transaction and make sure that ciphertext
Decrypting The Compliant Transaction
Since notes are encrypted with key
To decrypt a transaction, the revoker fetches the transaction id and posts a signed request (signed
with
Guardians then try to form a quorum of at least
And then send the shares
The revoker calculates decryption share
where
The revoker also calculates its own decryption share as:
The final decryption now works the same as we described for aggregated key El Gamal:
With
If a decrypted note
Tracing The Transactions
Adopting this compliance mechanism assumes that decryption of a note (or any additional information)
is sufficient to also reveal its nullifier
Suppose the note

For sake of simplicity only one note is shown per transaction. In reality, revoker decrypts multiple notes per transaction. Notes decrypted in one transaction can be spent and linked to multiple other transactions rather than just one as shown in image above. The trace will then be visually a more complex tree-like structure where multiple branches emerge from a node.
A friction point can be when the trace is too wide and/or long. In that case, revoker needs to constantly send requests to the guardians for decryption. A practical solution to this is to include a depth parameter in the request for deanonymization. Guardians then decide for once how deep in the trace should they be allowing the decryptions. After a positive decision an automated system can be run that automatically loops in revoker and guardians contributions to constantly decrypt notes across transactions until the specified depth is reached.