Upgrade secp256k1 to k256 (Agave-specific)
- Idea
- Draft
- Review
- Accept
- Implement
- Active
Decision brief
Why this proposal matters
Transition the secp256k1 precompile and syscall implementation in the Agave validator client from the libsecp256k1 crate to the k256 crate. This is an Agave-specific upgrade, but make this upgrade behind a feature gate for safety.
Proposal at a glance
What changes
- Feature Gate: Introduce a new feature gate named secp256k1_use_k256.
- Client-Specific Behavior: Because this is an Agave implementation detail, this will be an empty (no-op) feature gate for other validator clients, such as Firedancer, requiring no functional changes on their end.
- Precompile Implementation: Retain the existing precompile function utilizing the libsecp256k1 crate.
Stakeholder map
Who is affected
Builders & client teams Medium impact
The implementation will introduce a new feature gate and maintain dual implementations of the secp256k1 operations to facilitate a safe transition.
Action requirement unknownValidators & operators Medium impact
Client-Specific Behavior: Because this is an Agave implementation detail, this will be an empty (no-op) feature gate for other validator clients, such as Firedancer, requiring no functional changes on their end.
Action requirement unknownUsers & stakers Impact unknown
No proposal-specific evidence was found for this group.
Action requirement unknownGovernance & ecosystem Impact unknown
No proposal-specific evidence was found for this group.
Action requirement unknownExact source revision
Full proposal document
0616093b2952Summary
Transition the secp256k1 precompile and syscall implementation in the Agave
validator client from the libsecp256k1 crate to the k256 crate. This is an
Agave-specific upgrade, but make this upgrade behind a feature gate for safety.
Motivation
Currently, Agave utilizes the libsecp256k1 crate for the secp256k1
precompile and syscall implementation. Because this crate is no longer actively
maintained, a transition to the k256 crate has been under consideration for
some time.
However, swapping out cryptographic dependencies carries inherent consensus risks; any differing behavior between the crates could result in a network fork. While we believe we have a strong understanding of the behavioral differences between the two crates, executing this transition behind a feature gate is the safest approach to minimize risk.
New Terminology
N/A
Detailed Design
The implementation will introduce a new feature gate and maintain dual
implementations of the secp256k1 operations to facilitate a safe transition.
- Feature Gate: Introduce a new feature gate named
secp256k1_use_k256.- Client-Specific Behavior: Because this is an Agave implementation detail, this will be an empty (no-op) feature gate for other validator clients, such as Firedancer, requiring no functional changes on their end.
- Precompile Implementation: Retain the existing precompile function utilizing
the
libsecp256k1crate.- Add a new version of the precompile function utilizing the
k256crate. - Introduce branching logic:
- If
secp256k1_use_k256is inactive, invoke thelibsecp256k1version. - If
secp256k1_use_k256is active, invoke thek256version.
- If
- Add a new version of the precompile function utilizing the
- Syscall Implementation:
- Apply the exact same dual-implementation and branching logic to the
secp256k1syscall execution path.
- Apply the exact same dual-implementation and branching logic to the
Alternatives Considered
The primary alternative is to replace the libsecp256k1 crate with k256
directly, without guarding the transition behind a feature gate. While this
approach would slightly reduce implementation boilerplate, it carries
consensus risk. If there is any subtle, uncaught differing behavior
between the two cryptographic implementations, a direct upgrade would
result in a network fork.
Impact
There is no intended functional or performance impact on the network. Assuming
our understanding of the behavioral differences between libsecp256k1 and
k256 is accurate, and the normalization logic is implemented correctly, the
execution results will be perfectly identical. The feature gate serves strictly
as an additional safety measure to prevent any unintended consensus divergence.
Security Considerations
The primary security risk is a consensus failure leading to a network fork if
the k256 implementation diverges from libsecp256k1 in any edge cases. To
mitigate this, the new implementation will undergo extensive differential
fuzzing (via solfuzz-agave) and testing against known vectors to guarantee
exact execution parity before the feature gate is activated on mainnet.
Backwards Compatibility
Prior to the activation of the feature gate, there are no changes to the
consensus rules or precompile behavior; Agave will continue to use the
legacy libsecp256k1 implementation.
Post-activation, the new k256 implementation is designed to perfectly
emulate the behavior of the current libsecp256k1 version. It will remain
fully backwards compatible, and smart contracts or applications relying on
the secp256k1 precompile or syscall will not require any modifications.
Evidence graph
Related proposals and rollout
One or more sources are unavailable.
Upstream review record
Upstream discussion & review
One or more sources are unavailable.
Provenance
Evidence & technical details
Rollout or chain data, source revisions, freshness and integrity. 3
Provenance
Evidence & technical details
Rollout or chain data, source revisions, freshness and integrity.SIMD
Deployment Status
Feature Gate not yet created
Exact source revision
Sources & integrity
- Proposal document pinned_commit_blob
0616093b2952ed6de52c4a27d66aadd11d48d4f9 - simd-document document · stale · Sep 11, 2026
0616093b2952ed6de52c4a27d66aadd11d48d4f9
One or more sources are unavailable.
One or more sources are unavailable.
simd.watch community discussion · SIMD-0505
Powered by Giscus · Sign in with GitHub to comment
Community comments load when this section approaches the viewport.