Authentication overview
Nownodes provides access to a wide range of blockchain nodes via a unified API, with authentication primarily managed through API keys. This approach allows developers to connect to various blockchain networks, including popular ones like Ethereum, Bitcoin, Polygon, and Avalanche, using a single set of credentials. The API key serves as a unique identifier and authorization token for each user account, ensuring that requests are properly attributed and that usage adheres to allocated plan limits. Nownodes's authentication mechanism is designed for straightforward integration, supporting both shared and dedicated node services.
The system is engineered to handle a high volume of requests, offering a free tier for initial exploration and scaling up to enterprise-level usage with corresponding rate limits and dedicated resources. Proper handling and security of the API key are critical to maintaining the integrity and security of your access to Nownodes's infrastructure. Nownodes documentation provides specific guidance and examples for integrating the API key into your applications (Nownodes API documentation).
Supported authentication methods
Nownodes exclusively supports API key authentication for accessing its blockchain node services. This method is common for API providers due to its simplicity and ease of implementation. An API key is typically a long, unique string of characters that acts as a secret token. When included with an API request, it verifies the identity of the calling application or user.
Developers must generate an API key from their Nownodes account dashboard. This key is then included in every API request to Nownodes's endpoints. The API key ensures that only authorized users can access the blockchain data and services, and it allows Nownodes to monitor and manage API usage according to the user's subscription plan. While simple, the security of this method heavily relies on the developer's practices for storing and transmitting the key securely.
API Key
The API key is a unique identifier provided by Nownodes to authenticate requests. It is a credential that is passed with each API call to verify the user's identity and permissions. Nownodes specifically outlines that the API key should be included in the HTTP header of requests, as demonstrated in their cURL examples (Nownodes cURL examples).
The table below summarizes the API key authentication method:
| Method | When to Use | Security Level |
|---|---|---|
| API Key | All API interactions with Nownodes, including fetching blockchain data, sending transactions, and monitoring node activity. | Moderate (Reliance on secure key storage and transmission over HTTPS). |
Getting your credentials
To obtain your Nownodes API key, you need to register an account and generate the key through the Nownodes dashboard. The process typically involves a few steps:
- Sign Up/Log In: Navigate to the Nownodes website (Nownodes homepage) and either sign up for a new account or log in if you already have one.
- Access Dashboard: Once logged in, you will be directed to your personal dashboard.
- Generate API Key: Within the dashboard, look for a section related to API keys, projects, or settings. There should be an option to generate a new API key.
- Copy Key: After generation, the API key will be displayed. It is crucial to copy this key immediately and store it securely, as it may not be visible again for security reasons. Nownodes advises users to treat their API keys as sensitive information, similar to passwords.
- Associate with Project (Optional): Depending on Nownodes's dashboard interface, you might be able to associate your API key with specific projects or configure its permissions.
The Nownodes documentation provides visual guides and detailed instructions on navigating the dashboard to generate and manage your API keys effectively (Nownodes documentation on API keys).
Authenticated request example
Nownodes provides cURL examples directly in their documentation, illustrating how to include your API key in API requests. The API key is typically passed in the x-api-key HTTP header.
Here's a generic example using cURL to make a request to a Nownodes endpoint, such as retrieving the latest block number for a blockchain like Ethereum:
curl \
-H "Content-Type: application/json" \
-H "x-api-key: YOUR_API_KEY" \
-d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }' \
https://eth.nownodes.io/
In this example:
-H "Content-Type: application/json"specifies the request body format.-H "x-api-key: YOUR_API_KEY"is where you replaceYOUR_API_KEYwith the actual API key obtained from your Nownodes dashboard. This header is critical for authentication.-d '{ "jsonrpc": "2.0", "method": "eth_blockNumber", "params": [], "id": 1 }'is the JSON-RPC request payload, asking for the latest Ethereum block number.https://eth.nownodes.io/is an example Nownodes endpoint for the Ethereum network. The specific endpoint will vary based on the blockchain and service you are trying to access.
For specific blockchain networks and API methods, consult the Nownodes API reference for exact endpoint URLs and request parameters.
Security best practices
Securing your Nownodes API key is paramount to protect your account and prevent unauthorized access to blockchain services. Adhering to industry-standard security practices for API keys is essential. The Open Web Application Security Project (OWASP) provides guidelines for secure API development, which are broadly applicable to API key management (OWASP API Security Top 10).
Here are key security best practices for Nownodes API keys:
- Treat API Keys as Sensitive Credentials: Your API key grants access to your Nownodes account and associated services. Treat it with the same level of confidentiality as you would a password, private key, or other sensitive credentials.
- Avoid Hardcoding API Keys: Never hardcode API keys directly into your application's source code. This practice can lead to accidental exposure if the code is publicly shared or committed to version control systems like Git.
- Use Environment Variables: For server-side applications, store API keys in environment variables. This allows you to easily manage and rotate keys without modifying code and prevents them from being exposed in your codebase. Most programming languages and frameworks support reading environment variables.
- Centralized Secret Management: For more complex deployments or microservices architectures, consider using dedicated secret management services (e.g., AWS Secrets Manager, Google Cloud Secret Manager, Azure Key Vault, or HashiCorp Vault). These services provide secure storage, access control, and rotation mechanisms for sensitive credentials. (AWS Secrets Manager documentation).
- Restrict API Key Permissions (if applicable): While Nownodes's API keys might have broad access by default, if there are options within the dashboard to scope key permissions to specific services or IP addresses, utilize them. Limit the key's capabilities to only what is necessary for the application.
- Secure Communication (HTTPS): Always ensure that all API requests to Nownodes are made over HTTPS (TLS/SSL). This encrypts the communication channel, protecting your API key and data from interception during transit. Nownodes endpoints are served over HTTPS by default.
- Client-Side Usage Considerations: Avoid exposing your API key directly in client-side code (e.g., JavaScript in a web browser or mobile app). If client-side access is required, consider using a backend proxy that authenticates with Nownodes and then serves the client requests, or implement token-based authentication (e.g., OAuth 2.0) with a backend intermediary if Nownodes were to support it in the future.
- API Key Rotation: Regularly rotate your API keys, especially if you suspect a compromise or as part of a routine security policy. Nownodes's dashboard should provide functionality to generate new keys and revoke old ones.
- Monitor API Key Usage: Keep an eye on your Nownodes dashboard for unusual activity or excessive usage associated with your API key. This can help detect unauthorized use early.
- Access Control: Limit who has access to your API keys within your development team. Implement strong access controls and ensure that only authorized personnel can retrieve or manage them.
By implementing these practices, developers can significantly reduce the risk of API key compromise and enhance the overall security posture of applications integrating with Nownodes's blockchain infrastructure.