Documentation

CslibFrontier.Crypto.Protocols.AnonymousToken.Basic

Certification of anonymous-token witnesses #

A token certifies a target computed from a semantic message and an opening. The certification algorithm is the existing Signature.Scheme: it may be an ordinary signature, or a raw trapdoor-preimage relation whose verifier tests that its public map evaluates to the target. selectedIssuerRelation is the witness relation used when an IHAT redemption hides which issuer signed its target ([ZP26], Protocol / Redemption, RedeemRelation). Its bounded issuer index compresses the source's one-hot selector; it does not model the selector circuit. For ACT the semantic message is the full credit state, including the refund, and the target may be Tag (Com state opening) refund ([ZPS26], Overview and Protocol Specification / Tag).

extractedExperiment gives the adversary chosen semantic messages and openings and requires an actual certifying witness for a fresh semantic message. targetForger forwards each signing query once; bindingReduction searches the query transcript and returns two different semantic messages encoding to the same target. extracted_succProbability_le proves the additive bound with coefficient one on both terms, and targetForger_queryBound preserves the signing-query budget. These are explicit programs, without a hypothesis about a reduction's success.

This is an original extracted-witness composition step, not the full security theorem of either protocol. In particular, the target EUF-CMA term need not be small for a raw UOV map: unrestricted chosen-target forgery is different from the random-target one-more assumption. Applying this composition to raw ACT-MQ therefore does not establish its structured-target hardness. Adaptive VOLE/random-oracle extraction and complete runtime certificates remain tracked in issue #7068.

Main definitions #

Main results #

References #

structure Cslib.Crypto.AnonymousToken.Payload (Message Opening : Type) :

A semantic message and the randomness opening its encoded target.

  • message : Message

    The state or message whose authorization is meaningful to the application.

  • opening : Opening

    The opening supplied to the target encoder.

@[instance_reducible]
instance Cslib.Crypto.AnonymousToken.instDecidableEqPayload {Message✝ Opening✝ : Type} [DecidableEq Message✝] [DecidableEq Opening✝] :
DecidableEq (Payload Message✝ Opening✝)
def Cslib.Crypto.AnonymousToken.instDecidableEqPayload.decEq {Message✝ Opening✝ : Type} [DecidableEq Message✝] [DecidableEq Opening✝] (x✝ x✝¹ : Payload Message✝ Opening✝) :
Decidable (x✝ = x✝¹)
structure Cslib.Crypto.AnonymousToken.Token (Message Opening Sig : Type) :

A target opening together with its certification witness.

  • payload : Payload Message Opening

    The semantic message and its opening.

  • signature : Sig

    A signature, or a preimage when the certifier is a trapdoor map.

@[instance_reducible]
instance Cslib.Crypto.AnonymousToken.instDecidableEqToken {Message✝ Opening✝ Sig✝ : Type} [DecidableEq Message✝] [DecidableEq Opening✝] [DecidableEq Sig✝] :
DecidableEq (Token Message✝ Opening✝ Sig✝)
def Cslib.Crypto.AnonymousToken.instDecidableEqToken.decEq {Message✝ Opening✝ Sig✝ : Type} [DecidableEq Message✝] [DecidableEq Opening✝] [DecidableEq Sig✝] (x✝ x✝¹ : Token Message✝ Opening✝ Sig✝) :
Decidable (x✝ = x✝¹)
def Cslib.Crypto.AnonymousToken.Token.valid {PK SK Message Opening Target Sig : Type} (S : Signature.Scheme PK SK Target Sig) (target : Message → Opening → Target) (pk : PK) (token : Token Message Opening Sig) :

Check the certifier on the target encoded by this token.

def Cslib.Crypto.AnonymousToken.issue {PK SK Message Opening Target Sig : Type} (S : Signature.Scheme PK SK Target Sig) (target : Message → Opening → Target) (sk : SK) (payload : Payload Message Opening) :
ProbComp (Token Message Opening Sig)

Issue a token by signing its encoded target. This operation does not supply a proof system.

theorem Cslib.Crypto.AnonymousToken.issue_correct {PK SK Message Opening Target Sig : Type} (S : Signature.Scheme PK SK Target Sig) (target : Message → Opening → Target) (hS : S.Correct) {keys : PK × SK} (hkeys : keys ∈ S.keyGen.eval.support) (payload : Payload Message Opening) {token : Token Message Opening Sig} (htoken : token ∈ (issue S target keys.2 payload).eval.support) :
Token.valid S target keys.1 token = true

Correct certification gives a valid issued token at every supported key pair.

structure Cslib.Crypto.AnonymousToken.RedemptionWitness (Issuer Opening Sig : Type) :

The private witness of an issuer-hidden redemption. Its issuer selector is bounded by the public anchor type, rather than an unchecked natural-number index.

  • issuer : Issuer

    Which public issuer key certifies the hidden target.

  • opening : Opening

    The opening of the public semantic message's encoded target.

  • signature : Sig

    Certification witness under the selected key.

def Cslib.Crypto.AnonymousToken.selectedIssuerRelation {PK SK Message Opening Target Sig Issuer : Type} (S : Signature.Scheme PK SK Target Sig) (target : Message → Opening → Target) (anchors : Issuer → PK) (message : Message) (witness : RedemptionWitness Issuer Opening Sig) :

The selected-issuer witness relation of extracted IHAT redemption. A proof of this relation must hide witness; this definition does not claim zero knowledge or extractability.

@[reducible, inline]
abbrev Cslib.Crypto.AnonymousToken.ExtractedForger (PK Message Opening Sig : Type) :

An adversary already producing the semantic opening and certification witness. It may choose both the message and opening of every signing request.

structure Cslib.Crypto.AnonymousToken.Execution (PK Message Opening Sig : Type) :

The public key, candidate witness, and ordered signing transcript of an extracted attack.

  • publicKey : PK

    Public certification key sampled by the experiment.

  • output : Token Message Opening Sig

    Candidate output by the attack.

  • log : List (Payload Message Opening × Sig)

    Every semantic signing query and its reply, including repetitions and invalid replies.

def Cslib.Crypto.AnonymousToken.runExtracted {PK SK Message Opening Target Sig : Type} (S : Signature.Scheme PK SK Target Sig) (target : Message → Opening → Target) (A : ExtractedForger PK Message Opening Sig) :
ProbComp (Execution PK Message Opening Sig)

Execute the extracted attack with the real target signer, retaining all queries and replies.

def Cslib.Crypto.AnonymousToken.extractedAccept {PK SK Message Opening Target Sig : Type} [DecidableEq Message] (S : Signature.Scheme PK SK Target Sig) (target : Message → Opening → Target) (run : Execution PK Message Opening Sig) :

Whether an extracted execution verifies on a semantic message never queried in run.log. Invalid or failed replies remain in the log and still disqualify their semantic messages.

def Cslib.Crypto.AnonymousToken.extractedExperiment {PK SK Message Opening Target Sig : Type} [DecidableEq Message] (S : Signature.Scheme PK SK Target Sig) (target : Message → Opening → Target) (A : ExtractedForger PK Message Opening Sig) :

The structured-target extracted-witness experiment: the output verifies and its full semantic message was never queried. Invalid replies remain in the log. ACT freshness concerns the entire state, including the refund.

Two openings to the same encoded target, with different semantic messages.

  • first : Payload Message Opening

    One message and its opening.

  • second : Payload Message Opening

    The other message and its opening.

def Cslib.Crypto.AnonymousToken.instDecidableEqBindingWitness.decEq {Message✝ Opening✝ : Type} [DecidableEq Message✝] [DecidableEq Opening✝] (x✝ x✝¹ : BindingWitness Message✝ Opening✝) :
Decidable (x✝ = x✝¹)
@[instance_reducible]
instance Cslib.Crypto.AnonymousToken.instDecidableEqBindingWitness {Message✝ Opening✝ : Type} [DecidableEq Message✝] [DecidableEq Opening✝] :
DecidableEq (BindingWitness Message✝ Opening✝)
def Cslib.Crypto.AnonymousToken.checkBindingWitness {Message Opening Target : Type} [DecidableEq Message] [DecidableEq Target] (target : Message → Opening → Target) (witness : BindingWitness Message Opening) :

Verify a binding witness for the complete target encoding.

def Cslib.Crypto.AnonymousToken.findBindingWitness {Message Opening Target Sig : Type} [DecidableEq Target] (target : Message → Opening → Target) (payload : Payload Message Opening) (log : List (Payload Message Opening × Sig)) :
Option (BindingWitness Message Opening)

Search the actual transcript for the first request sharing the candidate's target. The result is a candidate binding witness; checkBindingWitness also checks that its messages differ.

def Cslib.Crypto.AnonymousToken.bindingReduction {PK SK Message Opening Target Sig : Type} [DecidableEq Target] (S : Signature.Scheme PK SK Target Sig) (target : Message → Opening → Target) (A : ExtractedForger PK Message Opening Sig) :
ProbComp (Option (BindingWitness Message Opening))

An explicit binding attack: run the extracted attack with a locally generated signing key, then return two openings if its output reuses a queried target.

def Cslib.Crypto.AnonymousToken.bindingExperiment {PK SK Message Opening Target Sig : Type} [DecidableEq Message] [DecidableEq Target] (S : Signature.Scheme PK SK Target Sig) (target : Message → Opening → Target) (A : ExtractedForger PK Message Opening Sig) :

Run and check the binding attack's actual returned witness.

def Cslib.Crypto.AnonymousToken.targetForger {PK Message Opening Target Sig : Type} (target : Message → Opening → Target) (A : ExtractedForger PK Message Opening Sig) :
Signature.Forger PK Target Sig

Forward each semantic signing request to the certification target, preserving private coins, and output the target and certificate from the extracted candidate.

theorem Cslib.Crypto.AnonymousToken.targetForger_queryBound {PK Message Opening Target Sig : Type} (target : Message → Opening → Target) (A : ExtractedForger PK Message Opening Sig) (pk : PK) {q : ℕ} (hA : (A pk).IsQueryBounded q) :

The target reduction uses at most q signing calls when its input attack uses at most q. No runtime bound or fair-coin efficiency follows from this oracle-call bound alone.

theorem Cslib.Crypto.AnonymousToken.execution_log_length_le {PK SK Message Opening Target Sig : Type} (S : Signature.Scheme PK SK Target Sig) (target : Message → Opening → Target) (A : ExtractedForger PK Message Opening Sig) {q : ℕ} (hA : ∀ (pk : PK), (A pk).IsQueryBounded q) {run : Execution PK Message Opening Sig} (hrun : run ∈ (runExtracted S target A).eval.support) :
run.log.length ≤ q

A q-query attack leaves at most q entries for the binding search, including repeated requests. This bounds the search's input length without treating target evaluation as free time.

theorem Cslib.Crypto.AnonymousToken.extracted_succProbability_le {PK SK Message Opening Target Sig : Type} [DecidableEq Message] [DecidableEq Target] [Inhabited Sig] (S : Signature.Scheme PK SK Target Sig) (target : Message → Opening → Target) (A : ExtractedForger PK Message Opening Sig) :

Explicit extracted-witness composition: a fresh semantic authorization yields either a fresh target certificate or two differently messaged openings to the same target. The success loss is additive with coefficient one on both explicit reductions. This does not assert that either right-hand game is hard for a particular target family.