Skip to content

Verify signature locally #168

Description

@Marchand-Nicolas

Description 📹

Currently, verifying signatures on Starknet via is_valid_signature fails if the account is not deployed. This leads to the error: "your wallet is not yet initialized, please make a transaction (sending ETH to yourself works) to initialize it." To support undeployed accounts, we propose directly verifying the signature using the public key (account address), bypassing the need to interact with the account's contract.

Proposed Actions 🛠️

Here’s a checklist of actions to follow for resolving this issue:

  1. Fork and Create Branch:
    Fork the repository and create a new branch using the issue number:
   git checkout -b fix-[issue-number]
  1. Implement Changes:
  • Create a utility function to verify Starknet signatures using public keys directly.
  • Integrate this function as a fallback when account is not yet deployed.
  • Detect if an account is deployed or not before calling is_valid_signature.
  • Add error handling and logging for both methods of verification.
  • Write unit tests for both deployed and undeployed account scenarios.

Example snippet for direct signature verification:

def verify_signature(pubkey, message_hash, signature):
    # Apply Starknet signature verification logic using elliptic curve math
    return starknet_ec_verify(pubkey, message_hash, signature)
  1. Run Tests and Commit Changes:
    Make sure your changes don't break existing functionality and commit with a clear message:
   git commit -m "Fix: Allow signature verification for undeployed Starknet accounts"

Required 📋

To keep our workflow smooth, please make sure you follow these guidelines:

  • Assignment: Don't create a pull request if you weren’t assigned to this issue.
  • Timeframe: Complete the task within 3 business days.
  • Closing the Issue: In your PR description, close the issue by writing Close #[issue_id].
  • Review Process:
    • Once you've submitted your PR, change the label to "ready for review".
    • If changes are requested, address them and then update the label back to "ready for review" once done.
  • Testing: Test your PR locally before pushing, and verify that tests and build are working after pushing.

Thank you for your contribution 🙏

⚠️ WARNING: Failure to follow the requirements above may result in being added to the OnlyDust blacklist, affecting your ability to receive future rewards.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestexpert issueonlydust-waveContribute to awesome OSS repos during OnlyDust's open source weekopen for contributionAn issue that is available for an Only Dust contribution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions