fix v3 Proof.Y hash-to-curve and BlindedSignature dleq=None#1003
Merged
a1denvalu3 merged 4 commits intoMay 13, 2026
Merged
Conversation
e327d63 to
0e8c93f
Compare
…ell into fix/v3-y-and-dleq-null
a1denvalu3
approved these changes
May 13, 2026
a1denvalu3
approved these changes
May 13, 2026
5efea39
into
cashubtc:feature/bls12-381-v3-keyset
7 of 29 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #999
This PR is a fix for BLS implementation PR #999.
Summary
Two small but blocking gaps in the v3 (BLS12-381) wiring, both in
cashu/core/base.py, surfaced while planning the BLS Cashu-TS implementation.1.
Proof.Yalways uses secp256k1 hash-to-curveProof.__init__unconditionally callsb_dhke.hash_to_curveeven for v3 (02…) keyset IDs.Yis the index used byproofs_used,/v1/checkstate, and websocket proof-state subscriptions; v3 wallets would presumably computeYon G1, so lookups would not match:checkstatewould always returnUNSPENTfor v3 proofs that were just spent, and websocket subscriptions never fire.2.
BlindedSignature.from_rowcrashes on v3 promisesstep2_bobinbls_dhke.pyreturns(C_, None, None)as DLEQ proofs are redundant under pairings, so v3 promises are stored with NULLdleq_e/dleq_s. ButBlindedSignature.from_rowunconditionally constructs aDLEQ(e=..., s=...), which Pydantic rejects since the model declarese: str/s: str.Symptom:
POST /v1/restorereturns 500 against a v3 mint with2 validation errors for DLEQ: Input should be a valid string [input_value=None].Patch constructs the
DLEQonly when both fields are non-null — matches the existingdleq: Optional[DLEQ] = Nonemodel declaration.