Skip to content

feat(zcash): add transaction pages with shielded bundles and fee lookup - #409

Open
MatiasOS wants to merge 4 commits into
issue-398-zcash-blocksfrom
issue-398-zcash-transactions
Open

MatiasOS wants to merge 4 commits into
issue-398-zcash-blocksfrom
issue-398-zcash-transactions

Conversation

@MatiasOS

Copy link
Copy Markdown
Member

Description

Adds the Zcash transactions list (/zec/txs) and transaction detail (/zec/tx/:filter) pages, plus their tzec equivalents.

The transaction page handles three things that make Zcash different from Bitcoin:

  • Shielded bundles: Sapling spends and outputs, Orchard and Ironwood actions, and Sprout JoinSplits. Each bundle shows which way its value balance moved.
  • Fully shielded transactions: when vin and vout are both empty, the page explains that amounts and parties are encrypted. It doesn't render empty input and output columns.
  • Fees: computed from the transparent value balance: inputs, plus value leaving the shielded pools, minus outputs.
    • Zebra doesn't return the values of transparent inputs.
    • For transactions with transparent inputs, a "Look up input values" button fetches the previous transactions on demand, up to 10.

The transactions list pages client-side within a single block, which costs one getblock call. Newer/older block navigation works out the chain tip from the block's confirmations, so it needs no extra call.

Related Issue

Part of #398. Stacked on #408.

Type of Change

  • Bug fix
  • New feature
  • Documentation update
  • Refactoring
  • Performance improvement
  • Other (please describe):

Changes Made

  • New components: ZcashTransactionsPage, ZcashTransactionPage, ZcashTransactionDisplay and ZcashShieldedBundles.
  • A countPreviousTransactions util, with a unit test.
  • A shared labels.ts holding the typed i18n keys for pools and transaction kinds. The existing dashboard and block components now use it too.
  • Routes and lazy exports for zec|tzec/txs and zec|tzec/tx/:filter.
  • zcash locale strings and tooltips.zcash.tx in all 5 locales.
  • A hermetic e2e spec at e2e/tests/shared/mocked/zcash-transactions.spec.ts. The shared RPC mock now also serves transactions:
    • a synthetic transparent transaction
    • previous transactions for input lookups

Screenshots (if applicable)

Checked locally against mocked RPC data:

  • a fully shielded transaction
  • a transparent transaction after its input lookup
  • the capped shielding transaction
  • the transactions list
  • a 400px-wide layout

Checklist

  • I have run npm run format:fix and npm run lint:fix
  • I have run npm run typecheck with no errors
  • I have run tests with npm run test:run
  • I have tested my changes locally
  • I have updated documentation if needed
  • My code follows the project's architecture patterns

Additional Notes

  • Fees on real mainnet transactions:
    • 36a167f6…, which is Ironwood only: 0.0001 ZEC.
    • c973d2f1…, which uses Sapling and Ironwood: 0.0002 ZEC.
    • 717b54c3… has 15 transparent inputs, so the lookup stops at 10 and the page says so.
  • Caching: when the persistent cache is enabled, resolved input values are cached with a confirmed transaction. A later visit shows the fee without new lookups.
  • Tests:
    • npm run test:run: 151 passing.
    • Hermetic Zcash e2e specs: 9 passing.

Fully shielded transactions explain that amounts are encrypted instead of rendering empty input and output columns. Fees come from value balances; transparent input values, which Zebra omits, are looked up on demand for at most 10 previous transactions.
@MatiasOS
MatiasOS added this pull request to stack #414 September 15, 2026 00:17
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.

1 participant