SignMessage()
Sign a message using SECP256K1.
Method Signature:
func SignMessage(message string, privateKey string) map[string]interface{}
Parameters
Name
Type
Description
message
String
Message that you want to sign. In transactions it must be the TxID.
privateKey
String
Private key in hexadecimal format.
Example
package main
import (
"fmt"
"github.com/circular-protocol/circular-go/circular_protocol_api"
"github.com/circular-protocol/circular-go/utils"
)
func main() {
var private_key := "0x40942ed2f05daf2a1b0a36453e5164755dd9ac4c79636f1a243eb21a16e0e4df"
var message := "Hello, World!"
result := utils.SignMessage(message, private_key)
fmt.Println(result)
}
Result
The result will be of type Map
, but for easier readability, here is the equivalent in JSON.
{
"Signature" : "0x...",
"R" : "value",
"S" : "value"
}
Last updated