Release v4.13.1 - #1004
Open
gummy789j wants to merge 7 commits into
Open
Conversation
fix: tron derivation path
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Notice
Non-mandatory upgrade
If you created HD accounts at index
1or above on 4.13.0 or earlier, readTroubleshooting before upgrading — those TRON addresses need one export step
that must happen while the old wallet is still intact.
New Features
Change
deriveno longer demands a seed id. It now selects the HD wallet the way every other account command does:--account <accountId | label | address>names any account of the wallet, and with neither flag the active account decides.--seed-id wlt_…still works and takes precedence, so an existing script is unaffected, whilewallet-cli deriveon its own is now the common case. Selecting an account that belongs to a private-key, watch-only or Ledger wallet fails withseed_not_foundat exit2and says which flag to reach for;--indexnames the address index inm/44'/<coin>'/0'/0/<index>, and re-running it on an index that already exists remains a no-op that re-activates the slot. (#1003)backupasks which format you want. In an interactive terminal, omitting--keystorenow opens a two-line choice — Native wallet backup (the recovery phrase for the whole HD wallet) or Web3 keystore (the single private key for the selected network's family) — instead of silently taking the native path. The prompt appears only for a fully interactive invocation: passing--keystore, or piping the password in with--password-stdin, keeps the long-standing non-interactive default, so pipes and CI stay deterministic. A native backup of a seed wallet now also warns about any account this version's default mnemonic recovery would not recreate, naming each one with the exactbackup --keystorecommand that preserves it. (#1003)derivationPathis now only ever reported by a command that actually opened the seed.list,current,useandrenameneed no master password, and without the seed they cannot tell an account derived under the old TRON template from one derived under the corrected one — so rather than print the current template as though it were an observed fact, they now returnderivationPath: nullfor every account. A consumer that readderivationPathfrom those four commands must switch to a command that unlocks the seed:deriveandbackupresolve each cached address against its actual current or historical template before reporting, so their value is verified rather than assumed.ledger,watchandprivateKeyaccounts returnnullas before. (#1003)Bug Fixes
Change
HD accounts on TRON were derived at a path no other TRON wallet scans.
derive --index 1produced its TRON key atm/44'/195'/1'/0/0, hanging the number at BIP44's account level, while TronLink, the Java wallet-cli and the wider TRON ecosystem all increment address_index. The address was real and the funds are safe, but restoring the same recovery phrase in any other wallet would not show it. TRON now derives atm/44'/195'/0'/0/<index>, the same shape EVM already used, so a derived account follows the default restore flow everywhere. Index0is identical under both templates and is unaffected; only index1and above were reachable at the old path. Accounts already sitting there are detected rather than overwritten: the stored address is resolved against both templates before any key is used, so signing such an account fails with the newlegacy_derivationcode (exit1) pointing at the recovery guide instead of signing with a different key; deriving a further account into that wallet is refused for the same reason, because one wallet must never mix templates; the 4.13.0 → 4.13.1 wallet-file migration keeps a cached TRON address that the old template explains, rather than re-deriving over it; andbackup --keystoredeliberately still exports the old path's key, since that is the one command whose whole purpose is to let the key leave. A stored address that no template explains is a different failure with a different fix —wallets.jsonand the encrypted vault disagree — and now raisesderivation_mismatchinstead of being papered over. Both codes are published in--json-schema, and the complete ordered recovery procedure ships with the release. (#1003)import ledger --indexdid not mean what the device shows. The index was fed through the software derivation template, so on EVM it registeredm/44'/60'/0'/0/<index>— an account Ledger Live does not display, leaving a user who picked "account 1" on their device with a different address than the one in front of them. Hardware paths are now built from Ledger Live's own template,m/44'/<coin>'/<index>'/0/0, for both families; TRON's path is unchanged, since that already was the template it used.--pathremains the way to register any other scheme explicitly,--addressscans Ledger Live accounts to find one, and the interactive account picker now prints each candidate's full path next to its address and says which template it is listing — so an account that lives on another scheme can no longer be silently mistaken for absent. (#1003)Troubleshooting
legacy_derivation— recovering TRON addresses derived before this release.If a TRON account was derived at index
1or above by 4.13.0 or earlier, it lives atm/44'/195'/<index>'/0/0, a path this version no longer produces. Signing it, or deriving anotheraccount into the same wallet, now fails with
legacy_derivation(exit1). The key is not lost —the recovery phrase still derives it at that path — but this version's default import and derive
flow will not recreate the address, so it must be preserved before the wallet is rebuilt:
The full procedure — save the account list and recovery phrase, export each affected TRON account
with
backup --keystoreand re-import it as a standalone account, then delete and re-import themnemonic wallet and re-derive every index — is documented in
Recover addresses after
legacy_derivation.Ethereum derivation did not change, so every EVM address is restored unchanged by the re-import;
only TRON at index
1and above needs the export step. Do not delete the mnemonic wallet untilevery TRON address you need appears as a standalone private-key account. The whole procedure
reorganizes local keys only — it moves no funds on chain.
derivation_mismatchis a different failure and has no such rescue: it means the stored addressmatches no derivation path of its seed, which an edited
wallets.jsonor a wallet pointing at thewrong vault would cause.