Skip to content

[program, secp256k1-verify] Add secp256k1-verify library#6

Merged
samkim-crypto merged 4 commits into
solana-program:mainfrom
samkim-crypto:refactor
Jul 1, 2026
Merged

[program, secp256k1-verify] Add secp256k1-verify library#6
samkim-crypto merged 4 commits into
solana-program:mainfrom
samkim-crypto:refactor

Conversation

@samkim-crypto

@samkim-crypto samkim-crypto commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

I refactored out the verification logic in the current program into a separate library so that other projects and choose to verify signatures inside their own programs without invoking our secp256k1 program.

I tried to design the verifier API to be flexible so that developers can choose the configuration they want out of the box. See the README.md for examples.

I noticed a couple of room for improvements, which I created github issues for.

@samkim-crypto samkim-crypto marked this pull request as ready for review June 25, 2026 10:14
@samkim-crypto samkim-crypto requested a review from zz-sol June 25, 2026 10:14

@zz-sol zz-sol left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks.

Can you please also update the make file so that CI covers unit tests for the new crate? currently it checks program only


[dependencies]
solana-secp256k1-recover = { workspace = true }
solana-keccak-hasher = { workspace = true, optional = true }

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like keccak cannot be optional

cargo check -p solana-secp256k1-verify --no-default-features --features sha256

failed for me.

Also it seems that all the use cases (such as evm address) requires keccak so it makes sense to make it non-optional.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay yeah the problem was that the feature scoping was incomplete. I made the library explicitly support non-EVM verification, which technically doesn't require keccak, so I don't think we should make keccak mandatory. I updated the code, so let me know how it looks!

@samkim-crypto samkim-crypto merged commit 74a9485 into solana-program:main Jul 1, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants