Skip to content

feat: Enable key rotation in MPTokenIssuanceSet - #7960

Open
yinyiqian1 wants to merge 1 commit into
XRPLF:ripple/confidential-key-rotationfrom
yinyiqian1:allow-key-update
Open

feat: Enable key rotation in MPTokenIssuanceSet#7960
yinyiqian1 wants to merge 1 commit into
XRPLF:ripple/confidential-key-rotationfrom
yinyiqian1:allow-key-update

Conversation

@yinyiqian1

@yinyiqian1 yinyiqian1 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Pre-ConfidentialKeyRotation, MPTokenIssuanceSet rejects any attempt to modify an existing IssuerEncryptionKey/AuditorEncryptionKey, and an auditor key can never be provided without the issuer key (temMALFORMED in preflight).

Post-ConfidentialKeyRotation:

  1. allow late-registering auditor key after issuance key already registered on ledger
  2. prevent registering auditor key if issuance key is not already registered or not being registered in the same tx
  3. allow late-registering auditor key even if COA > 0
  4. allow rotating issuer key even if it already exists on ledger
  5. allow rotating auditor key even if it already exists on ledger
  6. allow rotating even if COA > 0

Epoch:

  1. when not opt-in confidential, epoch absent
  2. first time register key: epoch keeps absent, matching issuances whose keys were registered before the ConfidentialKeyRotation amendment.
  3. rotating key: epoch + 1

High Level Overview of Change

Context of Change

API Impact

  • Public API: New feature (new methods and/or new fields)
  • Public API: Breaking change (in general, breaking changes should only impact the next api_version)
  • libxrpl change (any change that may affect libxrpl or dependents of libxrpl)
  • Peer protocol change (must be backward compatible or bump the peer protocol version)

@yinyiqian1
yinyiqian1 force-pushed the allow-key-update branch 5 times, most recently from d177232 to 2544bde Compare August 6, 2026 14:54
@yinyiqian1
yinyiqian1 marked this pull request as ready for review August 6, 2026 14:56
@yinyiqian1
yinyiqian1 force-pushed the allow-key-update branch 2 times, most recently from 422c0eb to 18021bc Compare August 6, 2026 15:17
@yinyiqian1 yinyiqian1 changed the title MPTokenIssuanceSet: enable key update feat: Enable key rotation in MPTokenIssuanceSet Aug 6, 2026
bool const sleHasAuditorKey = sleMptIssuance->isFieldPresent(sfAuditorEncryptionKey);

// cannot update issuer public key
if (ctx.tx.isFieldPresent(sfIssuerEncryptionKey) &&

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Best practices for amendments are using one amendment enabled block and one amendment disabled block, even if they are similar, instead of spreading amendment through the code.


// Only increment the auditor key epoch on a rotation. First time registration leaves it
// absent.
bool const isRotation = sle->isFieldPresent(sfAuditorEncryptionKey);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 2 have the same code, why not make helper. or lambda?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants