Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/zcash locktime txversion #9121

Open
wants to merge 14 commits into
base: develop
Choose a base branch
from
Open

Conversation

Wozacosta
Copy link
Contributor

@Wozacosta Wozacosta commented Feb 5, 2025

⚠️: DO NOT MERGE BEFORE THE FIRMWARE APP BEING UPDATED (track its progress here)

UPDATE 06 feb.: Zcash 2.3.1 is available on P4 provider for all devices.

✅ Ensures NU5 and NU6 transactions are properly supported and signed.
✅ Fixes issues with missing block height in transaction inputs.
✅ Aligns Ledger Live libraries (hw-app-btc, coin-bitcoin) with [Ledger's Zcash app]((LedgerHQ/app-zcash@develop...LedgerHQ:app-zcash:fix/apa/nu5_utxo_retrocompatibility)

✅ Checklist

  • npx changeset was attached.
  • Covered by automatic tests.
  • Impact of the changes:
    • ...

📝 Description

1. Support for Zcash NU6 (in hw-app-btc)

  • Constants added: ZCASH_NU6_ACTIVATION_HEIGHT = 2726400 in constants.ts.
  • New function getZcashTransactionVersion(blockHeight: number | undefined) and
    getDefaultVersions
  • Transaction version handling modified in createTransaction.ts.

2. Handling Block Height in Inputs

Expanded input tuple format:
Before: [Transaction, number, string | null | undefined, number | null | undefined]
After: [Transaction, number, string | null | undefined, number | null | undefined, number | null | undefined]

Changes in multiple files:
signer.ts, wallet.ts, xpub.ts, and BtcNew.ts all updated to pass block height information.

3. Tests for Zcash Transactions

New test suite added:
xpub.txs.zcash.integration.test.ts tests block height inclusion in transactions.
createTransaction.test.ts covers Zcash NU5 and NU6 transactions. Checking for correct apdus being sent

4. Zcash Ledger App Updates

transaction_parse() now correctly detects the zcash transaction version and hashes it as appropriately.

❓ Context

  • JIRA or GitHub link: LIVE-15367

🧐 Checklist for the PR Reviewers

  • The code aligns with the requirements described in the linked JIRA or GitHub issue.
  • The PR description clearly documents the changes made and explains any technical trade-offs or design decisions.
  • There are no undocumented trade-offs, technical debt, or maintainability issues.
  • The PR has been tested thoroughly, and any potential edge cases have been considered and handled.
  • Any new dependencies have been justified and documented.
  • Performance considerations have been taken into account. (changes have been profiled or benchmarked if necessary)

Copy link

vercel bot commented Feb 5, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

4 Skipped Deployments
Name Status Preview Comments Updated (UTC)
ledger-live-github-bot ⬜️ Ignored (Inspect) Visit Preview Feb 6, 2025 9:56am
native-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Feb 6, 2025 9:56am
react-ui-storybook ⬜️ Ignored (Inspect) Visit Preview Feb 6, 2025 9:56am
web-tools ⬜️ Ignored (Inspect) Visit Preview Feb 6, 2025 9:56am

@Wozacosta Wozacosta marked this pull request as ready for review February 6, 2025 12:35
@Wozacosta Wozacosta requested a review from a team as a code owner February 6, 2025 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ledgerjs Has changes in the ledgerjs open source libs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant