-
-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Wallet/Mint] DLEQ proofs #175
Merged
Conversation
This file contains 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
* Fix comments (DLEQ sign error) * Fix alice_verify_dleq in d_dhke.py * Fix_generate_promise in ledger.py * Fix verify_proofs_dleq in wallet.py
* Use C_ instead of C in verify DLEQ! * Fix comments (DLEQ sign error) * Fix alice_verify_dleq in d_dhke.py * Fix_generate_promise in ledger.py * Fix verify_proofs_dleq in wallet.py * Fix: invalid public key * Exception: Mint Error: invalid public key * Update cashu/wallet/wallet.py --------- Co-authored-by: calle <[email protected]>
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #175 +/- ##
==========================================
+ Coverage 57.46% 59.12% +1.66%
==========================================
Files 46 46
Lines 4046 4115 +69
==========================================
+ Hits 2325 2433 +108
+ Misses 1721 1682 -39
☔ View full report in Codecov by Sentry. |
callebtc
commented
Apr 28, 2023
callebtc
commented
Apr 28, 2023
callebtc
commented
Apr 28, 2023
callebtc
commented
Apr 28, 2023
callebtc
commented
Apr 28, 2023
callebtc
commented
Apr 28, 2023
callebtc
commented
Apr 28, 2023
callebtc
commented
Apr 28, 2023
callebtc
commented
Apr 28, 2023
callebtc
added
enhancement
New feature or request
wallet
About the Nutshell wallet
mint
About the Nutshell mint
nuts
NUT specs related
labels
Apr 28, 2023
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
enhancement
New feature or request
mint
About the Nutshell mint
nuts
NUT specs related
wallet
About the Nutshell wallet
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 introduces discrete log equality (DLEQ) proofs to Cashu.
DLEQ proofs enable the ecash receiver (Alice while minting tokens, or Carol while receiving tokens from Alice) to verify the mint's signature
C
without access to its private keya
. Without DLEQ proofs, only the mint is able to verify its own signature.The DLEQ proof
The purpose of this DLEQ is to prove that the mint has used the same private key
a
for creating its public keyA
and for signing the BlindedMessageB'
. Bob the mint returns the proof with the blind signatureC'
during a mint or split operation. The complete DLEQ proof readsThe mint produces these DLEQ proofs when returning
BlindSignature
's upon thePOST /mint
andPOST /split
responses:e
ands
are the challenge and response of the DLEQ proof.The BDHKE function
step2_bob
is extended to calculate and return the DLEQ proof:Alice: Verify DLEQ proof upon
/mint
and/split
Alice who receives the DLEQ proof from the mint checks its validity using:
As we can see, in order to execute the proof, Alice needs
e, s
that are returned from Bob. Alice further needsB'
(the BlindedMessage that Bob signed) andC'
, the BlindSignature from Bob, andA
, the public key of Bob with which he signed the BlindedMessage. All these are available during or after the/mint
and/split
operations.Carol: Verify DLEQ from Alice
A user Alice can generate a token that includes a DLEQ proof using the command
cashu send <amount> --dleq
(or-d
for short).When Alice sends a token including a DLEQ proof to another user Carol, Carol can execute the DLEQ proof herself to validate Bob's signature without having to talk to Bob. That means, Alice must include the following information in a token she sends to Carol:
( x, C )
– the ecash token( e, s )
– the DLEQ proof( r )
– Alice's blinding factorHere,
x
is the Proof's secret, andC
is the mint's signature on it. To execute the DLEQ proof like Alice above, Carol needs(B', C')
which she can compute herself using the blinding factorr
that she receives from Alice.To verify the DLEQ proof of a received token, Carol executes the following code:
Todo:
dleq_e
anddleq_s