feat: NUT-12 deterministic DLEQ nonce derivation and storage optimization#1062
Open
a1denvalu3 wants to merge 2 commits into
Open
feat: NUT-12 deterministic DLEQ nonce derivation and storage optimization#1062a1denvalu3 wants to merge 2 commits into
a1denvalu3 wants to merge 2 commits into
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1062 +/- ##
==========================================
+ Coverage 74.79% 75.02% +0.23%
==========================================
Files 111 111
Lines 12413 12452 +39
==========================================
+ Hits 9284 9342 +58
+ Misses 3129 3110 -19 ☔ View full report in Codecov by Harness. |
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.
This PR implements the NUT-12 deterministic DLEQ nonce derivation (rejection-sampled HMAC-SHA256) as specified in the merged spec pull request: cashubtc/nuts#368
Summary of Changes:
Deterministic Nonce Derivation:
deterministic_dleq_nonceinsidecashu/core/crypto/b_dhke.py.step2_bob_dleqto utilize the helper whenp_bytesis not explicitly provided.Performance & Storage Optimization:
step2_bob_dleqand passing it to the helper function.eandsDLEQ parameters in the database (dleq_eanddleq_scolumns are now set to empty string for new promises, saving substantial storage space for active mints).promisestable schema definitions incashu/mint/migrations.pyto document the deprecation of the unused DLEQ columns.On-the-fly Reconstruction:
/restoreandget_melt_quoteendpoints to dynamically reconstruct missing DLEQ proof values on-the-fly using the mint's private keys.Testing:
tests/test_crypto.py.