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

Can't verify signature with Trezor One #7986

Closed
2 tasks done
fedealconada opened this issue May 24, 2024 · 4 comments
Closed
2 tasks done

Can't verify signature with Trezor One #7986

fedealconada opened this issue May 24, 2024 · 4 comments
Assignees
Labels
C-cast Command: cast T-bug Type: bug

Comments

@fedealconada
Copy link

fedealconada commented May 24, 2024

Component

Cast

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (b1f4684 2024-05-24T00:20:26.633676000Z)

What command(s) is the bug in?

cast wallet sign "message" --trezor

Operating System

macOS (Apple Silicon)

Describe the bug

I'm trying to sign a message using my Trezor One, which seems to work, but then fails when I try to verify it.

You can reproduce this by copy-pasting the below script on your command line. It simply signs a message with --trezor and then tries to verify it: Validation failed. Address 0xADDRESS did not sign this message.

This same script works well using --private-key or --ledger.

# Set the message
MESSAGE="some message"

# Check the address that will be used for signing
echo "Checking address with Trezor..."
SIGNER_ADDRESS=$(cast wallet address --trezor)
echo "Signer Address: $SIGNER_ADDRESS"

# Generate the signature using Trezor
echo "Signing message $MESSAGE with Trezor..."
SIGNATURE=$(cast wallet sign "$MESSAGE" --trezor)
echo "Signature: $SIGNATURE"

# Verify the signature using the original message
echo "Verifying the signature..."
cast wallet verify --address "$SIGNER_ADDRESS" "$MESSAGE" "$SIGNATURE"

Thanks!

@fedealconada fedealconada added the T-bug Type: bug label May 24, 2024
@fedealconada
Copy link
Author

I think this is because the signature r value of the generated signature is 01 and should be 1B (27)?

@DaniPopes
Copy link
Member

Do you mean v value? In anyway that's strange because we're just passing through the values we get from the Trezor device directly. cc @klkvr

@zerosnacks zerosnacks added the C-cast Command: cast label Jun 27, 2024
@zerosnacks zerosnacks self-assigned this Jul 16, 2024
@zerosnacks
Copy link
Member

zerosnacks commented Jul 16, 2024

Related: #7660 + #7342 + alloy-rs/alloy#1045 + trezor/trezor-firmware#3952

Fix will be included in the next Alloy release

@zerosnacks
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cast Command: cast T-bug Type: bug
Projects
None yet
Development

No branches or pull requests

3 participants