XLS-96 Confidential MPT#294
Draft
ckeshava wants to merge 18 commits into
Draft
Conversation
…m mpt-crypto Github CI
…he interfaces exported by mpt-crypto-sys with the typical guarantees of Rust.
…nfidential MPTs. What is remaining? - The integration tests pertaining to ConfidentialMPTs are not complete. - All the transaction+request models, binary-codec changes pertaining to MPTokensV1 is missing in xrpl-rust. This is a prereq for the above point.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #294 +/- ##
==========================================
+ Coverage 83.51% 84.29% +0.77%
==========================================
Files 219 200 -19
Lines 22304 20810 -1494
==========================================
- Hits 18628 17542 -1086
+ Misses 3676 3268 -408
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
… Unit+Integ tests. Note: The mpt-crypto-sys internal crate is excluded from the integ tests coverage
…ust+cmpt feature can make use of mpt_crypto exposed methods
…l_transfer amendment
Add negative-path integration tests for ConfidentialMPTMergeInbox covering
all seven §9.2.1.2 protocol-level failures, plus the helper and model
coverage that support them.
- tests/common: add `test_transaction_with_result`, which signs/submits and
asserts a caller-specified engine result. `test_transaction` now delegates
to it with "tesSUCCESS", so the existing callers are unchanged while error
cases can assert tec/tem/tef codes.
- confidential_mpt.rs: seven MergeInbox failure tests, each asserting the
code rippled actually returns:
XRPLF#1 missing issuance/MPToken -> tecOBJECT_NOT_FOUND
XRPLF#2 no CanConfidentialAmount -> tecNO_PERMISSION
XRPLF#3 uninitialized MPToken -> tecNO_PERMISSION
XRPLF#4 unauthorized holder -> tecNO_AUTH
XRPLF#5 locked holder -> tecLOCKED
XRPLF#6 locked issuance -> tecLOCKED
XRPLF#7 issuer merges own issuance -> temMALFORMED
XRPLF#7 diverges from the spec's stated tefINTERNAL: that preclaim check is an
unreachable backstop (LCOV_EXCL_LINE), and preflight rejects first with
temMALFORMED. The test asserts the observable behavior.
- Extend setup_confidential_issuance to grant issuer-side authorization when
tfMPTRequireAuth is set (required to reach XRPLF#4); add the CanLock /
RequireAuth / Lock / Unauthorize flag constants.
- Add a builder/accessors unit test for the MergeInbox model.
Verified against a live rippled (ripple/confidential-transfer): all 8
MergeInbox tests pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
This PR materializes support for Confidential MPTs in the xrpl-rust library. Here are some salient points about the design choices:
Confidential-Transferamendment.stdin xrpl-rust SDK.verifier-methodsof mpt-crypto library are exposed, but unused.References:
Sister work in xrpl-py library: https://github.com/XRPLF/xrpl-py/pull/919/changes
mpt-crypto C library: https://github.com/XRPLF/mpt-crypto
Confidential Transfers specification: https://raw.githubusercontent.com/XRPLF/XRPL-Standards/refs/heads/master/XLS-0096-confidential-mpt/README.md
Note to Reviewers: The integration tests are failing because the xrpld instance does not recognise the "ConfidentialTransfer" amendment. This will be rectified once the feature is merged into the
developbranch of rippled.Type of Change
Test Plan
New tests will be added to verify all the new additions to the xrpl-rust SDK. This includes transaction-model related integration+unit tests. It also includes tests against the Rust-wrappers around the linkage of C-shared-library.
Note: This SDK has been tested against the Confidential-Transfer feature branch at the commit: dacd108657d99ff740074d7fc5258772c9ce7a76. Here is the branch with the feature code: https://github.com/XRPLF/rippled/tree/ripple/confidential-transfer. Please build the referenced cpp code if you want to run a standalone rippled node with the Confidential-Transfer amendment.