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

Update Chain ID for testnet domain hash calculation in withdrawal signing #4

Conversation

nkuba
Copy link

@nkuba nkuba commented Nov 25, 2024

We update the Chain ID defined for the testnet domain used in the withdrawal transaction
hash calculation.

The value has to match the Sepolia Chain ID, which is 11155111 (0xaa36a7).
Previously, we used 1115511 (0x110577), which was a typo.

It is expected that for testnet the data:

{
  to: "0xc14972DC5a4443E4f5e89E3655BE48Ee95A795aB",
  value: "0x0",
  data: "0xcae9ca510000000000000000000000007e184179b1F95A9ca398E6a16127f06b81Cb37a3000000000000000000000000000000000000000000000000002386F26FC10000000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000001000000000000000000000000006083Bde64CCBF08470a1a0dAa9a0281B4951be7C4fa8f3322330a4be2d34fdd2a573eaa5f94c7fe5000000000000000000000000d2f85a52fee8ee905e504f75dcf34156b2503004de1079ddaeceaf643b38a034000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000005835b17e900000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000001a1976a914c8e9edf5e915c0482b1b236fc917011a4b943e6e88ac000000000000",
  operation: 0,
  safeTxGas: "0x0",
  baseGas: "0x0",
  gasPrice: "0x0",
  gasToken: "0x0000000000000000000000000000000000000000",
  refundReceiver: "0x0000000000000000000000000000000000000000",
  nonce: 8,
}

will result in the transaction hash:

0xa580c0c5a0b8e731f7b7fe8ea3ee41cf0dbe78b352b55ae090160659e2d7410c

Helper calculation script: https://gist.github.com/nkuba/6e112d736077827362102f7bd93e5cea

We update the Chain ID defined for testnet domain used in withdrawal transaction
hash calculation.

The value has to match the Ethereum Sepolia Chain ID which is 11155111 (0xaa36a7).
Previously we used 1115511 (0x110577) which was a typo.
The expected result for the sign withdraw test has been updated to reflect
the changes in the withdrawal domain hash calculation.
@nkuba nkuba changed the title Fix withdrawal domain hash calculation testnet Update Chain ID for testnet domain hash calculation in withdrawal signing Nov 25, 2024
@cedelavergne-ledger cedelavergne-ledger merged commit 4f0c92e into LedgerHQ:develop Nov 27, 2024
41 checks passed
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.

2 participants