signMessage()

Sign a message using SECP256K1.

Method Signature:

private function signMessage($message, $privateKey)

Parameters

NameTypeDescription

message

string

Message that you want to sign. In transactions it must be the TxID.

privateKey

string

Private key in hexadecimal format.

Example

<?php
require 'vendor/autoload.php';
use CircularProtocol\Api\CircularProtocolAPI;

$circular = new CircularProtocolAPI();
$message = "Hello, World!";
$address = "0x8b1dd25076c04c5139acba458f86c69cd2d322c61d19bc28daa3bbd945083738";

$result = $circular->signMessage($message, $address);

Result

The result will be of type String

af14525076c04c5139acba458f86c69cd2d322c61d19bc28daa3bbd9450837ab

Last updated