go-ethereum/accounts
Daniel Liu 4e3bd78545
accounts/usbwallet: full 32bit chainId support for Trezor #17439 (#1419)
This fix allows Trezor to support full 32bit chainId in geth, with the
next version of firmware.

For `chainId > 2147483630` case, Trezor returns signature bit only.
- Trezor returns only signature parity for `chainId > 2147483630` case.
- for `chainId == 2147483630` case, Trezor returns `MAX_UINT32` or `0`,
but it doesn't matter.
  (`2147483630 * 2 + 35` = `4294967295`(`MAX_UINT32`))

chainId | returned signature_v | compatible issue
---------|------------------------|--------------------
0 < chainId <= 255 | chainId * 2 + 35 + v | no issue (firmware `1.6.2`
for Trezor one)
255 < chainId <= 2147483630 | chainId * 2 + 35 + v | ***fixed.***
*firmware `1.6.3`*
chainId > 2147483630 | v | *firmware `1.6.3`*

Please see also: full 32bit chainId support for Trezor
- Trezor one: https://github.com/trezor/trezor-mcu/pull/399 ***merged***
- Trezor model T: https://github.com/trezor/trezor-core/pull/311
***merged***

---------

Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
Co-authored-by: HackyMiner <hackyminer@gmail.com>
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
2025-09-03 15:48:01 +08:00
..
abi cmd/abigen, accounts/abi/bind: implement abigen version 2 #31379 (#1416) 2025-09-03 15:47:12 +08:00
keystore cmd/abigen, accounts/abi/bind: implement abigen version 2 #31379 (#1416) 2025-09-03 15:47:12 +08:00
scwallet accounts: avoid duplicate regex compilation (#29943) 2025-01-24 16:54:12 +08:00
usbwallet accounts/usbwallet: full 32bit chainId support for Trezor #17439 (#1419) 2025-09-03 15:48:01 +08:00
accounts.go accounts: fix typo (#1413) 2025-09-03 15:44:49 +08:00
accounts_test.go accounts: run tests in parallel (#28544) 2025-01-24 16:54:12 +08:00
errors.go accounts: fix typo in comments (#24805) 2025-01-24 16:54:11 +08:00
hd.go accounts: fix typo in comments (#24805) 2025-01-24 16:54:11 +08:00
hd_test.go accounts: run tests in parallel (#28544) 2025-01-24 16:54:12 +08:00
manager.go accounts: properly close managed wallets when closing manager (#28710) 2025-01-24 16:54:12 +08:00
sort.go accounts: smartcard wallet without the dependency on libpcsclite (#19273) 2025-01-24 16:18:29 +08:00
url.go accounts: add unit tests for URL (#17182) 2025-01-24 16:18:28 +08:00
url_test.go accounts: add unit tests for URL (#17182) 2025-01-24 16:18:28 +08:00