feat(crypto): migrate BDHKE to BLS12-381 (v3 keysets) - #999
Open
a1denvalu3 wants to merge 27 commits into
Open
Conversation
❌ 13 Tests Failed:
View the top 3 failed test(s) by shortest run time
To view more test analytics, go to the Test Analytics Dashboard |
a1denvalu3
force-pushed
the
feature/bls12-381-v3-keyset
branch
2 times, most recently
from
May 10, 2026 17:16
a8f8486 to
0c63c63
Compare
This was referenced May 13, 2026
10 tasks
a1denvalu3
force-pushed
the
feature/bls12-381-v3-keyset
branch
2 times, most recently
from
May 20, 2026 16:19
86aa13e to
c894cf3
Compare
a1denvalu3
marked this pull request as ready for review
May 20, 2026 20:35
3 tasks
a1denvalu3
force-pushed
the
feature/bls12-381-v3-keyset
branch
2 times, most recently
from
June 8, 2026 09:46
9bf2514 to
6a6a964
Compare
callebtc
reviewed
Jul 3, 2026
callebtc
reviewed
Jul 3, 2026
a1denvalu3
force-pushed
the
feature/bls12-381-v3-keyset
branch
from
July 3, 2026 16:32
4230932 to
a3acbc1
Compare
…h BLS12-381 cryptography
- Use single miller loop accumulation by negating the signature point - Verify against the identity element (BlstFP12Element) - Applies to both single and batch pairing verification functions
- Add NUT-00 round-trip test vectors to for v3 (BLS12-381) - Add NUT-02 keyset ID test vectors to for v3 keysets - Add NUT-13 secret and blinding factor derivation test vector to - Add TRACE level logging in core BLS operations (bls_dhke.py, keys.py, secrets.py) for tracking blinding factor reduction, derivation, and verification states - Hoist in-line imports to module level
…ndom scalars for batch verification
Moved _G2_HEX string definition and uncompression step to global scope in bls.py to avoid repeated initialization and uncompression in pairing and batch pairing verification functions. Imported the cached G2 point directly into bls_dhke.py.
Added is_infinity method to PublicKey class and updated step2_bob to formally verify the blinded message is not the point at infinity instead of checking the serialized hex string against a hardcoded constant.
… keyset ID derivation
3 tasks
…and update unsupported keyset filter test
a1denvalu3
force-pushed
the
feature/bls12-381-v3-keyset
branch
from
August 11, 2026 19:17
8acc220 to
92b006f
Compare
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.
Caution
This PR bumps Nutshell's version to 0.21
Summary
This pull request introduces BLS12-381 cryptography into the Cashu protocol, enabling smaller proofs and paving the way for multi-signature schemes and batch verification.
Core Changes
v3keysets using the BLS12-381 curve.Y * r) to replace legacy additive blinding (Y + r*G).e(C, G2) == e(Y, K2)).v1/v2(secp256k1) keysets.02prefix for BLS keysets.Testing
secp256k1andBLS12-381logic.tests/test_crypto_bls.pytest suite specifically for deterministic hash-to-curve testing, verification of individual BLS protocol steps, and batched BLS pairing checks.