Add BIP-374 DLEQ proof verification#107
Open
FreeOnlineUser wants to merge 4 commits intodiybitcoinhardware:masterfrom
Open
Add BIP-374 DLEQ proof verification#107FreeOnlineUser wants to merge 4 commits intodiybitcoinhardware:masterfrom
FreeOnlineUser wants to merge 4 commits intodiybitcoinhardware:masterfrom
Conversation
Implement DLEQ proof verification and generation as per BIP-374. This includes functions to verify and generate DLEQ proofs for ECDH computations without revealing private keys.
This file contains tests for BIP-374 DLEQ proof verification and generation, including various scenarios for tagged hashing, proof generation, and verification.
Added tests to verify failure conditions for DLEQ proof generation.
Author
|
Added edge case hardening based on cryptographic review: Verification (
Generation (
Tests:
Spec Compliance Note: This implements BIP-374 DLEQ verification for BIP-375 Silent Payments use cases. The optional message parameter ( Validation:
No breaking changes to existing API signatures. |
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.
Add BIP-374 DLEQ proof verification
Description
Adds DLEQ (Discrete Log Equality) proof verification as specified in BIP-374. This complements the existing BIP-375 PSBT field support in #79 by providing the actual cryptographic verification.
What this adds
verify_dleq_proof(A, B, C, proof)- Verify a BIP-374 DLEQ proofgenerate_dleq_proof(a, B)- Generate a DLEQ proof (for testing/coordinators)tagged_hash(tag, data)- BIP-340 style tagged hashingWhy this matters
BIP-375 Silent Payments PSBTs include DLEQ proofs (
PSBT_GLOBAL_SP_DLEQ) to prove ECDH shares were computed correctly. Without verification, signing devices must trust the coordinator's math.With this, a signing device can:
Usage
Implementation notes
ec_pubkey_negate()returns a new point (doesn't modify in-place)Related
References