GuidesUnderstanding Solana’s Precompiled Programs for Cryptography

Understanding Solana’s Precompiled Programs for Cryptography

Estimated reading time: 2 min

Solana has three precompiled programs for cryptographic verification: Ed25519, Secp256k1 and Secp256r1. According to the official Solana documentation, these programs bypass the sBPF virtual machine and execute as native code inside the validator. The documentation says the cryptographic operations would be too slow if executed in sBPF.

✦ KEY TAKEAWAYS
  • Three Solana precompiles handle specific signature verification operations as native validator code.
  • Ed25519 checks one or more signatures; Secp256k1 checks public key recovery; Secp256r1 checks up to eight signatures per instruction.
  • These precompiles cannot be called through cross-program invocation (CPI).

What a precompile does

A normal Solana program runs in the sBPF virtual machine. A precompiled program takes a different execution path: the validator runs its implementation as native code. The official documentation presents this path for cryptographic operations that would be too slow inside sBPF. This describes the execution mechanism; the page does not quantify a network-wide performance gain.

The three precompiles serve distinct verification tasks. They are invoked through transaction instructions rather than through CPI, so a program cannot simply call one from another program. That limitation matters when designing a transaction that needs one of these checks.

How the three checks differ

Ed25519 verifies one or more Ed25519 signatures in a single instruction. The instruction identifies the signatures, public keys and message data to check. If any signature fails verification, the program returns an error.

Secp256k1 verifies public key recovery operations, also called ecrecover. Its instruction identifies the signature, recovery information, reference address and message data. The documentation says signature and message data may refer to other instruction data in the same transaction.

Secp256r1 verifies up to eight signatures in one instruction. It uses a signature, public key and message for each check, and returns an error if any check fails. The documentation also says low-S values are enforced for signatures to avoid accidental signature malleability.

For readers exploring transaction structure and related concepts, see our Solana guides. The official reference gives the exact instruction layouts for developers.

Correction, October 9, 2026: An earlier version made broader performance and compatibility claims than the cited documentation supports. This version describes the documented behavior and limits.

TheSolanaPulse Editorial Team
TheSolanaPulse Editorial Team
TheSolanaPulse Editorial Team covers Solana news, DeFi, market analysis and ecosystem developments. Our content is AI-assisted and human-reviewed, with a focus on accuracy, context and editorial independence.
spot_imgspot_img

● TheSolanaPulse Daily

Stay ahead of the Solana market.

Get the top Solana stories every morning - price action, market signals, DeFi opportunities, ecosystem updates, validator news, and high-value insights. Everything you need, without the noise.

Free • No spam • Unsubscribe anytime • 100% Solana focused

spot_imgspot_img

Latest stories

● TheSolanaPulse Daily

Stay ahead of the Solana market.

Get the top Solana stories every morning - price action, market signals, DeFi opportunities, ecosystem updates, validator news, and high-value insights. Everything you need, without the noise.

Free • No spam • Unsubscribe anytime • 100% Solana focused

spot_imgspot_img

You might also like...