Skip to content

Conversation

@nuo-xu
Copy link
Contributor

@nuo-xu nuo-xu commented Apr 15, 2025

Resolves brave/brave-browser#45445

Test Plan

  1. Zcash feature flag can be enabled via brave://flags
  2. Zcash testnet flag is the same as BTC testnet flag exists in debug settings (However, testnet is not recommended to be used for testing since core didn't find a stable endpoint for it)
  3. Should be able to create Zcash account both test and mainnet via Accounts tab or by picking Zcash network as selected network while there is no zcash account has been created.
  4. Please contact me or @cypt4 for some ZEC testing balance fetching
  5. Once you have ZEC balance, please check if entire wallet displays it correctly: Portfolio/Asset Detail/Accounts/Account Detail
  6. Zcash account has balance will not be auto-restored since it is not yet implemented in core.
  7. Zcash send tx will be handled in a different issue [Wallet/iOS]: Zcash Transparent Account Send Tx brave-browser#45446

@nuo-xu nuo-xu added CI/skip-android Do not run CI builds for Android CI/skip-macos-x64 CI/skip-windows-x64 Do not run CI builds for Windows x64 CI/skip-macos-arm64 Do not run CI builds for macOS arm64 labels Apr 15, 2025
@nuo-xu nuo-xu requested a review from StephenHeaps April 15, 2025 16:03
@nuo-xu nuo-xu self-assigned this Apr 15, 2025
@nuo-xu nuo-xu requested a review from a team as a code owner April 15, 2025 16:03
@nuo-xu
Copy link
Contributor Author

nuo-xu commented Apr 15, 2025

@stoletheminerals i didn't create a sec-review for this since it's UI changes + using Wallet Core mojom api. Please let me know if it needs one. Adding you as a reviewer in case you need to go through the changes.

@nuo-xu nuo-xu requested a review from stoletheminerals April 15, 2025 16:05
@stoletheminerals
Copy link
Contributor

Thanks @nuo-xu . If you don't mind please create a review issue and add a priority, as I have a few other big reviews in the pipeline.

@github-actions
Copy link
Contributor

Chromium major version is behind target branch (135.0.7049.84 vs 136.0.7103.25). Please rebase.

@github-actions github-actions bot added the chromium-version-mismatch The Chromium version on the PR branch does not match the version on the target branch label Apr 16, 2025
@nuo-xu nuo-xu force-pushed the feature/zcash-transparent branch from e21cdfd to 3d96b3a Compare April 17, 2025 21:03
@github-actions github-actions bot removed the chromium-version-mismatch The Chromium version on the PR branch does not match the version on the target branch label Apr 17, 2025
@nuo-xu nuo-xu requested a review from StephenHeaps April 17, 2025 21:04
@nuo-xu nuo-xu force-pushed the feature/zcash-transparent branch from 3d96b3a to e880d6f Compare April 22, 2025 14:04
Copy link
Collaborator

@StephenHeaps StephenHeaps left a comment

Choose a reason for hiding this comment

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

Just need to select Preserve Vector Data for the svg images, otherwise LGTM 🐎.

@nuo-xu nuo-xu requested a review from StephenHeaps April 23, 2025 20:32
@nuo-xu nuo-xu force-pushed the feature/zcash-transparent branch from 52eeca1 to f64c27a Compare April 28, 2025 19:53
@nuo-xu nuo-xu force-pushed the feature/zcash-transparent branch from f64c27a to 8642f6a Compare April 30, 2025 14:50
@nuo-xu nuo-xu force-pushed the feature/zcash-transparent branch 2 times, most recently from 2a12deb to 52bf6ab Compare May 7, 2025 15:13
@nuo-xu nuo-xu force-pushed the feature/zcash-transparent branch from 52bf6ab to ead4d8c Compare May 13, 2025 05:27
@github-actions
Copy link
Contributor

Chromium major version is behind target branch (136.0.7103.93 vs 137.0.7151.16). Please rebase.

@github-actions github-actions bot added the chromium-version-mismatch The Chromium version on the PR branch does not match the version on the target branch label May 14, 2025
@nuo-xu nuo-xu force-pushed the feature/zcash-transparent branch from ead4d8c to 8520144 Compare May 14, 2025 06:56
@github-actions github-actions bot removed the chromium-version-mismatch The Chromium version on the PR branch does not match the version on the target branch label May 14, 2025
@nuo-xu nuo-xu force-pushed the feature/zcash-transparent branch from 8520144 to bf5e5a3 Compare May 16, 2025 02:00
@nuo-xu nuo-xu force-pushed the feature/zcash-transparent branch from bf5e5a3 to 550d6d5 Compare May 26, 2025 05:36
@github-actions
Copy link
Contributor

[puLL-Merge] - brave/brave-core@28671

Description

This PR adds ZCash wallet support to the Brave iOS app. It integrates ZCash functionality alongside existing cryptocurrencies like Bitcoin and Ethereum by adding ZCash account management, asset display, and transaction capabilities. The changes include UI updates, new asset icons, and support for both mainnet and testnet ZCash networks.

Changes

Changes

Wallet Service Integration

  • Added ZCash wallet service integration in BVC+Wallet.swift by initializing zcashWalletService and passing it through to wallet stores
  • Added a testnet toggle for ZCash in the debug menu, similar to the existing Bitcoin testnet toggle

Asset Icons

  • Added ZCash asset icon and updated several existing cryptocurrency icons (Bitcoin, ETH, AVAX, etc.) to use SVG format instead of PNG for better scaling
  • Added new asset icons for Base and Neon networks

Account Management

  • Extended account management functionality to support ZCash accounts, including:
    • Account creation
    • Transparent address display
    • Balance fetching
    • ZCash testnet support

Account Operations

  • Added support for receiving ZCash (deposit functionality)
  • Modified CopyAddressHeader to work with ZCash addresses
  • Added account export limitations for ZCash (doesn't support private key export)

UI/UX Updates

  • Updated transaction support for ZCash
  • Modified account display logic to handle ZCash addresses properly
  • Extended filters to include ZCash in relevant views

Model Extensions

  • Extended AccountInfo with helpers like supportsAccountExport and supportsNFT
  • Added ZCash-specific extensions for balance fetching and address handling

Preferences

  • Added isZcashTestnetEnabled preference for controlling ZCash testnet visibility
sequenceDiagram
    BrowserViewController->>WalletStore: Initialize
    WalletStore->>ZCashWalletServiceFactory: get(privateMode:)
    ZCashWalletServiceFactory-->>WalletStore: Returns zcashWalletService
    WalletStore->>CryptoStore: Initialize with zcashWalletService
    CryptoStore->>AccountsStore: Initialize with zcashWalletService
    CryptoStore->>BuyTokenStore: Initialize with zcashWalletService
    CryptoStore->>SendTokenStore: Initialize with zcashWalletService
    CryptoStore->>AssetDetailStore: Initialize with zcashWalletService
    CryptoStore->>AccountActivityStore: Initialize with zcashWalletService
    CryptoStore->>PortfolioStore: Initialize with zcashWalletService
    
    User->>BraveWalletDebugMenu: Toggle "Enable Zcash Testnet"
    BraveWalletDebugMenu->>Preferences: Update isZcashTestnetEnabled
    
    User->>AddAccountView: Create ZCash Account
    AddAccountView->>KeyringStore: Create Account
    KeyringStore->>ZCashWalletService: Initialize account
    
    User->>AccountActivityView: View ZCash Account
    AccountActivityView->>ZCashWalletService: fetchZECTransparentBalances
    ZCashWalletService-->>AccountActivityView: Return balance
    
    User->>DepositTokenView: Get deposit address
    DepositTokenView->>ZCashWalletService: zCashAccountInfo
    ZCashWalletService-->>DepositTokenView: Returns nextTransparentReceiveAddress
Loading

@nuo-xu nuo-xu merged commit f2d7581 into master May 26, 2025
18 checks passed
@nuo-xu nuo-xu deleted the feature/zcash-transparent branch May 26, 2025 07:44
@github-actions github-actions bot added this to the 1.81.x - Nightly milestone May 26, 2025
@brave-builds
Copy link
Collaborator

Released in v1.81.12

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

Labels

CI/skip-android Do not run CI builds for Android CI/skip-macos-arm64 Do not run CI builds for macOS arm64 CI/skip-windows-x64 Do not run CI builds for Windows x64 needs-security-review puLL-Merge

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Wallet/iOS] Zcash account creation and balance fetching

5 participants