-
-
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
Changes from 7 commits
Commits
Show all changes
70 commits
Select commit
Hold shift + click to select a range
347de24
produce dleq
callebtc 562ffa5
start working on verification
callebtc f4b5970
merge
callebtc f73e0da
wip dleq
callebtc e0bd8bc
Use C_ instead of C in verify DLEQ! (#176)
moonsettler 65be72b
Fix: invalid public key (#182)
moonsettler 9002824
Update cashu/core/b_dhke.py
callebtc a53bb0a
Update tests/test_cli.py
callebtc 6e1171b
merge
callebtc aa535a8
verify all constructed proofs
callebtc 4c8622d
dleq upon receive
callebtc d9cc699
serialize without dleq
callebtc 64c5070
all tests passing
callebtc 80d40db
make format
callebtc 6d15300
remove print
callebtc 5e5e958
remove debug
callebtc 4348d4f
option to send with dleq
callebtc e16010d
add tests
callebtc 9a025fe
fix test
callebtc f676c70
deterministic p in step2_dleq and fix mypy error for hash_to_curve
callebtc d907d6c
test crypto/hash_e and crypto/step2_bob_dleq
callebtc bc5f478
rename A to K in b_dhke.py and test_alice_verify_dleq
callebtc 8f3d1c2
rename tests
callebtc 8459105
make format
callebtc 55e406f
store dleq in mint db (and readd balance view)
callebtc 279e8f3
remove `r` from dleq in tests
callebtc 1050c49
add pending output
callebtc ef99106
merge main
callebtc 12be7b1
make format
callebtc 4af5008
Merge branch 'main' into dleq
callebtc 3fb099c
works with pre-dleq mints
callebtc 13873b1
fix comments
callebtc befdd12
Merge branch 'main' into dleq
callebtc 0495bef
make format
callebtc 8321ca3
fix some tests
callebtc ab8a1f0
fix last test
callebtc 205cab3
Merge branch 'main' into dleq
callebtc 00fd85f
Merge branch 'main' into dleq
callebtc 5fccea3
test serialize dleq fix
callebtc 4020273
flake
callebtc 43b04b6
flake
callebtc 8b337d9
keyset.id must be str
callebtc 7ab9539
fix test decorators
callebtc 22c5eef
start removing the duplicate fields from the dleq
callebtc 4960635
Merge branch 'main' into dleq
callebtc 068224e
format
callebtc e4c245b
remove print
callebtc 749d5df
cleanup
callebtc 61b7ff4
Merge branch 'main' into dleq
callebtc 5b5b8fa
add type anotations to dleq functions
callebtc 809c52f
Merge branch 'dleq' of github.com:callebtc/cashu into dleq
callebtc 1a359a2
remove unnecessary fields from BlindedSignature
callebtc beca698
tests not working yet
callebtc 8aaf0f8
spelling mistakes
callebtc 57f3967
spelling mistakes
callebtc 877c164
fix more spelling mistakes
callebtc e471c74
revert to normal
callebtc 84d89ca
add comments
callebtc 6451950
bdhke: generalize hash_e
callebtc 9ac144a
remove P2PKSecret changes
callebtc 2fee249
revert tests for P2PKSecret
callebtc 23c2bbc
revert tests
callebtc e1a7c88
revert test fully
callebtc 42e447b
revert p2pksecret changes
callebtc d186529
Merge branch 'main' into dleq
callebtc 023fc81
refactor proof invalidation
callebtc 35f9a2b
store dleq proofs in wallet db
callebtc 659a0e4
make mypy happy
callebtc a89c230
add minimal mint test
callebtc b251c24
set proof only reserved if it properly serialized
callebtc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,6 +19,18 @@ class P2SHScript(BaseModel): | |
address: Union[str, None] = None | ||
|
||
|
||
class DLEQ(BaseModel): | ||
""" | ||
Discrete Log Equality (DLEQ) Proof | ||
""" | ||
|
||
e: str | ||
s: str | ||
B_: str | ||
C_: str | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. new |
||
r: str = "" | ||
|
||
|
||
class Proof(BaseModel): | ||
""" | ||
Value token | ||
|
@@ -31,6 +43,7 @@ class Proof(BaseModel): | |
secret: str = "" # secret or message to be blinded and signed | ||
C: str = "" # signature on secret, unblinded by wallet | ||
script: Union[P2SHScript, None] = None # P2SH spending condition | ||
dleq: Union[DLEQ, None] = None # DLEQ proof | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. New entry in |
||
reserved: Union[ | ||
None, bool | ||
] = False # whether this proof is reserved for sending, used for coin management in the wallet | ||
|
@@ -41,6 +54,16 @@ class Proof(BaseModel): | |
time_reserved: Union[None, str] = "" | ||
|
||
def to_dict(self): | ||
# dictionary without the fields that don't need to be send to Carol | ||
return dict( | ||
id=self.id, | ||
amount=self.amount, | ||
secret=self.secret, | ||
C=self.C, | ||
dleq=self.dleq.dict(), | ||
) | ||
|
||
def to_dict_no_dleq(self): | ||
# dictionary without the fields that don't need to be send to Carol | ||
return dict(id=self.id, amount=self.amount, secret=self.secret, C=self.C) | ||
|
||
|
@@ -77,6 +100,7 @@ class BlindedSignature(BaseModel): | |
id: Union[str, None] = None | ||
amount: int | ||
C_: str # Hex-encoded signature | ||
dleq: DLEQ | ||
|
||
|
||
class BlindedMessages(BaseModel): | ||
|
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
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
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new return for
step2_bob