| Crates.io | brine-ed25519 |
| lib.rs | brine-ed25519 |
| version | 0.2.0 |
| created_at | 2025-04-10 22:23:02.942162+00 |
| updated_at | 2025-07-07 21:41:34.169303+00 |
| description | Ed25519 signature verification for Solana SVM programs using curve25519 syscalls |
| homepage | |
| repository | https://github.com/zfedoran/brine-ed25519 |
| max_upload_size | |
| id | 1628982 |
| size | 23,196 |
A fast, low-overhead, Ed25519 signature verification library for the Solana SVM.
| Operation | CU (Approx.) |
|---|---|
sig_verify |
~30,000 |
These value was measured inside the Solana SVM (via test programs), it depends on the size of the data (32 bytes in this case).
Signature verification roughly follows RFC 8032
use brine_ed25519::sig_verify;
let pubkey: [u8; 32] = [...];
let sig: [u8; 64] = [...];
let message = b"hello world";
sig_verify(&pubkey, &sig, message)?;
Returns Ok(()) if valid, or Err(SignatureError) if the signature is invalid.
Q: Why not use the native Ed25519 program?
A: Solana does provide a Ed25519 pre-compile program for signature verification—but it comes with several downsides:
instruction_sysvar to be passed into your programThis crate, brine-ed25519, solves all of that.
This implementation is pulled from code-vm (MIT-licensed), which was written and maintained by the author of this crate.
Big thanks to both reviewers for helpful suggestions and CU reductions!
Contributions are welcome! Please open issues or PRs on the GitHub repo.