Sign Message
AI-generatedOverview
This node signs a given message using a provided private key based on the Ed25519 signature scheme. It is useful in scenarios where you need to cryptographically prove the authenticity and integrity of a message, such as generating digital signatures for secure communication, verifying identity, or signing transactions.
For example, you might use this node to sign a message before sending it to a blockchain network or an API that requires signed requests for authentication.
Properties
| Name | Meaning |
|---|---|
| Private Key to Sign | The Ed25519 private key used to sign the message. Format example: ed25519:deadbeef. |
| Message to Sign | The string message that will be signed with the private key. |
Output
The node outputs JSON data containing:
signature: The Base64-encoded digital signature of the input message.publicKey: The public key corresponding to the private key used for signing, represented as a string.
This output allows downstream nodes or systems to verify the signature against the original message using the public key.
Dependencies
- Uses the
near-api-jslibrary for key pair handling and signing. - Uses the
js-base64library to encode the signature in Base64 format. - Requires no external API keys or services; all signing is done locally within the node.
Troubleshooting
- Invalid Private Key Format: If the private key is not correctly formatted (e.g., missing the
ed25519:prefix or corrupted), the node will throw an error. Ensure the private key is valid and properly formatted. - Empty Message: Providing an empty message string may result in unexpected behavior or errors. Always provide a non-empty string to sign.
- Error Handling: If the node encounters an error during signing, it can either stop execution or continue depending on the "Continue On Fail" setting. Check this setting if you want the workflow to proceed despite errors.