Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Schnorr Signature API Specification
Overview
The new
/utils/schnorrSignendpoint allows users to generate Schnorr signatures for arbitrary messages using the private key associated with a specified P2PK address in the node's wallet. It would be useful for offchain applications working with Schnorr signature verifying contracts, see https://www.ergoforum.org/t/verifying-schnorr-signatures-in-ergoscript/3407API Endpoint
Request Format
{ "signerAddress": "3WwbzW6u8hKWBcL1W7kNVMr25s2UHfSBnYtwSHvrRQt7DdPuoXrt", "message": "68656c6c6f20776f726c64" }Parameters
signerAddress(string, required): The P2PK address whose associated private key will be used for signingmessage(string, required): The hex-encoded message to be signedResponse Format
On success (HTTP 200):
{ "signedMessage": "68656c6c6f20776f726c64", "signature": "01abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890", "publicKey": "02a7955281885bf0f0ca4a48678848cad8dc5b328ce8bc1d4481d041c98e891ff3" }Response Fields
signedMessage: The hex-encoded signed messagesignature: The hex-encoded Schnorr signature (concatenated R and s values)publicKey: The hex-encoded public key used for signingError Responses
Signing Process
signerAddressis a valid P2PK addresska = g^k(wheregis the generator)e = H(a || message || publicKey)z = k + e * s (mod n)wheresis the private keyaconcatenated withzUsage Example
Prerequisites