Skip to content

accounts/usbwallet: full 32bit chainId support for Trezor #17439

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

Merged
merged 3 commits into from
Apr 10, 2025

Conversation

hackmod
Copy link
Contributor

@hackmod hackmod commented Aug 18, 2018

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

@hackmod hackmod requested a review from karalabe as a code owner August 18, 2018 02:52
@hackmod hackmod force-pushed the trezor-32bit-chainid branch 2 times, most recently from d980c0d to 1679ca6 Compare August 28, 2018 12:27
@hackmod
Copy link
Contributor Author

hackmod commented Aug 28, 2018

@hackmod hackmod force-pushed the trezor-32bit-chainid branch 2 times, most recently from 5092989 to 3d66ecd Compare September 6, 2018 07:17
@hackmod hackmod force-pushed the trezor-32bit-chainid branch from 3d66ecd to 32af4ec Compare January 29, 2019 18:23
@adamschmideg adamschmideg modified the milestones: 1.9.1, Backlog Jun 20, 2019
@fjl fjl changed the title full 32bit chainId support for Trezor accounts/usbwallet: full 32bit chainId support for Trezor Dec 8, 2020
@gballet gballet self-assigned this Dec 8, 2020
@fjl fjl removed the status:triage label Dec 8, 2020
@karalabe karalabe removed this from the Backlog milestone Jun 15, 2022
@gballet gballet force-pushed the trezor-32bit-chainid branch from 1d43e6a to e0bb2b6 Compare April 8, 2025 12:43
@gballet gballet added this to the 1.15.8 milestone Apr 8, 2025
@gballet gballet merged commit 4906c99 into ethereum:master Apr 10, 2025
3 of 4 checks passed
sivaratrisrinivas pushed a commit to sivaratrisrinivas/go-ethereum that referenced this pull request Apr 21, 2025
…7439)

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: trezor/trezor-mcu#399 ***merged***
- Trezor model T: trezor/trezor-core#311
***merged***

---------

Signed-off-by: Guillaume Ballet <[email protected]>
Co-authored-by: Guillaume Ballet <[email protected]>
Rampex1 pushed a commit to streamingfast/go-ethereum that referenced this pull request May 15, 2025
…7439)

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: trezor/trezor-mcu#399 ***merged***
- Trezor model T: trezor/trezor-core#311
***merged***

---------

Signed-off-by: Guillaume Ballet <[email protected]>
Co-authored-by: Guillaume Ballet <[email protected]>
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.

7 participants