Compress ElGamal Public Keys and Pedersen Commitments + Add Validation#6385
Merged
shawnxie999 merged 3 commits intoXRPLF:ripple/confidential-transferfrom Feb 19, 2026
Merged
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## ripple/confidential-transfer #6385 +/- ##
==============================================================
+ Coverage 79.1% 80.1% +0.9%
==============================================================
Files 850 852 +2
Lines 72015 66305 -5710
Branches 8385 7251 -1134
==============================================================
- Hits 56975 53085 -3890
+ Misses 15040 13220 -1820
🚀 New features to boost your workflow:
|
yinyiqian1
reviewed
Feb 18, 2026
Collaborator
There was a problem hiding this comment.
The secp256k1 compressed buffer have fixed prefix, do you think it is worth adding the check as well, so that we can fail fast before the parse
yinyiqian1
reviewed
Feb 18, 2026
Collaborator
There was a problem hiding this comment.
We can use the same valid check for ec pub key and commitment. Please rename if you have better choice.
bool
isValidSecp256k1Point(Slice const& buffer)
{
// some checks
...
return secp256k1_ec_pubkey_parse(
secp256k1Context(), &point, buffer.data(), ecPubKeyLength) == 1;
}
or we can
yinyiqian1
approved these changes
Feb 19, 2026
b2c434d
into
XRPLF:ripple/confidential-transfer
61 of 70 checks passed
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.
High Level Overview of Change
Summary
Reduces storage size for ElGamal public keys and Pedersen commitments from 64 bytes to 33 bytes by using compressed EC point format. Adds validation to ensure these fields contain valid EC points before storing on ledger.
Changes
Field Size Reduction
sfHolderElGamalPublicKeysfIssuerElGamalPublicKeysfAuditorElGamalPublicKeysfBalanceCommitmentsfAmountCommitmentValidation
isValidPublicKey()andisValidCommitment()functionstemMALFORMEDAffected Transactions
ConfidentialMPTConvert- validates holder public keyMPTokenIssuanceSet- validates issuer and auditor public keysConfidentialMPTSend- validates amount and balance commitmentsConfidentialMPTConvertBack- validates balance commitmentBreaking Changes
secp256k1_ec_pubkey_serializewithSECP256K1_EC_COMPRESSED)Type of Change
.gitignore, formatting, dropping support for older tooling)API Impact
libxrplchange (any change that may affectlibxrplor dependents oflibxrpl)