Key points
ED25519 is an asymmetric signature algorithm that provides strong security and excellent performance.
It depends on the difficulty of the discrete logarithm problem on elliptic curves, and it resists various cryptographic attacks.
When compared with traditional algorithms like RSA, ED25519 features much higher speeds for signing and verification, making it suitable for real-time applications and blockchain systems.
Binance fully supports the ED25519 algorithm for API security, and provides tools and libraries to simplify key generation, request signing, and the integration of secure trading documentation and account management.
Introduction
In this article, we cover ED25519 by providing an overview of the algorithm and its historical background. We also discuss the shortcomings of older cryptographic algorithms that ED25519 addresses, explaining why it is popular and widely used.
Next, we provide you with some guidance on creating private and public keys, explain the basics of signing and verifying messages, and show how to use these keys with APIs on Binance.
Reasons to create ED25519
Although asymmetric algorithms like RSA (created in 1977) and DSA (from 1991) have been widely used, they have certain shortcomings that ED25519 aims to address.
1. Security
Attack resistance: The ED25519 algorithm is designed to resist a large class of cryptographic attacks, including side-channel attacks and timing attacks that affected older algorithms such as RSA and DSA. Older algorithms were vulnerable because attackers could extract sensitive information by observing timing differences during signing or verification.
Stronger cryptographic assumptions: ED25519 relies on the difficulty of the discrete logarithm problem over elliptic curves, which is considered more secure against certain types of attacks than the integer factorization problem used in RSA.
2. Performance
Signing speed: ED25519 is designed to be faster than RSA-2048 when creating signatures. This large speed advantage makes the algorithm well-suited for applications that require rapid signature creation, such as high-frequency trading (HFT) and instant communications.
Verification speed: ED25519 is also faster than RSA-2048 when verifying signatures. Higher verification speeds are essential for systems that need to verify large numbers of signatures quickly, such as blockchain networks and secure messaging platforms.
3. Deterministic signatures
Consistency: ED25519 generates the same signature for the same message every time, eliminating the need for a secure random number generator during signing. This reduces the risk of implementation errors and weaknesses related to weak randomness.
Simplified implementation: The deterministic nature simplifies the implementation process, making it easier to develop secure and reliable cryptographic systems.
4. Small key size
Efficiency: ED25519 uses smaller key sizes compared to RSA, resulting in faster computations and reduced storage requirements. This efficiency is especially useful in resource-constrained environments, such as embedded systems, IoT devices, and mobile device applications.
Bandwidth savings: Smaller key sizes also reduce bandwidth usage, which is beneficial for interconnected applications and systems with limited communication channels.
Use cases
ED25519 is widely used in secure communications due to its strong security and outstanding performance. Its ability to generate and verify signatures quickly makes it ideal for applications such as encrypted messaging, email security, and secure file transfer.
By ensuring messages and files are authenticated and not tampered with, ED25519 helps maintain the integrity and confidentiality of sensitive information. Its deterministic nature also simplifies implementation, reducing the risk of errors and weaknesses related to randomness in cryptographic operations.
Blockchain systems and digital currencies are also among the main use cases for ED25519, since the algorithm’s efficiency in signing and verification is necessary to maintain the speed and security of blockchain networks.
ED25519’s small key size and fast performance are especially useful in resource-constrained environments, such as IoT devices and embedded systems. These devices often require secure communication protocols that can operate efficiently within limited computing and storage capabilities. By leveraging ED25519, developers can ensure their IoT solutions are secure and high-performing, enabling a wide range of applications—from smart home devices to industrial automation systems.
How are ED25519 keys created?
The preferred way to generate private and public keys is to use the key generation tool on Binance, making the process easy—since the entire generation can be completed through a clear user interface.
Keys can also be generated using OpenSSL via the command line.
Create the private key:
Create the private key with a passphrase:
Create the public key from the private key:
Example: Create and verify an ED25519 signature
How to sign REST API requests on Binance
Set request variables:
For the WebSocket API, all variables must be sorted in ascending order before creating the signature. This ensures consistency when generating signatures.
For the REST API, you do not need to sort variables before signing. The signature is generated based on the request variables exactly as provided.
Create an ED25519 signature:
ED25519 can be used with the API secret key to sign related variables.
You can use your ED25519 private key by registering the public key on Binance. For detailed steps, please refer to How to create an ED25519 key pair to send Binance API requests.
Include the signature in the request:
Attach the generated signature to the API request as the signature variable.
Example: How to sign a request using the ED25519 private key for the Binance API
Binance recommends using connectors, which makes integration smoother and takes care of signature creation.
Example: How to use Binance connectors
Automatically create the signature
For developers who want to automate the signature generation process across different programming languages, Binance provides an open-source repository that includes examples in Python, JavaScript, Java, and more. You can access it via the GitHub repository binance-signature-examples.
Using this resource, developers can quickly integrate ED25519-based documentation into their applications with minimal effort.
For those testing Binance API integrations in an isolated environment, you can generate a private ED25519 key using the Binance test network. This allows developers to try API authentication without affecting live trading accounts.
Frequently asked questions
What is ED25519 used for?
ED25519 is used to generate digital signatures that verify the authenticity and integrity of messages or transactions. Common applications include SSH authentication, TLS certificates, API security, and signing blockchain transactions. Binance uses it as its preferred algorithm for authenticating API requests.
Is ED25519 more secure than RSA?
They have different security properties. ED25519 is resistant to timing and side-channel attacks that affected RSA-based applications, and it achieves a comparable security level using much smaller keys. For most API security use cases, ED25519 is the stronger choice among the two for current practical applications.
Is ED25519 secure against quantum computing?
No. Like all elliptic-curve algorithms, ED25519 does not resist attacks from a sufficiently powerful quantum computer. NIST published post-quantum signature standards in 2024, including ML-DSA. For now, ED25519 remains practical and widely used, but organizations with long-term security needs may begin planning a transition to post-quantum signature algorithms.
How do I use ED25519 with the Binance API?
Create an ED25519 key pair using the key generation tool on Binance or a supported library, and register your public key on your Binance account. For each API request, sign the variables string using your private key and include the resulting signature in the request. Binance connector libraries can automate this process across multiple programming languages.
What is the difference between ED25519 and HMAC for authenticating the Binance API?
HMAC uses a shared secret key to generate a message authentication code, so both parties must know the same key—meaning the secret must be stored by both. ED25519 is an asymmetric algorithm: only you hold the private key, and Binance stores only your public key. This means that compromising Binance’s systems would not reveal your signing private key. ED25519 is Binance’s recommended method for new API integration authentication.
Final thoughts
ED25519 strikes the ideal balance between security and performance, making it an excellent choice for modern cryptography needs. Its asymmetric nature provides stronger security compared with symmetric algorithms like HMAC, which may be more susceptible to certain attacks.
In terms of performance, ED25519 leads in both signature generation and verification. It is faster than traditional algorithms such as RSA, with signature speeds up to 30x faster. This efficiency makes it ideal for applications that require fast, frequent signing and verification, such as secure communications and blockchain transactions.
On Binance, ED25519 is the preferred algorithm due to its superior security and performance, and all Binance APIs fully support it—ensuring seamless integration and compatibility across different platforms and services. By using ED25519, Binance ensures its cryptographic operations are secure and efficient, providing a reliable foundation for its financial and trading services.
After learning about the ED25519 algorithm and how to create keys and signatures, you can use it to submit market orders on Binance securely.
When placing a market order, the private key is used to sign the request, proving that it originates from a legitimate source.
Related articles
What are API keys and what kinds of security do they provide?
HMAC signature: what it is and how to use it for API security on Binance
Disclaimer: This content is provided to you “as is” for general information and educational purposes only, without any representations or warranties of any kind. It should not be interpreted as financial, legal, or any other specialized advice, nor is it a recommendation to buy any particular product or service. You should seek guidance from appropriate professional advisors. If the article is provided by an external party, please note that the views expressed belong to that external party and do not necessarily reflect the views of the Binance Academy. Digital asset prices are volatile; the value of your investment may go down or up, and you may not get back the amount invested. You are solely responsible for your investment decisions, and Binance Academy is not responsible for any losses you may incur. For more information, please refer to Terms of Use, Risk Warning, and Binance Academy Terms.
