Skip to content

add support for confidential mint/burn token extension#836

Open
jshiohaha wants to merge 2 commits intosolana-foundation:masterfrom
jshiohaha:jshiohaha/add-confidential-mintburn-token-extension-support
Open

add support for confidential mint/burn token extension#836
jshiohaha wants to merge 2 commits intosolana-foundation:masterfrom
jshiohaha:jshiohaha/add-confidential-mintburn-token-extension-support

Conversation

@jshiohaha
Copy link

Motivation

The explorer does not support the confidential mint/burn SPL Token extension, so tokens with this extension broke the viewing experience. I noticed this while building on top of confidential token extensions for the privacy hackathon.

Changes

Out of Scope

  1. Other confidential token extensions parsing because I didn't test those extensions
  2. Token account details rendering in the transaction details page. I saw some errors but didn't see any existing logic to handle confidential ix's, so I think that might be a much larger change.

export function TokenDetailsCard<P extends TitleInfoLessProps>(props: TokenDetailsCardProps<P>) {

export const TokenInstructionType = enums([

Type of change

  • Bug fix
  • New feature
  • Protocol integration
  • Documentation update
  • Other (please describe):

Screenshots

Current explorer behavior

current-explorer

Behavior after changes

localhost-with-changes

Testing

Manual tests

On a local instance of surfpool with confidential transfers enabled, I created a SPL token with the following extensions: confidential transfer, confidential mint burn, metadata pointer, and token metadata. I started the explorer locally and verified that I could see all extensions, as expected.

Unit tests

Added a Jest test (should render confidentialMintBurn extension in TokenExtensionRow) to ensure the new renderer outputs each field header and value when provided.

Ran both pnpm test and pnpm test:ci

... output truncated for brevity ...

   ✓ TokenExtensionRow > should render tokenGroup extension  2033ms
   ✓ TokenExtensionRow > should render tokenGroupMember extension  2030ms
   ✓ TokenExtensionRow > should render unparseableExtension extension  2015ms

 Test Files  92 passed (92)
      Tests  893 passed (893)
   Start at  22:01:45
   Duration  59.51s (transform 3.76s, setup 8.54s, collect 34.03s, tests 78.94s, environment 23.13s, prepare 4.53s)

Checklist

  • I have added tests that prove my fix/feature works
  • All tests pass locally and in CI
  • I have run build:info script to update build information
  • I have included screenshots for protocol screens (if applicable)
  • CI/CD checks pass

Pending

  • My code follows the project's style guidelines
  • Maybe, but I'm not sure where those guideliens are?
  • I have updated documentation as needed
  • I'm not sure if there are any docs to update, but happy to do so if needed

Not applicable

  • For security-related features, I have included links to related information

@vercel
Copy link

vercel bot commented Feb 3, 2026

@jshiohaha is attempting to deploy a commit to the Solana Foundation Team on Vercel.

A member of the Team first needs to authorize it.

}
case 'confidentialMintBurn': {
const description =
'Allow token issuers to opt in to encrypted mint and burn operations, along with encrypted total supply';
Copy link
Author

Choose a reason for hiding this comment

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

Acknowledging this text can probably be improved — open to suggestions.

Choose a reason for hiding this comment

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

sorry I don't know how this works i was just now getting this in email i've had aa few bad weeks so forgive me for being late or unresponsive but working by yourself is hard to do. Thanks for the help and since it's cleared up i'm going to get a hour of sleep until i got to get up to go to work do you need anything else from me or did i need to do anything to make this push through or whatever?

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 3, 2026

Greptile Overview

Greptile Summary

This PR adds support for the confidential mint/burn SPL Token extension to prevent tokens with this extension from breaking the viewing experience.

Changes made:

  • Extended the validator schema with confidentialMintBurn variant including four decoded fields (confidentialSupply, decryptableSupply, pendingBurn, supplyElgamalPubkey)
  • Added rendering logic to display all four fields with appropriate labels in the token account details
  • Included the extension in the sort order array to ensure proper display positioning
  • Added metadata and documentation links for the extension
  • Provided comprehensive test coverage for the new extension
  • Added realistic fixture data with base64-encoded values for mocks/stories

Implementation quality:
The implementation follows existing patterns consistently across the codebase, with all four extension fields being conditionally rendered and proper test coverage included.

Confidence Score: 5/5

  • This PR is safe to merge with no blocking issues
  • The implementation follows established patterns, includes comprehensive test coverage, and all changes are localized to adding support for a new extension type without modifying existing functionality
  • No files require special attention

Important Files Changed

Filename Overview
app/validators/accounts/token-extension.ts Added confidentialMintBurn enum variant and schema definition with four string fields
app/utils/token-extension.ts Added metadata for confidential mint/burn extension including description, name, and docs link
app/components/account/TokenAccountSection.tsx Added rendering logic for confidential mint/burn fields and included extension in sort order
app/components/account/tests/TokenExtensionRow.spec.tsx Added comprehensive test coverage for confidential mint/burn extension rendering

Sequence Diagram

sequenceDiagram
    participant API as Solana RPC API
    participant Validator as token-extension.ts<br/>(Validator)
    participant Utils as token-extension.ts<br/>(Utils)
    participant Component as TokenAccountSection.tsx
    participant UI as Browser UI

    API->>Validator: Token account data with<br/>confidentialMintBurn extension
    Validator->>Validator: Validate against<br/>ConfidentialMintBurn schema
    Note over Validator: Checks for 4 required<br/>string fields:<br/>- confidentialSupply<br/>- decryptableSupply<br/>- pendingBurn<br/>- supplyElgamalPubkey
    Validator->>Utils: Validated extension object
    Utils->>Utils: Populate metadata<br/>(name, description, docs link)
    Utils->>Component: Extension with metadata
    Component->>Component: Render confidentialMintBurn case<br/>with conditional field display
    Component->>UI: Display extension table rows
Loading

@PatSayJak
Copy link

PatSayJak commented Feb 3, 2026 via email

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.

4 participants