Skip to content

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

Merged
gballet merged 3 commits intoethereum:masterfrom
hackmod:trezor-32bit-chainid
Apr 10, 2025
Merged

accounts/usbwallet: full 32bit chainId support for Trezor#17439
gballet merged 3 commits intoethereum:masterfrom
hackmod:trezor-32bit-chainid

Conversation

@hackmod
Copy link
Copy Markdown
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
Copy Markdown
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
Comment thread accounts/usbwallet/trezor.go Outdated
Comment thread accounts/usbwallet/trezor.go Outdated
hackmod and others added 3 commits April 8, 2025 14:30
Signed-off-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
@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 <3272758+gballet@users.noreply.github.com>
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
jakub-freebit pushed a commit to fblch/go-ethereum that referenced this pull request Jul 3, 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 <3272758+gballet@users.noreply.github.com>
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
howjmay pushed a commit to iotaledger/go-ethereum that referenced this pull request Aug 27, 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 <3272758+gballet@users.noreply.github.com>
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
gzliudan pushed a commit to gzliudan/XDPoSChain that referenced this pull request Sep 3, 2025


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 <3272758+gballet@users.noreply.github.com>
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
gzliudan added a commit to XinFinOrg/XDPoSChain that referenced this pull request Sep 3, 2025
 (#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: trezor/trezor-mcu#399 ***merged***
- Trezor model T: trezor/trezor-core#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>
gballet added a commit to gballet/go-ethereum that referenced this pull request Sep 11, 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 <3272758+gballet@users.noreply.github.com>
Co-authored-by: Guillaume Ballet <3272758+gballet@users.noreply.github.com>
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