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

auth method id for eth wallet is just the wallet address #442

Closed
wants to merge 1 commit into from

Conversation

glitch003
Copy link
Collaborator

@glitch003 glitch003 commented Apr 25, 2024

The encoding for the EthWallet auth method type was wrong. It should just be the raw address. You can see this in the PKPPermissions facet here: https://github.com/LIT-Protocol/lit-assets/blob/8d26f49faf8d1648fb50deb9ff8d45a68ed49f80/blockchain/contracts/contracts/lit-node/PKPPermissions/PKPPermissionsFacet.sol#L506

Note that there is not ":lit" appended, no keccak256, etc. it's just the address bytes.

For context, this is the function where the changed line is:

public static async authMethodId(authMethod: AuthMethod): Promise<string> {
    let address: string;

    try {
      address = JSON.parse(authMethod.accessToken).address;
    } catch (err) {
      throw new Error(
        `Error when parsing auth method to generate auth method ID for Eth wallet: ${err}`
      );
    }

    return address;
  }

@joshLong145
Copy link

@glitch003
We need to hold off merging this until the below ticket is ready on the nodes:
https://linear.app/litprotocol/issue/LIT-3035/fix-check-for-raw-address-when-verifying-the-eth-authmethod

@Ansonhkg
Copy link
Collaborator

Is this still valid @glitch003 @joshLong145 @DashKash54 ?

@Ansonhkg
Copy link
Collaborator

Closing for now.

@Ansonhkg Ansonhkg closed this Jul 17, 2024
@Ansonhkg Ansonhkg reopened this Jul 22, 2024
@Ansonhkg Ansonhkg marked this pull request as draft July 22, 2024 16:37
@glitch003
Copy link
Collaborator Author

i looked into this - it's done already on the node side https://github.com/LIT-Protocol/lit-assets/pull/1077

the node accepts either format - this is the function that checks if you're curious - https://github.com/LIT-Protocol/lit-assets/blob/74fcbfa0aa4425a94e264168a2290c8fe8826267/rust/lit-node/src/pkp/auth/mod.rs#L548

@Ansonhkg Ansonhkg closed this Jul 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants