Documentation

CslibFrontier.Crypto.Protocols.AnonymousToken.KP800Layout

KP800 state layout, domain separation, and ideal-permutation commitment bounds for VOLE-ACT #

This module formalizes the 100-byte (800-bit) single-permutation, truncated-output Keccak-p (KP800) input-block layouts specified in VOLE-ACT (#kp800-commitment and #kp800-tag) and specializes the generic ideal-permutation commitment bounds from Cslib.Crypto.Protocols.Commitment.IdealPerm to both the draft's fixed-slot encoding and a contiguous-packed parameter-family variant.

Commitment and tag state encodings #

A KP800 state FixedBytes 100 (800 bits) splits via kp800StateSplitEquiv into a 32-byte (256-bit) output digest FixedBytes 32 and a 68-byte (544-bit) discarded tail FixedBytes 68. This file treats two distinct 100-byte commitment block layouts:

Scope and gaps #

Main definitions #

Main results #

References #

Byte-length budget partitioning a 100-byte (800-bit) KP800 commitment input block into a 7-byte DST/version header ("rata" || ver || "c0"), opening r, variable fields (ctx, t, nf), and total zero-padding padLen.

  • ver : Byte

    Protocol version byte ver appearing at index 4 of the 7-byte DST header.

  • rLen : ℕ

    Length in bytes of the commitment opening r.

  • nfLen : ℕ

    Length in bytes of the nullifier nf.

  • ctxLen : ℕ

    Length in bytes of the context string ctx.

  • lLen : ℕ

    Length in bytes of the tag or credit-value field t.

  • padLen : ℕ

    Total number of zero-padding bytes in the 100-byte commitment block.

  • htotal : 7 + self.rLen + self.nfLen + self.ctxLen + self.lLen + self.padLen = 100

    Exact 100-byte (800-bit) block conservation invariant.

Number of variable-field bytes (nfLen + ctxLen + lLen) placed in the 68-byte slot of the draft KP800 commitment layout.

Number of reserved constant bytes (7-byte DST header plus padLen zero-padding bytes).

Default KP800 commitment parameters from [VOLEACT2026] (rLen = 16, nfLen = 24, ctxLen = 16, lLen = 8, padLen = 29).

In-slot KP800 commitment variant widening the opening to rLen = 20 bytes (160 bits) within the draft's 25-byte opening slot.

Hypothetical re-layout widening the opening to rLen = 26 bytes (208 bits), exceeding the draft's 25-byte opening slot (padLen = 19).

Hypothetical re-layout widening the opening to rLen = 32 bytes (256 bits), exceeding the draft's 25-byte opening slot and leaving padLen = 13 padding bytes.

theorem Cslib.Crypto.AnonymousToken.kp800_rLen_lt_or_padLen_lt (cfg : ComBudgetConfig) (hnf : cfg.nfLen = 24) (hctx : cfg.ctxLen = 16) (hl : cfg.lLen = 8) :
cfg.rLen < 32 ∨ cfg.padLen < 16

Under nfLen = 24, ctxLen = 16, lLen = 8 (rLen + padLen = 45), any 100-byte KP800 commitment configuration satisfies either rLen < 32 (< 256 opening bits) or padLen < 16 (< 128 zero-padding bits), because 32 + 16 = 48 > 45.

7-byte KP800 domain-separation prefix "rata" || ver || tag || "0".

7-byte KP800 commitment DST "rata" || ver || "c0".

7-byte KP800 tag DST "rata" || ver || "t0".

structure Cslib.Crypto.AnonymousToken.ComInput (ctxLen lLen nfLen : ℕ) :

Message inputs (ctx, t, nf) committed inside a KP800 commitment block.

def Cslib.Crypto.AnonymousToken.instDecidableEqComInput.decEq {ctxLen✝ lLen✝ nfLen✝ : ℕ} (x✝ x✝¹ : ComInput ctxLen✝ lLen✝ nfLen✝) :
Decidable (x✝ = x✝¹)
@[instance_reducible]
instance Cslib.Crypto.AnonymousToken.instDecidableEqComInput {ctxLen✝ lLen✝ nfLen✝ : ℕ} :
DecidableEq (ComInput ctxLen✝ lLen✝ nfLen✝)

Draft fixed-slot KP800 commitment byte list (#kp800-commitment): "rata" || ver || "c0" || r || 0^(25 - rLen) || ctx || t || nf || 0^(68 - variableBytes).

theorem Cslib.Crypto.AnonymousToken.length_comSlotBytes (cfg : ComBudgetConfig) (hr : cfg.rLen ≤ 25) (hv : cfg.variableBytes ≤ 68) (r : FixedBytes cfg.rLen) (ctx : FixedBytes cfg.ctxLen) (t : FixedBytes cfg.lLen) (nf : FixedBytes cfg.nfLen) :
(comSlotBytes cfg r ctx t nf).length = 100

Any draft fixed-slot KP800 commitment block with rLen ≤ 25 and variableBytes ≤ 68 has exact length 100 bytes.

def Cslib.Crypto.AnonymousToken.comSlotState (cfg : ComBudgetConfig) (hr : cfg.rLen ≤ 25) (hv : cfg.variableBytes ≤ 68) (r : FixedBytes cfg.rLen) (ctx : FixedBytes cfg.ctxLen) (t : FixedBytes cfg.lLen) (nf : FixedBytes cfg.nfLen) :

Draft fixed-slot KP800 commitment permutation state in FixedBytes 100.

theorem Cslib.Crypto.AnonymousToken.comSlotState_inj (cfg : ComBudgetConfig) (hr : cfg.rLen ≤ 25) (hv : cfg.variableBytes ≤ 68) (r₁ r₂ : FixedBytes cfg.rLen) (ctx₁ ctx₂ : FixedBytes cfg.ctxLen) (t₁ t₂ : FixedBytes cfg.lLen) (nf₁ nf₂ : FixedBytes cfg.nfLen) (h : comSlotState cfg hr hv r₁ ctx₁ t₁ nf₁ = comSlotState cfg hr hv r₂ ctx₂ t₂ nf₂) :
r₁ = r₂ ∧ ctx₁ = ctx₂ ∧ t₁ = t₂ ∧ nf₁ = nf₂

comSlotState is jointly injective in (r, ctx, t, nf) when rLen ≤ 25 and variableBytes ≤ 68.

Generalized contiguous-packed KP800 commitment byte list for arbitrary ComBudgetConfig: "rata" || ver || "c0" || r || ctx || t || nf || 0^padLen.

Any generalized KP800 commitment byte list has exact length 100 bytes.

Generalized contiguous-packed KP800 commitment permutation state in FixedBytes 100.

theorem Cslib.Crypto.AnonymousToken.comBudgetState_inj (cfg : ComBudgetConfig) (r₁ r₂ : FixedBytes cfg.rLen) (ctx₁ ctx₂ : FixedBytes cfg.ctxLen) (t₁ t₂ : FixedBytes cfg.lLen) (nf₁ nf₂ : FixedBytes cfg.nfLen) (h : comBudgetState cfg r₁ ctx₁ t₁ nf₁ = comBudgetState cfg r₂ ctx₂ t₂ nf₂) :
r₁ = r₂ ∧ ctx₁ = ctx₂ ∧ t₁ = t₂ ∧ nf₁ = nf₂

comBudgetState is jointly injective in (r, ctx, t, nf) for every ComBudgetConfig.

theorem Cslib.Crypto.AnonymousToken.comSlotState_ne_comBudgetState (cfg : ComBudgetConfig) (hr : cfg.rLen ≤ 25) (hv : cfg.variableBytes ≤ 68) (hlt : cfg.rLen < 25) (hctxPos : 0 < cfg.ctxLen) (r : FixedBytes cfg.rLen) (ctx : FixedBytes cfg.ctxLen) (t : FixedBytes cfg.lLen) (nf : FixedBytes cfg.nfLen) (hnz : ctx ⟨0, hctxPos⟩ ≠ 0) :
comSlotState cfg hr hv r ctx t nf ≠ comBudgetState cfg r ctx t nf

When rLen < 25 and ctx has a nonzero first byte, comSlotState and comBudgetState differ because comSlotState places zero padding between r and ctx.

KP800 tag input byte list ([VOLEACT2026], #kp800-tag): "rata" || ver || "t0" || 0^25 || c || <x>_L || 0^(36 - L).

theorem Cslib.Crypto.AnonymousToken.length_tagBytes (ver : Byte) {L : ℕ} (hL : L ≤ 36) (c : FixedBytes 32) (x : FixedBytes L) :
(tagBytes ver c x).length = 100

Any KP800 tag block with L ≤ 36 has exact length 100 bytes (7 + 25 + 32 + L + (36 - L) = 100).

def Cslib.Crypto.AnonymousToken.tagState (ver : Byte) {L : ℕ} (hL : L ≤ 36) (c : FixedBytes 32) (x : FixedBytes L) :

KP800 tag permutation state in FixedBytes 100.

theorem Cslib.Crypto.AnonymousToken.tagState_inj (ver : Byte) {L : ℕ} (hL : L ≤ 36) (c₁ c₂ : FixedBytes 32) (x₁ x₂ : FixedBytes L) (h : tagState ver hL c₁ x₁ = tagState ver hL c₂ x₂) :
c₁ = c₂ ∧ x₁ = x₂

tagState is jointly injective in (c, x) when L ≤ 36.

theorem Cslib.Crypto.AnonymousToken.comSlotState_ne_tagState (cfg : ComBudgetConfig) (hr : cfg.rLen ≤ 25) (hv : cfg.variableBytes ≤ 68) (r : FixedBytes cfg.rLen) (ctx : FixedBytes cfg.ctxLen) (t : FixedBytes cfg.lLen) (nf : FixedBytes cfg.nfLen) (ver₂ : Byte) {L : ℕ} (hL : L ≤ 36) (c : FixedBytes 32) (x : FixedBytes L) :
comSlotState cfg hr hv r ctx t nf ≠ tagState ver₂ hL c x

Commitment blocks in the draft slot layout are disjoint from all KP800 tag blocks at byte index 5 ('c' ≠ 't').

theorem Cslib.Crypto.AnonymousToken.comBudgetState_ne_tagState (cfg : ComBudgetConfig) (r : FixedBytes cfg.rLen) (ctx : FixedBytes cfg.ctxLen) (t : FixedBytes cfg.lLen) (nf : FixedBytes cfg.nfLen) (ver₂ : Byte) {L : ℕ} (hL : L ≤ 36) (c : FixedBytes 32) (x : FixedBytes L) :
comBudgetState cfg r ctx t nf ≠ tagState ver₂ hL c x

Generalized commitment blocks are disjoint from all KP800 tag blocks at byte index 5 ('c' ≠ 't').

Equivalence splitting a 100-byte KP800 state into its 32-byte digest prefix and 68-byte discarded tail.

PermCommitmentSpec for the draft fixed-slot KP800 commitment encoding (comSlotState).

PermCommitmentSpec for the generalized contiguous-packed KP800 commitment encoding (comBudgetState).

noncomputable def Cslib.Crypto.AnonymousToken.validComSlotStates (cfg : ComBudgetConfig) (hr : cfg.rLen ≤ 25) (hv : cfg.variableBytes ≤ 68) :

Finset of all valid draft fixed-slot KP800 commitment input blocks in FixedBytes 100.

Finset of all valid generalized KP800 commitment input blocks in FixedBytes 100.

noncomputable def Cslib.Crypto.AnonymousToken.validTagStates (ver : Byte) {L : ℕ} (hL : L ≤ 36) :

Finset of all valid KP800 tag input blocks in FixedBytes 100 for refund length L ≤ 36.

Exact cardinality 2 ^ (8 * (rLen + variableBytes)) of valid draft fixed-slot KP800 commitment input states.

Exact cardinality 2 ^ (8 * (rLen + variableBytes)) of valid generalized KP800 commitment input states.

When rLen ≤ 25 and variableBytes ≤ 68, the valid state sets of comSlotState and comBudgetState have the exact same cardinality 2 ^ (8 * (rLen + variableBytes)).

theorem Cslib.Crypto.AnonymousToken.card_validTagStates (ver : Byte) {L : ℕ} (hL : L ≤ 36) :
(validTagStates ver hL).card = 2 ^ (8 * (32 + L))

Exact cardinality 2 ^ (8 * (32 + L)) of valid KP800 tag input states.

Bidirectional ideal-permutation static hiding bound for the draft fixed-slot KP800 commitment encoding: any Q-query adversary has advantage at most 2 * Q * ((2 ^ (8 * rLen))⁻¹ + (2 ^ 544)⁻¹) for fixed (m₀, m₁) chosen before queries.

Bidirectional ideal-permutation static hiding bound for the generalized KP800 commitment encoding (comBudgetState), covering parameter re-layouts with rLen > 25 as well.

Bidirectional ideal-permutation fixed-target preimage bound for the draft fixed-slot KP800 commitment encoding: any adversary making Q_fwd forward and Q_inv inverse queries outputs a valid input hitting a fixed digest cStar with probability at most ((Q_fwd + 1) * 2^544 + Q_inv * 2^(8 * (rLen + variableBytes))) / (2^800 - (Q_fwd + Q_inv + 1)). This does not address collision binding.

Bidirectional ideal-permutation fixed-target preimage bound for the generalized KP800 commitment encoding (comBudgetState), covering rLen > 25 parameter re-layouts as well. This does not address collision binding.