Comparing the performance of ECDSA signature validation in OpenSSL vs. libsecp256k1 over the last decade

Nov 1 - Nov 10, 2025

  • The v31.0 release of Bitcoin Core signifies a decade since the significant transition from OpenSSL to libsecp256k1 for ECDSA signature validation, a move that has notably improved the efficiency and performance of signature validation processes.

Initially integrated in 2015, this shift has rendered signature validation multiple times faster, with ongoing enhancements further increasing the performance gap between libsecp256k1 and OpenSSL. Despite OpenSSL's broad applications in general-purpose cryptography, it has lagged in specific advancements for elliptic curve cryptography, particularly on the secp256k1 curve, which libsecp256k1 has continuously optimized for better performance.

A unique benchmarking methodology, detailed on GitHub (secp256k1-plugbench), was employed to compare the performance of different versions of OpenSSL and libsecp256k1 in verifying ECDSA signatures. This method involves generating input data with a statically linked version of libsecp256k1 and dynamically loading each library version to measure signature verification speeds, ensuring a direct and fair comparison across versions. The results showcased libsecp256k1's superior performance, with certain versions achieving significant speedups due to optimizations like the GLV endomorphism optimization and safegcd-based modular inverses. These findings highlight libsecp256k1's commitment to enhancing performance, making it substantially faster than OpenSSL in verifying ECDSA signatures on the secp256k1 curve.

The analysis also delves into the performance metrics on a Ryzen 5950X CPU, revealing a variance in speed ratios across versions, with some showing improvements and others, like bc-22.0, indicating a slight decrease in performance due to specific code implementations. This discrepancy underscores the importance of considering hardware diversity and compiler advancements in performance benchmarking. Additionally, the removal of x86_64 assembly in version 0.4.1 led to an observed improvement in speed, illustrating the evolving nature of performance optimization in response to technological advancements.

To effectively document and visualize these performance improvements over time, the development of a graphing approach is proposed. This approach involves using date indicators on the X-axis to track development milestones and logarithmic scaling on the Y-axis to accurately represent proportional changes in performance metrics. Such visualization facilitates a clear understanding of the project's evolution and allows for easy comparison of different stages of development.

Further enhancing data organization and analysis, a recent update to the project repository introduced a new "date" column in the generated .csv file for each benchmarked version, formatted in ISO 8601. This addition aims to improve the creation of graphs that effectively illustrate changes over time. An open invitation for contributions has been extended to enhance the plotting functionality of the project, with the specific commit available for review at theStack’s GitHub. Additionally, a branch implementing the proposed graph idea has been created, showcasing the potential for visualizing performance improvements and inviting further community engagement and collaboration to refine this aspect of the project.

Link to Raw Post
Bitcoin Logo

TLDR

Join Our Newsletter

We’ll email you summaries of the latest discussions from high signal bitcoin sources, like bitcoin-dev, lightning-dev, and Delving Bitcoin.

Explore all Products

ChatBTC imageBitcoin searchBitcoin TranscriptsSaving SatoshiDecoding BitcoinWarnet
Built with 🧡 by the Bitcoin Dev Project
View our public visitor count

We'd love to hear your feedback on this project.

Give Feedback