foundry icon indicating copy to clipboard operation
foundry copied to clipboard

Can't verify signature with Trezor One

Open fedealconada opened this issue 9 months ago • 1 comments

Component

Cast

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

  • [X] Foundry
  • [X] 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 avatar May 24 '24 10:05 fedealconada