DocsThe audit

DocsConcepts11 of 33 · 2 min read

The audit

What the audit ciphertext holds, what the auditor's key opens, and what stays closed to it.

Each payment carries the identity of its recipient, encrypted so that one key can open it. The holder of that key is the auditor. The payment's proof guarantees that the ciphertext holds the recipient the payment went to.

#The audit key

The auditor has a secret a and a public key A = aG on Baby Jubjub. A is in the program's configuration, where every sender reads it. a stays with the auditor.

#The ciphertext

The sender encrypts the recipient's public spend key S with EC-ElGamal, using a fresh secret k for each payment:

c1 = kG
c2 = S + kA

The pair (c1, c2) is announced with the payment. Because k is new each time, two payments to the same recipient carry ciphertexts that look unrelated.

#What the auditor reads

S = c2 - a·c1
ts
import { decryptAuditIdentity } from "@liora/contract";

const spendPublic = decryptAuditIdentity(auditSecret, announcement.auditCiphertext);

For the example payment this returns 6f931f960613cf58ed58fc0629d2822c689d6d98c33888f3d7bbf0a5520d449a, the first half of the recipient's meta-address.

The auditor looks S up in the directory and gets the entry behind it: handle, requesting wallet, status and index. Each spend key belongs to one entry for the whole history of the whitelist, so the lookup has one answer, and it still has one after the entry is removed.

The auditor
ReadsThe recipient of every payment
Does not readThe asset or the amount, which Rings encrypts to the note's owner
CannotSpend a payment, change the whitelist, or open anything with a key other than its own

An audit row and its CSV export show the amount as encrypted.

#Why the ciphertext can be trusted

A sender could try to encrypt somebody else's key and pay a different recipient. The proof rules that out: it shows that one meta-address (S, V) was used three times, as a leaf under the whitelist root, as the source of the stealth address, and as the plaintext of the ciphertext. The program rejects a payment whose proof does not verify, and emits no announcement for it.

Decryption uses the audit key that was in the configuration when the payment executed.