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

[experimental] program derived address assertion and type guard functions don't actually assert that the address is off the curve #1764

Open
steveluscher opened this issue Oct 23, 2023 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@steveluscher
Copy link
Collaborator

steveluscher commented Oct 23, 2023

assertIsProgramDerivedAddress and isProgramDerivedAddress don't actually check to see if the address is off the curve. All they do is validate the format of the tuple.

Someone could supply a regular on-curve address there and have those guards pass.

The job is to add in the off-curve check, and to write tests.

NOTE: This still does nothing to assert that the bump seed is the correct one given the address supplied. Thoughts?

@steveluscher steveluscher added the bug Something isn't working label Oct 23, 2023
@lorisleiva
Copy link
Collaborator

lorisleiva commented Oct 23, 2023

Sure I can make that change. Both methods will become async functions but I don't think that's an issue (EDIT: It's an issue).

RE the bump: it's only valid in conjunction with an array of seeds so there would be no way to assert it's valid unless we require the seeds. Maybe that's the job for another helper method like verifyProgramDerivedAddress(pda, seeds)?

@steveluscher
Copy link
Collaborator Author

Both methods will become async functions but I don't think that's an issue.

🪦 microsoft/TypeScript#37681 (comment)

@steveluscher steveluscher added enhancement New feature or request and removed bug Something isn't working labels Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants