Skip to content

refactor(verify): collapse DleqLocation into a unit DleqInvalid#16

Merged
orveth merged 1 commit into
mainfrom
chore/drop-input-dleq
Jun 10, 2026
Merged

refactor(verify): collapse DleqLocation into a unit DleqInvalid#16
orveth merged 1 commit into
mainfrom
chore/drop-input-dleq

Conversation

@orveth

@orveth orveth commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Aligns the charge contract's DLEQ type with draft-cashu-charge-01 §security-dleq (latest spec, 9e3f973): the server verifies DLEQ only on the swap-returned signatures, never on presented input proofs (the swap is the authoritative oracle). pops already behaved this way — this drops the vestigial DleqLocation::InputProof scaffold so the type expresses the single check performed.

Type-level only — zero behavior change. Verified preserved:

  • swap-output DLEQ gate (swap_ceremony::verify_swap_output_dleq) — untouched (not in the diff)
  • SwapOutputDleqInvalid → DleqInvalid → verification-failed / 402 / resource-not-served
  • wasm charge_error_code still emits "dleq-invalid"

ChargeError::DleqInvalid becomes a unit variant; DleqLocation is removed. 7 files, +30/−74.

Evidence: cargo test -p pops-core-verify (176) + cargo test --workspace (all 4 crates) + cargo clippy --all-targets -D warnings + wasm-target build — all green. Built + reviewed via the build kit (frozen spec → implementer → independent adversarial verifier; money-path + clean-cut gates).

Spec contract: orveth/mpp-specs#1 draft-cashu-charge-01 @ 9e3f973.

🤖 Generated with Claude Code

The charge contract checks DLEQ only on the swap-returned signatures, per draft-cashu-charge-01 $security-dleq; presented input proofs are never DLEQ-checked (the swap is the authoritative oracle). Drop the unused second location so ChargeError::DleqInvalid is a unit variant expressing the one check performed. Behavior is unchanged: the swap-output DLEQ gate, the verification-failed/402 mapping, and the resource-not-served path are all untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@orveth orveth merged commit db8315e into main Jun 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant