Documentation

CslibFrontier.Crypto.Protocols.AnonymousToken.Unlinkability

Malicious-issuer unlinkability for VOLE-ACT #

This module formalizes malicious-issuer unlinkability for VOLE-ACT ([VOLEACT2026], Protocol Specification / Initial Issuance #issuance and Spending #spending) in the finite query-bounded model (#7068), including:

  1. Protocol model (OpeningCommitment, validStatement, multiProofZKRealGame / SimGame): explicit statement/witness relations enforcing (V1) (S.verify pk (tag c x) s), (V2) (c' = Com(nf', ctx, t', r')), (V3) (t' = t + x - d), and (V4) range checks (t, x, t', d < bound, with 0 < T < bound at issuance and oldRefund = 0 on newly issued tokens, aligning with the (V1)–(V4) checks of AnonymousToken.Conservation and AnonymousToken.IssuerBridge while keeping this client-side statement-witness relation separate from extracted issuer accounting).
  2. Adaptive malicious-issuer unlinkability (unlinkabilityExperiment) and balance-partitioning attacks: an adversary chooses arbitrary (pk, ctx, T₀, T₁), interacts with both clients during issuance and preRounds adaptive pre-challenge spends, and then interacts with challenge thread b : Bool for challengeSpends rounds. Both balancePartitionInitAdversary (T₀ ≠ T₁) and balancePartitionRefundAdversary (T₀ = T₁, distinct pre-challenge refunds x'₀ ≠ x'₁) break unguardedUnlinkabilityExperiment with Game.advantage = 1, while the cross-branch non-abort guard in unlinkabilityExperiment collapses both attacks to Game.advantage = 0.
  3. Black-box adaptive unlinkability reduction (unlinkabilityExperiment_advantage_le): constructing explicit query-bounded ZK distinguisher zkDistinguisher (≤ 2 + preRounds + challengeSpends queries) and TwoStage hiding reduction unlinkHidingReduction, proving Adv^unlink ≤ 2 * Adv^ZK + 2 * (2 + preRounds + challengeSpends) * Adv^hide (original to this library; [VOLEACT2026] #proof-status leaves the unlinkability proof open). Here the leading factor of 2 arises from Game.advantage_le_two_mul_uniform_bool_xor in the library's [0, 1] two-world advantage convention, and all 2 + preRounds + challengeSpends emitted commitments (reducing to 2 + challengeSpends when preRounds = 0) are replaced sequentially because choosePre chooses client branches adaptively.

Non-black-box G8 → G8.5 CRT witness-reuse decoupling lives in CslibFrontier.Crypto.Protocols.AnonymousToken.CRTDecoupling. As in CRTHazard.lean and CRTDecoupling.lean, all games and reductions here are finite query-bounded constructions (#7068); asymptotic polynomial-time certificates are outside this module's scope.

Main definitions #

Main results #

References #

structure Cslib.Crypto.AnonymousToken.Unlinkability.OpeningCommitment (CommitKey Message Commitment Opening : Type) :

A commitment scheme whose evaluation algorithm eval ck m r is a deterministic function of the commitment key, message, and sampled opening randomness r ← openSample.

  • keyGen : ProbComp CommitKey

    Key generation algorithm outputting a public commitment key.

  • openSample : ProbComp Opening

    Opening-randomness sampler.

  • eval : CommitKey → Message → Opening → Commitment

    Deterministic commitment evaluation from key, message, and opening.

def Cslib.Crypto.AnonymousToken.Unlinkability.OpeningCommitment.toScheme {CommitKey Message C Opening : Type} [DecidableEq C] (Com : OpeningCommitment CommitKey Message C Opening) :
Commitment.Scheme CommitKey Message C Opening

Package an OpeningCommitment as a Commitment.Scheme.

theorem Cslib.Crypto.AnonymousToken.Unlinkability.OpeningCommitment.toScheme_correct {CommitKey Message C Opening : Type} [DecidableEq C] (Com : OpeningCommitment CommitKey Message C Opening) :

Every honest opening emitted by Com.toScheme.commit passes Com.toScheme.verify.

Message committed inside a VOLE-ACT note commitment Com(nf, ctx, t, r).

  • nf : Nullifier

    Note nullifier nf.

  • ctx : Context

    Issuance context ctx.

  • bal : ℕ

    Note credit balance t.

@[instance_reducible]
instance Cslib.Crypto.AnonymousToken.Unlinkability.instDecidableEqCommitMsg {Nullifier✝ Context✝ : Type} [DecidableEq Nullifier✝] [DecidableEq Context✝] :
DecidableEq (CommitMsg Nullifier✝ Context✝)
def Cslib.Crypto.AnonymousToken.Unlinkability.instDecidableEqCommitMsg.decEq {Nullifier✝ Context✝ : Type} [DecidableEq Nullifier✝] [DecidableEq Context✝] (x✝ x✝¹ : CommitMsg Nullifier✝ Context✝) :
Decidable (x✝ = x✝¹)
def Cslib.Crypto.AnonymousToken.Unlinkability.CommitMsg.bumpBal {Nullifier Context : Type} (m : CommitMsg Nullifier Context) :
CommitMsg Nullifier Context

Distinct message obtained by incrementing the note balance by 1, used in binding reductions where two distinct messages must be committed to check collisions.

theorem Cslib.Crypto.AnonymousToken.Unlinkability.CommitMsg.bumpBal_ne {Nullifier Context : Type} (m : CommitMsg Nullifier Context) :

CommitMsg.bumpBal is always distinct from the original message.

Public statement for a VOLE-ACT initial issuance proof ([ZPS26], #issuance).

  • ctx : Context

    Issuance context ctx.

  • c : C

    Token commitment c.

  • t : ℕ

    Agreed initial balance T.

@[instance_reducible]
def Cslib.Crypto.AnonymousToken.Unlinkability.instDecidableEqIssueStmt.decEq {C✝ Context✝ : Type} [DecidableEq C✝] [DecidableEq Context✝] (x✝ x✝¹ : IssueStmt C✝ Context✝) :
Decidable (x✝ = x✝¹)

Secret witness for initial issuance (nf, r) ([ZPS26], #issuance).

  • nf : Nullifier

    Note nullifier nf.

  • r : O

    Commitment opening randomness r.

structure Cslib.Crypto.AnonymousToken.Unlinkability.SpendStmt (PK C Context Nullifier : Type) :

Public statement for a VOLE-ACT spend proof ([ZPS26], #spending).

  • pk : PK

    Issuer verification key pk.

  • ctx : Context

    Context ctx.

  • nf : Nullifier

    Revealed nullifier nf of the spent token.

  • d : ℕ

    Public debit amount d.

  • cPrime : C

    Change token commitment c'.

@[instance_reducible]
instance Cslib.Crypto.AnonymousToken.Unlinkability.instDecidableEqSpendStmt {PK✝ C✝ Context✝ Nullifier✝ : Type} [DecidableEq PK✝] [DecidableEq C✝] [DecidableEq Context✝] [DecidableEq Nullifier✝] :
DecidableEq (SpendStmt PK✝ C✝ Context✝ Nullifier✝)
def Cslib.Crypto.AnonymousToken.Unlinkability.instDecidableEqSpendStmt.decEq {PK✝ C✝ Context✝ Nullifier✝ : Type} [DecidableEq PK✝] [DecidableEq C✝] [DecidableEq Context✝] [DecidableEq Nullifier✝] (x✝ x✝¹ : SpendStmt PK✝ C✝ Context✝ Nullifier✝) :
Decidable (x✝ = x✝¹)

Secret witness for spending (t, r, x, s, nf', t', r') ([ZPS26], #spending).

  • t : ℕ

    Input token balance t.

  • r : O

    Input commitment opening r.

  • x : ℕ

    Input prior refund x (0 after initial issuance).

  • s : Sig

    Issuer signature s on Tag(Com(nf, ctx, t, r), x).

  • nfPrime : Nullifier

    Fresh change nullifier nf'.

  • tPrime : ℕ

    Updated change balance t'.

  • rPrime : O

    Change commitment opening r'.

Combined proof statement for either initial issuance or spending.

Combined proof witness for either initial issuance or spending.

structure Cslib.Crypto.AnonymousToken.Unlinkability.ProofQuery (PK C Context Nullifier O Sig : Type) :

Query passed to the multi-instance ZK proof oracle.

@[reducible, inline]
abbrev Cslib.Crypto.AnonymousToken.Unlinkability.ProofSpec (PK C Context Nullifier O Sig Proof : Type) :
OracleSpec (ProofQuery PK C Context Nullifier O Sig)

Oracle specification returning some π on valid statements and none otherwise.

def Cslib.Crypto.AnonymousToken.Unlinkability.validStatement {CommitKey PK C Context Nullifier O Sig Target SK : Type} [DecidableEq C] (Com : OpeningCommitment CommitKey (CommitMsg Nullifier Context) C O) (tag : C → ℕ → Target) (S : Signature.Scheme PK SK Target Sig) (bound : ℕ) (ck : CommitKey) :
ProofStatement PK C Context Nullifier → ProofWitness O Sig Nullifier → Bool

Boolean statement-witness relation enforcing (V1)–(V4) and issuance range 0 < T < bound ([ZPS26], #issuance and #spending).

structure Cslib.Crypto.AnonymousToken.Unlinkability.ProverSystem (CommitKey PK C Context Nullifier O Sig Proof : Type) :

Prover and simulator pair for the VOLE-ACT issuance/spend ZK proof system.

  • prove : CommitKey → ProofStatement PK C Context Nullifier → ProofWitness O Sig Nullifier → ProbComp Proof

    Real prover algorithm taking commitment key, statement, and witness.

  • simulate : CommitKey → ProofStatement PK C Context Nullifier → ProbComp Proof

    Zero-knowledge simulator taking only commitment key and public statement.

def Cslib.Crypto.AnonymousToken.Unlinkability.realProofOracle {CommitKey PK C Context Nullifier O Sig Target SK Proof : Type} [DecidableEq C] (Com : OpeningCommitment CommitKey (CommitMsg Nullifier Context) C O) (tag : C → ℕ → Target) (S : Signature.Scheme PK SK Target Sig) (bound : ℕ) (sys : ProverSystem CommitKey PK C Context Nullifier O Sig Proof) (ck : CommitKey) (q : ProofQuery PK C Context Nullifier O Sig) :

Real multi-instance ZK oracle returning none when validStatement = false and running sys.prove otherwise.

def Cslib.Crypto.AnonymousToken.Unlinkability.simProofOracle {CommitKey PK C Context Nullifier O Sig Target SK Proof : Type} [DecidableEq C] (Com : OpeningCommitment CommitKey (CommitMsg Nullifier Context) C O) (tag : C → ℕ → Target) (S : Signature.Scheme PK SK Target Sig) (bound : ℕ) (sys : ProverSystem CommitKey PK C Context Nullifier O Sig Proof) (ck : CommitKey) (q : ProofQuery PK C Context Nullifier O Sig) :

Simulated multi-instance ZK oracle returning none when validStatement = false and running sys.simulate on the statement alone otherwise.

noncomputable def Cslib.Crypto.AnonymousToken.Unlinkability.multiProofZKRealGame {CommitKey PK C Context Nullifier O Sig Target SK Proof : Type} [DecidableEq C] (Com : OpeningCommitment CommitKey (CommitMsg Nullifier Context) C O) (tag : C → ℕ → Target) (S : Signature.Scheme PK SK Target Sig) (bound : ℕ) (sys : ProverSystem CommitKey PK C Context Nullifier O Sig Proof) (dist : CommitKey → ProbOracleComp (ProofSpec PK C Context Nullifier O Sig Proof) Bool) :

Real multi-instance ZK distinguishing game.

noncomputable def Cslib.Crypto.AnonymousToken.Unlinkability.multiProofZKSimGame {CommitKey PK C Context Nullifier O Sig Target SK Proof : Type} [DecidableEq C] (Com : OpeningCommitment CommitKey (CommitMsg Nullifier Context) C O) (tag : C → ℕ → Target) (S : Signature.Scheme PK SK Target Sig) (bound : ℕ) (sys : ProverSystem CommitKey PK C Context Nullifier O Sig Proof) (dist : CommitKey → ProbOracleComp (ProofSpec PK C Context Nullifier O Sig Proof) Bool) :

Simulated multi-instance ZK distinguishing game.

Client note state maintained across issuance and spends.

  • nf : Nullifier

    Current note nullifier.

  • bal : ℕ

    Current note balance t.

  • r : O

    Current opening randomness r.

  • com : C

    Current commitment c.

  • ref : ℕ

    Prior issuer refund x (0 immediately after issuance).

  • sig : Sig

    Issuer signature s on Tag(c, ref).

Adversary response to the initial setup query init ck.

  • pk : PK

    Maliciously chosen issuer public key pk.

  • ctx : Context

    Chosen issuance context ctx.

  • t0 : ℕ

    Initial balance T₀ agreed for client 0.

  • t1 : ℕ

    Initial balance T₁ agreed for client 1.

  • st : State

    Adversary state carried into issuance.

Adversary response finalizing both client issuances with (s₀, s₁).

  • s0 : Sig

    Signature on client 0's initial token commitment.

  • s1 : Sig

    Signature on client 1's initial token commitment.

  • st : State

    Updated adversary state.

Adversary pre-challenge spend command selecting client 0 or 1 and debit d.

  • client : Bool

    Target client (false for 0, true for 1).

  • debit : ℕ

    Requested debit amount d.

  • st : State

    Updated adversary state.

Adversary response finalizing a spend with refund x' and signature s'.

  • refund : ℕ

    Refund amount x' chosen by the issuer.

  • sig : Sig

    Signature s' on Tag(c', x').

  • st : State

    Updated adversary state.

Adversary challenge-phase spend command choosing debit d.

  • debit : ℕ

    Requested debit amount d.

  • st : State

    Updated adversary state.

structure Cslib.Crypto.AnonymousToken.Unlinkability.UnlinkAdversary (CommitKey PK Context C Nullifier Proof Sig State : Type) (preRounds challengeSpends : ℕ) :

Adaptive malicious-issuer unlinkability adversary choosing (pk, ctx, T₀, T₁), signing both client issuances, issuing preRounds adaptive pre-challenge spends on chosen clients, executing challengeSpends adaptive challenge-thread spends, and guessing the challenge bit.

  • init : CommitKey → ProbComp (InitOutput PK Context State)

    Setup choice (pk, ctx, T₀, T₁) given commitment key ck.

  • issue : State → C → Proof → C → Proof → ProbComp (IssueResp Sig State)

    FinalizeIssue response given (c₀, π₀) and (c₁, π₁).

  • choosePre : Fin preRounds → State → ProbComp (PreSpendChoice State)

    Select client (false = 0, true = 1) and debit for pre-challenge round i.

  • finalizePre : Fin preRounds → State → Nullifier → ℕ → C → Proof → ProbComp (SpendResp Sig State)

    FinalizeSpend response in pre-challenge round i on (nf, d, c', π').

  • chooseChallenge : Fin challengeSpends → State → ProbComp (ChallengeChoice State)

    Choose debit for challenge spend round j.

  • finalizeChallenge : Fin challengeSpends → State → Nullifier → ℕ → C → Proof → ProbComp (SpendResp Sig State)

    FinalizeSpend response in challenge spend round j on (nf, d, c', π').

  • guess : State → ProbComp Bool

    Final challenge-bit guess b' : Bool.

Non-abort range admissibility test for spending a note with balance/refund (bal, ref) on debit d: requires d ≤ bal + ref, d < bound, and bal + ref - d < bound.

Minimal simulator note state tracking only (nf, bal, ref), without commitment openings or signatures (used by simulator hybrids and TwoStage hiding reductions).

  • nf : Nullifier

    Current note nullifier.

  • bal : ℕ

    Current note credit balance.

  • ref : ℕ

    Current note refund value.

inductive Cslib.Crypto.AnonymousToken.Unlinkability.SimContinuation (PK Context C Nullifier Proof State : Type) (preRounds challengeSpends : ℕ) :

Resumable continuation point right before commitment slot idx is evaluated into cStar.

  • issue0 {PK Context C Nullifier Proof State : Type} {preRounds challengeSpends : ℕ} (b : Bool) (pk : PK) (ctx : Context) (t0 t1 : ℕ) (st : State) (nf0 : Nullifier) : SimContinuation PK Context C Nullifier Proof State preRounds challengeSpends

    Paused immediately before client 0 initial issuance commitment.

  • issue1 {PK Context C Nullifier Proof State : Type} {preRounds challengeSpends : ℕ} (b : Bool) (pk : PK) (ctx : Context) (t0 t1 : ℕ) (st : State) (nf0 : Nullifier) (c0 : C) (pi0 : Proof) (nf1 : Nullifier) : SimContinuation PK Context C Nullifier Proof State preRounds challengeSpends

    Paused immediately before client 1 initial issuance commitment.

  • pre {PK Context C Nullifier Proof State : Type} {preRounds challengeSpends : ℕ} (b : Bool) (pk : PK) (ctx : Context) (note0 note1 : SimNote Nullifier) (cClient : Bool) (d : ℕ) (st : State) (nfPrime : Nullifier) (tPrime i : ℕ) (hi : i < preRounds) : SimContinuation PK Context C Nullifier Proof State preRounds challengeSpends

    Paused immediately before pre-challenge spend i commitment.

  • chal {PK Context C Nullifier Proof State : Type} {preRounds challengeSpends : ℕ} (pk : PK) (ctx : Context) (noteAct : SimNote Nullifier) (balOther refOther : ℕ) (st : State) (d : ℕ) (nfPrime : Nullifier) (tPrime j : ℕ) (hj : j < challengeSpends) : SimContinuation PK Context C Nullifier Proof State preRounds challengeSpends

    Paused immediately before challenge-phase spend j commitment.

  • done {PK Context C Nullifier Proof State : Type} {preRounds challengeSpends : ℕ} (res : Bool) : SimContinuation PK Context C Nullifier Proof State preRounds challengeSpends

    Execution already terminated with final output res.

def Cslib.Crypto.AnonymousToken.Unlinkability.challengeLoopOracle {CommitKey PK C Context Nullifier O Sig Target SK Proof State : Type} (Com : OpeningCommitment CommitKey (CommitMsg Nullifier Context) C O) (nfGen : ProbComp Nullifier) (tag : C → ℕ → Target) (S : Signature.Scheme PK SK Target Sig) (bound : ℕ) {preRounds challengeSpends : ℕ} (adv : UnlinkAdversary CommitKey PK Context C Nullifier Proof Sig State preRounds challengeSpends) (ck : CommitKey) (pk : PK) (ctx : Context) (guardBoth : Bool) (rem : ℕ) (hrem : rem ≤ challengeSpends) (noteAct : ClientNote Nullifier C O Sig) (balOther refOther : ℕ) (st : State) :
ProbOracleComp (ProofSpec PK C Context Nullifier O Sig Proof) Bool

Challenge-spend loop inside ProbOracleComp (ProofSpec ...) Bool.

def Cslib.Crypto.AnonymousToken.Unlinkability.preLoopOracle {CommitKey PK C Context Nullifier O Sig Target SK Proof State : Type} (Com : OpeningCommitment CommitKey (CommitMsg Nullifier Context) C O) (nfGen : ProbComp Nullifier) (tag : C → ℕ → Target) (S : Signature.Scheme PK SK Target Sig) (bound : ℕ) {preRounds challengeSpends : ℕ} (adv : UnlinkAdversary CommitKey PK Context C Nullifier Proof Sig State preRounds challengeSpends) (ck : CommitKey) (pk : PK) (ctx : Context) (guardBoth b : Bool) (rem : ℕ) (hrem : rem ≤ preRounds) (note0 note1 : ClientNote Nullifier C O Sig) (st : State) :
ProbOracleComp (ProofSpec PK C Context Nullifier O Sig Proof) Bool

Adaptive pre-challenge spend loop inside ProbOracleComp (ProofSpec ...) Bool, transitioning into challengeLoopOracle once all preRounds complete.

def Cslib.Crypto.AnonymousToken.Unlinkability.unlinkOracleProgram {CommitKey PK C Context Nullifier O Sig Target SK Proof State : Type} (Com : OpeningCommitment CommitKey (CommitMsg Nullifier Context) C O) (nfGen : ProbComp Nullifier) (tag : C → ℕ → Target) (S : Signature.Scheme PK SK Target Sig) (bound : ℕ) {preRounds challengeSpends : ℕ} (adv : UnlinkAdversary CommitKey PK Context C Nullifier Proof Sig State preRounds challengeSpends) (guardBoth b : Bool) (ck : CommitKey) :
ProbOracleComp (ProofSpec PK C Context Nullifier O Sig Proof) Bool

Oracle-based adaptive unlinkability program queried against ProofOracle.

noncomputable def Cslib.Crypto.AnonymousToken.Unlinkability.unlinkabilityExperiment {CommitKey PK C Context Nullifier O Sig Target SK Proof State : Type} [DecidableEq C] (Com : OpeningCommitment CommitKey (CommitMsg Nullifier Context) C O) (nfGen : ProbComp Nullifier) (tag : C → ℕ → Target) (S : Signature.Scheme PK SK Target Sig) (bound : ℕ) (sys : ProverSystem CommitKey PK C Context Nullifier O Sig Proof) {preRounds challengeSpends : ℕ} (adv : UnlinkAdversary CommitKey PK Context C Nullifier Proof Sig State preRounds challengeSpends) (b : Bool) :

Guarded adaptive malicious-issuer unlinkability experiment (guardBoth = true, cross-branch non-abort check enforced).

noncomputable def Cslib.Crypto.AnonymousToken.Unlinkability.unguardedUnlinkabilityExperiment {CommitKey PK C Context Nullifier O Sig Target SK Proof State : Type} [DecidableEq C] (Com : OpeningCommitment CommitKey (CommitMsg Nullifier Context) C O) (nfGen : ProbComp Nullifier) (tag : C → ℕ → Target) (S : Signature.Scheme PK SK Target Sig) (bound : ℕ) (sys : ProverSystem CommitKey PK C Context Nullifier O Sig Proof) {preRounds challengeSpends : ℕ} (adv : UnlinkAdversary CommitKey PK Context C Nullifier Proof Sig State preRounds challengeSpends) (b : Bool) :

Unguarded adaptive malicious-issuer unlinkability experiment (guardBoth = false, active-branch abort check only, exposing balance-partitioning attacks).

def Cslib.Crypto.AnonymousToken.Unlinkability.balancePartitionInitAdversary {CommitKey PK C Context Nullifier Sig Target Proof : Type} (tag : C → ℕ → Target) (pk : PK) (ctx : Context) (mkSig : Target → Sig) :
UnlinkAdversary CommitKey PK Context C Nullifier Proof Sig Unit 0 1

Negative balance-partitioning adversary with distinct initial balances T₀ = 2, T₁ = 1 and preRounds = 0: requests challenge debit d = 2, succeeding only when b = false.

theorem Cslib.Crypto.AnonymousToken.Unlinkability.balancePartitionInit_unguarded_advantage_eq_one {CommitKey PK C Context Nullifier O Sig Target SK Proof : Type} [DecidableEq C] (Com : OpeningCommitment CommitKey (CommitMsg Nullifier Context) C O) (nfGen : ProbComp Nullifier) (tag : C → ℕ → Target) (S : Signature.Scheme PK SK Target Sig) (bound : ℕ) (sys : ProverSystem CommitKey PK C Context Nullifier O Sig Proof) (hbound : 3 ≤ bound) (pk : PK) (ctx : Context) (mkSig : Target → Sig) (hmksig : ∀ (t : Target), S.verify pk t (mkSig t) = true) :
(unguardedUnlinkabilityExperiment Com nfGen tag S bound sys (balancePartitionInitAdversary tag pk ctx mkSig) false).advantage (unguardedUnlinkabilityExperiment Com nfGen tag S bound sys (balancePartitionInitAdversary tag pk ctx mkSig) true) = 1

Without the cross-branch non-abort guard, balancePartitionInitAdversary achieves unlinkability advantage 1 whenever bound ≥ 3 and mkSig produces valid signatures under pk.

theorem Cslib.Crypto.AnonymousToken.Unlinkability.balancePartitionInit_guarded_advantage_eq_zero {CommitKey PK C Context Nullifier O Sig Target SK Proof : Type} [DecidableEq C] (Com : OpeningCommitment CommitKey (CommitMsg Nullifier Context) C O) (nfGen : ProbComp Nullifier) (tag : C → ℕ → Target) (S : Signature.Scheme PK SK Target Sig) (bound : ℕ) (sys : ProverSystem CommitKey PK C Context Nullifier O Sig Proof) (hbound : 3 ≤ bound) (pk : PK) (ctx : Context) (mkSig : Target → Sig) (hmksig : ∀ (t : Target), S.verify pk t (mkSig t) = true) :
(unlinkabilityExperiment Com nfGen tag S bound sys (balancePartitionInitAdversary tag pk ctx mkSig) false).advantage (unlinkabilityExperiment Com nfGen tag S bound sys (balancePartitionInitAdversary tag pk ctx mkSig) true) = 0

With the cross-branch non-abort guard enabled, balancePartitionInitAdversary aborts identically in both worlds and achieves unlinkability advantage 0.

def Cslib.Crypto.AnonymousToken.Unlinkability.balancePartitionRefundAdversary {CommitKey PK C Context Nullifier Sig Target Proof : Type} (tag : C → ℕ → Target) (pk : PK) (ctx : Context) (mkSig : Target → Sig) :
UnlinkAdversary CommitKey PK Context C Nullifier Proof Sig Unit 2 1

Negative balance-partitioning adversary with equal initial balances T₀ = T₁ = 2 and preRounds = 2: pre-spend 0 gives client 0 refund 2 (bal + ref = 3), pre-spend 1 gives client 1 refund 0 (bal + ref = 1), and challenge spend requests debit 2.

theorem Cslib.Crypto.AnonymousToken.Unlinkability.balancePartitionRefund_unguarded_advantage_eq_one {CommitKey PK C Context Nullifier O Sig Target SK Proof : Type} [DecidableEq C] (Com : OpeningCommitment CommitKey (CommitMsg Nullifier Context) C O) (nfGen : ProbComp Nullifier) (tag : C → ℕ → Target) (S : Signature.Scheme PK SK Target Sig) (bound : ℕ) (sys : ProverSystem CommitKey PK C Context Nullifier O Sig Proof) (hbound : 5 ≤ bound) (pk : PK) (ctx : Context) (mkSig : Target → Sig) (hmksig : ∀ (t : Target), S.verify pk t (mkSig t) = true) :
(unguardedUnlinkabilityExperiment Com nfGen tag S bound sys (balancePartitionRefundAdversary tag pk ctx mkSig) false).advantage (unguardedUnlinkabilityExperiment Com nfGen tag S bound sys (balancePartitionRefundAdversary tag pk ctx mkSig) true) = 1

Even when T₀ = T₁, omitting the cross-branch non-abort guard lets balancePartitionRefundAdversary achieve advantage 1 whenever bound ≥ 5.

theorem Cslib.Crypto.AnonymousToken.Unlinkability.balancePartitionRefund_guarded_advantage_eq_zero {CommitKey PK C Context Nullifier O Sig Target SK Proof : Type} [DecidableEq C] (Com : OpeningCommitment CommitKey (CommitMsg Nullifier Context) C O) (nfGen : ProbComp Nullifier) (tag : C → ℕ → Target) (S : Signature.Scheme PK SK Target Sig) (bound : ℕ) (sys : ProverSystem CommitKey PK C Context Nullifier O Sig Proof) (hbound : 5 ≤ bound) (pk : PK) (ctx : Context) (mkSig : Target → Sig) (hmksig : ∀ (t : Target), S.verify pk t (mkSig t) = true) :
(unlinkabilityExperiment Com nfGen tag S bound sys (balancePartitionRefundAdversary tag pk ctx mkSig) false).advantage (unlinkabilityExperiment Com nfGen tag S bound sys (balancePartitionRefundAdversary tag pk ctx mkSig) true) = 0

With the cross-branch non-abort guard enabled, balancePartitionRefundAdversary also aborts identically in both worlds and achieves unlinkability advantage 0.

noncomputable def Cslib.Crypto.AnonymousToken.Unlinkability.zkDistinguisher {CommitKey PK C Context Nullifier O Sig Target SK Proof State : Type} (Com : OpeningCommitment CommitKey (CommitMsg Nullifier Context) C O) (nfGen : ProbComp Nullifier) (tag : C → ℕ → Target) (S : Signature.Scheme PK SK Target Sig) (bound : ℕ) {preRounds challengeSpends : ℕ} (adv : UnlinkAdversary CommitKey PK Context C Nullifier Proof Sig State preRounds challengeSpends) (ck : CommitKey) :
ProbOracleComp (ProofSpec PK C Context Nullifier O Sig Proof) Bool

Explicit multi-instance ZK distinguisher for the adaptive unlinkability reduction (concrete query-bounded step, #7068): draws a uniform challenge bit b ← Bool, runs unlinkOracleProgram on b, and tests whether the adversary's output equals b (giving the factor of 2 via Game.advantage_le_two_mul_uniform_bool_xor).

theorem Cslib.Crypto.AnonymousToken.Unlinkability.zkDistinguisher_isQueryBounded {CommitKey PK C Context Nullifier O Sig Target SK Proof State : Type} (Com : OpeningCommitment CommitKey (CommitMsg Nullifier Context) C O) (nfGen : ProbComp Nullifier) (tag : C → ℕ → Target) (S : Signature.Scheme PK SK Target Sig) (bound : ℕ) {preRounds challengeSpends : ℕ} (adv : UnlinkAdversary CommitKey PK Context C Nullifier Proof Sig State preRounds challengeSpends) (ck : CommitKey) :
(zkDistinguisher Com nfGen tag S bound adv ck).IsQueryBounded (2 + preRounds + challengeSpends)

zkDistinguisher makes at most 2 + preRounds + challengeSpends calls to ProofOracle.

structure Cslib.Crypto.AnonymousToken.Unlinkability.UnlinkHidingState (CommitKey PK Context C Nullifier Proof State : Type) (preRounds challengeSpends : ℕ) :

Private state preserved across the two stages of unlinkHidingReduction.

  • ck : CommitKey

    Commitment key ck.

  • dummyNf : Nullifier

    Sampled dummy nullifier used across dummy-message commitment slots.

  • b : Bool

    Sampled challenge bit b.

  • hop : Fin (2 + preRounds + challengeSpends)

    Sampled commitment hybrid slot hop.

  • cont : SimContinuation PK Context C Nullifier Proof State preRounds challengeSpends

    Continuation frozen immediately before commitment slot hop.

noncomputable def Cslib.Crypto.AnonymousToken.Unlinkability.unlinkHidingReduction {CommitKey PK C Context Nullifier O Sig Target SK Proof State : Type} {preRounds challengeSpends : ℕ} (Com : OpeningCommitment CommitKey (CommitMsg Nullifier Context) C O) (nfGen : ProbComp Nullifier) (tag : C → ℕ → Target) (S : Signature.Scheme PK SK Target Sig) (bound : ℕ) (sys : ProverSystem CommitKey PK C Context Nullifier O Sig Proof) (adv : UnlinkAdversary CommitKey PK Context C Nullifier Proof Sig State preRounds challengeSpends) :
TwoStage CommitKey (MessagePair (CommitMsg Nullifier Context)) C Bool (UnlinkHidingState CommitKey PK Context C Nullifier Proof State preRounds challengeSpends)

Explicit TwoStage commitment-hiding reduction for the adaptive unlinkability reduction (concrete query-bounded step, #7068): samples dummyNf ← nfGen, uniform challenge bit b ← Bool, and random commitment hybrid slot hop ← Fin (2 + preRounds + challengeSpends), runs the simulator up to hop, submits (msgReal, msgDummy) to Com.toScheme, and tests whether the resumed adversary guesses b.

theorem Cslib.Crypto.AnonymousToken.Unlinkability.unlinkabilityExperiment_advantage_le {CommitKey PK C Context Nullifier O Sig Target SK Proof State : Type} [DecidableEq C] {preRounds challengeSpends : ℕ} (Com : OpeningCommitment CommitKey (CommitMsg Nullifier Context) C O) (nfGen : ProbComp Nullifier) (tag : C → ℕ → Target) (S : Signature.Scheme PK SK Target Sig) (bound : ℕ) (sys : ProverSystem CommitKey PK C Context Nullifier O Sig Proof) (adv : UnlinkAdversary CommitKey PK Context C Nullifier Proof Sig State preRounds challengeSpends) :
↑((unlinkabilityExperiment Com nfGen tag S bound sys adv false).advantage (unlinkabilityExperiment Com nfGen tag S bound sys adv true)) ≤ 2 * ↑((multiProofZKRealGame Com tag S bound sys (zkDistinguisher Com nfGen tag S bound adv)).advantage (multiProofZKSimGame Com tag S bound sys (zkDistinguisher Com nfGen tag S bound adv))) + 2 * ↑(2 + preRounds + challengeSpends) * ↑((Com.toScheme.hidingExperiment (unlinkHidingReduction Com nfGen tag S bound sys adv) false).advantage (Com.toScheme.hidingExperiment (unlinkHidingReduction Com nfGen tag S bound sys adv) true))

Adaptive malicious-issuer unlinkability reduction step (#7068), original to this library as a finite query-bounded bound for [VOLEACT2026] (#issuance and #spending; [VOLEACT2026] #proof-status leaves unlinkability open): for any adaptive adversary adv against unlinkabilityExperiment, Adv^unlink ≤ 2 * Adv^ZK + 2 * (2 + preRounds + challengeSpends) * Adv^hide via zkDistinguisher and unlinkHidingReduction. When preRounds = 0, the hiding factor specializes directly to 2 * (2 + challengeSpends). The leading factor of 2 converts the [0, 1] two-world Game.advantage into [0, 1/2] bit-guessing bias via Game.advantage_le_two_mul_uniform_bool_xor, and replacing all 2 + preRounds + challengeSpends emitted commitments sequentially via Game.advantage_hybrid_average avoids guessing which pre-challenge spend terminates each client's branch under adaptive choosePre (asymptotic certificates remain open under #7068).