mirror of
https://github.com/lux-apps/papers.git
synced 2026-10-30 18:15:21 +00:00
Restructured from flat .tex/.pdf files into per-paper subdirectories. Added Antje Worring as co-author on all papers. Synced PDFs to pdfs/ for download site.
53 lines
2.3 KiB
TeX
53 lines
2.3 KiB
TeX
\section{Protocol Specification}
|
|
\label{sec:protocol}
|
|
|
|
\subsection{Deposit}
|
|
|
|
\begin{algorithm}[H]
|
|
\caption{Privacy Pool Deposit}
|
|
\label{alg:deposit}
|
|
\begin{algorithmic}[1]
|
|
\Procedure{Deposit}{user, amount $v$}
|
|
\State \textbf{require} $v \in \{0.1, 1, 10, 100, 1000\}$ LUX \Comment{Fixed denominations}
|
|
\State User generates: $\mathsf{sk} \xleftarrow{\$} \mathbb{F}_p$, $r \xleftarrow{\$} \mathbb{F}_p$
|
|
\State $\mathsf{pk} \gets \mathsf{sk} \cdot G$
|
|
\State $\mathsf{commitment} \gets H(\mathsf{Commit}(v, r), \mathsf{pk})$
|
|
\State Transfer $v$ LUX from user to PrivacyPool contract
|
|
\State Insert $\mathsf{commitment}$ into Merkle tree at next leaf
|
|
\State $\mathsf{leafIndex} \gets$ current leaf count
|
|
\State User stores $(\mathsf{sk}, r, v, \mathsf{leafIndex})$ locally (secret note)
|
|
\EndProcedure
|
|
\end{algorithmic}
|
|
\end{algorithm}
|
|
|
|
Fixed denominations ensure all deposits of the same value are indistinguishable, maximizing the anonymity set.
|
|
|
|
\subsection{Withdrawal}
|
|
|
|
\begin{algorithm}[H]
|
|
\caption{Privacy Pool Withdrawal}
|
|
\label{alg:withdraw}
|
|
\begin{algorithmic}[1]
|
|
\Procedure{Withdraw}{secretNote, recipient, aspChoice}
|
|
\State Retrieve $(\mathsf{sk}, r, v, \mathsf{leafIndex})$ from secretNote
|
|
\State Compute $\mathsf{nf} \gets H_{\text{null}}(\mathsf{sk}, \mathsf{leafIndex})$
|
|
\State Obtain current pool Merkle root $R$
|
|
\State Obtain association set root $R_{\mathcal{A}}$ from chosen ASP
|
|
\State Compute Merkle path for $\mathsf{leafIndex}$ in pool tree
|
|
\State Compute Merkle path for $\mathsf{leafIndex}$ in association set tree
|
|
\State Generate Groth16 proof $\pi$ for circuit $\mathcal{C}$:
|
|
\State \quad Public: $(R, R_{\mathcal{A}}, \mathsf{nf}, \mathsf{recipient}, v)$
|
|
\State \quad Private: $(\mathsf{sk}, r, \mathsf{leafIndex}, \text{paths})$
|
|
\State Submit $(\pi, R, R_{\mathcal{A}}, \mathsf{nf}, \mathsf{recipient}, v)$ to contract
|
|
\State Contract verifies:
|
|
\State \quad (a) $\pi$ is valid for public inputs
|
|
\State \quad (b) $\mathsf{nf}$ has not been used before
|
|
\State \quad (c) $R$ is a valid (recent) pool root
|
|
\State \quad (d) $R_{\mathcal{A}}$ is from a registered ASP
|
|
\State If all checks pass: transfer $v$ LUX to $\mathsf{recipient}$
|
|
\State Record $\mathsf{nf}$ as spent
|
|
\EndProcedure
|
|
\end{algorithmic}
|
|
\end{algorithm}
|
|
|