Skip to main content
POST
/
v1
/
raw
/
sign
/
{curve}
Sign a transaction or message by curve
curl --request POST \
  --url https://mpc-client.portalhq.io/v1/raw/sign/{curve} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "params": "7369676e2074686973",
  "share": "eyJjbG..."
}
'
import requests

url = "https://mpc-client.portalhq.io/v1/raw/sign/{curve}"

payload = {
"params": "7369676e2074686973",
"share": "eyJjbG..."
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({params: '7369676e2074686973', share: 'eyJjbG...'})
};

fetch('https://mpc-client.portalhq.io/v1/raw/sign/{curve}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://mpc-client.portalhq.io/v1/raw/sign/{curve}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'params' => '7369676e2074686973',
'share' => 'eyJjbG...'
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

url := "https://mpc-client.portalhq.io/v1/raw/sign/{curve}"

payload := strings.NewReader("{\n \"params\": \"7369676e2074686973\",\n \"share\": \"eyJjbG...\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.post("https://mpc-client.portalhq.io/v1/raw/sign/{curve}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"params\": \"7369676e2074686973\",\n \"share\": \"eyJjbG...\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://mpc-client.portalhq.io/v1/raw/sign/{curve}")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"params\": \"7369676e2074686973\",\n \"share\": \"eyJjbG...\"\n}"

response = http.request(request)
puts response.read_body
{
  "data": "f7a6a07fa599db56fca50fa1202670b59054e7ed452ea57b3f5b43148b8bdb165beb3a4b0fd532162a1f0fd475de1a9ecd07c95186f7a0856ce1bffa45e3acc91b"
}
{
"id": "BAD_REQUEST",
"message": "Can't parse the request body"
}
"Incorrect API key format"
{
"id": "<string>",
"message": "<string>"
}

Authorizations

Authorization
string
header
required

Client API Key or Client Session Token

Path Parameters

curve
enum<string>
required

The elliptic curve to use.

Available options:
SECP256K1,
ED25519

Body

application/json

Request body for signing a raw hex digest by curve.

params
string
required

A hex string of the digest to sign without the leading 0x (e.g. "7369676e2074686973").

share
string
required

The MPC share for the relevant curve.

presignature
string

The data value from a client-stored presign response. Omit for standard (non-presigned) signing. Mutually exclusive with presignatureId.

presignatureId
string

The id value from a Portal-managed presign response. Omit for standard (non-presigned) signing. Mutually exclusive with presignature.

signingScheme
enum<string>

The signing scheme to use. Defaults to cggmp.

Available options:
cggmp,
frost

Response

Signed successfully

Response containing the signed data.

data
string
required

The signed data as a hex string.