-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
fix: land program addresses off-curve #11355
fix: land program addresses off-curve #11355
Conversation
e05fc4c
to
70716cb
Compare
Codecov Report
@@ Coverage Diff @@
## master #11355 +/- ##
==========================================
- Coverage 81.9% 75.2% -6.7%
==========================================
Files 320 29 -291
Lines 75012 1344 -73668
Branches 0 154 +154
==========================================
- Hits 61449 1012 -60437
+ Misses 13563 299 -13264
- Partials 0 33 +33 |
web3.js/src/publickey.js
Outdated
static async findProgramAddress( | ||
seeds: Array<Buffer | Uint8Array>, | ||
programId: PublicKey, | ||
): Promise<[PublicKey, number]> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mvines Looks like this is causing esdoc issues, is there a better way then making [Pubkey, number] as a new type?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've run into similar limitations in the past, a new type got me past it :-/
f8646a7
to
345ed62
Compare
345ed62
to
dbee74d
Compare
(cherry picked from commit 5c4b815) # Conflicts: # web3.js/module.flow.js # web3.js/src/publickey.js # web3.js/test/publickey.test.js
(cherry picked from commit 5c4b815)
Problem
The derived program address may land on the ed25519 curve and have a signer.
Summary of Changes
The signature verifier only accepts public keys that are on the curve. To separate the space between keypairs and program addresses force all program address to be off the curve.
This PR also adds a new syscall so that programs can call create_program_address. This is necessary because the dependency used to validate off curve has dependencies that are not compatible with BPF programs.
This is a compliment PR to #11323
Fixes #