curl --request POST \
--url https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/createspendauthsig \
--header 'Content-Type: application/json' \
--data '
{
"ask": "0f63eabdfe2bbfe08012f6bb2db024e6809c16e8ed055aa41a6095424f192005",
"alpha": "d0f0768664f5c807f9e70d05993f029c71da529afaa5c037b44c63d6e13bc907",
"tx_hash": "7fb99e66df052f430d50e80a3f197c319a4e35184ed48a433d6219e025741337"
}
'import requests
url = "https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/createspendauthsig"
payload = {
"ask": "0f63eabdfe2bbfe08012f6bb2db024e6809c16e8ed055aa41a6095424f192005",
"alpha": "d0f0768664f5c807f9e70d05993f029c71da529afaa5c037b44c63d6e13bc907",
"tx_hash": "7fb99e66df052f430d50e80a3f197c319a4e35184ed48a433d6219e025741337"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
ask: '0f63eabdfe2bbfe08012f6bb2db024e6809c16e8ed055aa41a6095424f192005',
alpha: 'd0f0768664f5c807f9e70d05993f029c71da529afaa5c037b44c63d6e13bc907',
tx_hash: '7fb99e66df052f430d50e80a3f197c319a4e35184ed48a433d6219e025741337'
})
};
fetch('https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/createspendauthsig', 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://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/createspendauthsig",
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([
'ask' => '0f63eabdfe2bbfe08012f6bb2db024e6809c16e8ed055aa41a6095424f192005',
'alpha' => 'd0f0768664f5c807f9e70d05993f029c71da529afaa5c037b44c63d6e13bc907',
'tx_hash' => '7fb99e66df052f430d50e80a3f197c319a4e35184ed48a433d6219e025741337'
]),
CURLOPT_HTTPHEADER => [
"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://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/createspendauthsig"
payload := strings.NewReader("{\n \"ask\": \"0f63eabdfe2bbfe08012f6bb2db024e6809c16e8ed055aa41a6095424f192005\",\n \"alpha\": \"d0f0768664f5c807f9e70d05993f029c71da529afaa5c037b44c63d6e13bc907\",\n \"tx_hash\": \"7fb99e66df052f430d50e80a3f197c319a4e35184ed48a433d6219e025741337\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/createspendauthsig")
.header("Content-Type", "application/json")
.body("{\n \"ask\": \"0f63eabdfe2bbfe08012f6bb2db024e6809c16e8ed055aa41a6095424f192005\",\n \"alpha\": \"d0f0768664f5c807f9e70d05993f029c71da529afaa5c037b44c63d6e13bc907\",\n \"tx_hash\": \"7fb99e66df052f430d50e80a3f197c319a4e35184ed48a433d6219e025741337\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/createspendauthsig")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"ask\": \"0f63eabdfe2bbfe08012f6bb2db024e6809c16e8ed055aa41a6095424f192005\",\n \"alpha\": \"d0f0768664f5c807f9e70d05993f029c71da529afaa5c037b44c63d6e13bc907\",\n \"tx_hash\": \"7fb99e66df052f430d50e80a3f197c319a4e35184ed48a433d6219e025741337\"\n}"
response = http.request(request)
puts response.read_body{
"value": "66c806bc592a7599e65833bf25c3c7005c8b21b7895dd835a84c97d7bec49d0f1493d2c73a68eeb9b9699b92cae42406f9e44ebe19acaea3d5febfe28de57109"
}wallet/createspendauthsig | TRON
TRON API method that creates a spending authorization signature for shielded TRC20 transactions. Available on TRON via Chainstack.
curl --request POST \
--url https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/createspendauthsig \
--header 'Content-Type: application/json' \
--data '
{
"ask": "0f63eabdfe2bbfe08012f6bb2db024e6809c16e8ed055aa41a6095424f192005",
"alpha": "d0f0768664f5c807f9e70d05993f029c71da529afaa5c037b44c63d6e13bc907",
"tx_hash": "7fb99e66df052f430d50e80a3f197c319a4e35184ed48a433d6219e025741337"
}
'import requests
url = "https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/createspendauthsig"
payload = {
"ask": "0f63eabdfe2bbfe08012f6bb2db024e6809c16e8ed055aa41a6095424f192005",
"alpha": "d0f0768664f5c807f9e70d05993f029c71da529afaa5c037b44c63d6e13bc907",
"tx_hash": "7fb99e66df052f430d50e80a3f197c319a4e35184ed48a433d6219e025741337"
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
ask: '0f63eabdfe2bbfe08012f6bb2db024e6809c16e8ed055aa41a6095424f192005',
alpha: 'd0f0768664f5c807f9e70d05993f029c71da529afaa5c037b44c63d6e13bc907',
tx_hash: '7fb99e66df052f430d50e80a3f197c319a4e35184ed48a433d6219e025741337'
})
};
fetch('https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/createspendauthsig', 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://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/createspendauthsig",
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([
'ask' => '0f63eabdfe2bbfe08012f6bb2db024e6809c16e8ed055aa41a6095424f192005',
'alpha' => 'd0f0768664f5c807f9e70d05993f029c71da529afaa5c037b44c63d6e13bc907',
'tx_hash' => '7fb99e66df052f430d50e80a3f197c319a4e35184ed48a433d6219e025741337'
]),
CURLOPT_HTTPHEADER => [
"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://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/createspendauthsig"
payload := strings.NewReader("{\n \"ask\": \"0f63eabdfe2bbfe08012f6bb2db024e6809c16e8ed055aa41a6095424f192005\",\n \"alpha\": \"d0f0768664f5c807f9e70d05993f029c71da529afaa5c037b44c63d6e13bc907\",\n \"tx_hash\": \"7fb99e66df052f430d50e80a3f197c319a4e35184ed48a433d6219e025741337\"\n}")
req, _ := http.NewRequest("POST", url, payload)
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://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/createspendauthsig")
.header("Content-Type", "application/json")
.body("{\n \"ask\": \"0f63eabdfe2bbfe08012f6bb2db024e6809c16e8ed055aa41a6095424f192005\",\n \"alpha\": \"d0f0768664f5c807f9e70d05993f029c71da529afaa5c037b44c63d6e13bc907\",\n \"tx_hash\": \"7fb99e66df052f430d50e80a3f197c319a4e35184ed48a433d6219e025741337\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://tron-mainnet.core.chainstack.com/95e61622bf6a8af293978377718e3b77/wallet/createspendauthsig")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"ask\": \"0f63eabdfe2bbfe08012f6bb2db024e6809c16e8ed055aa41a6095424f192005\",\n \"alpha\": \"d0f0768664f5c807f9e70d05993f029c71da529afaa5c037b44c63d6e13bc907\",\n \"tx_hash\": \"7fb99e66df052f430d50e80a3f197c319a4e35184ed48a433d6219e025741337\"\n}"
response = http.request(request)
puts response.read_body{
"value": "66c806bc592a7599e65833bf25c3c7005c8b21b7895dd835a84c97d7bec49d0f1493d2c73a68eeb9b9699b92cae42406f9e44ebe19acaea3d5febfe28de57109"
}ask, alpha, tx_hash) must be exactly 32 bytes (64 hexadecimal characters) provided as raw hex strings without the 0x prefix. Values that are shorter, longer, or include the 0x prefix will result in a “param length must be 32” error.Parameters
ask— the authentication secret key used for signing (32 bytes, hex without 0x prefix)alpha— the alpha parameter for randomization (32 bytes, hex without 0x prefix)tx_hash— the transaction hash being authorized (32 bytes, hex without 0x prefix)
Response
value— the generated spending authorization signature (hex string without 0x prefix)
Use case
Thewallet/createspendauthsig method is used for:
- Authorizing the spending of shielded notes in privacy transactions
- Creating cryptographic signatures that prove spending authority without revealing identity
- Supporting the zero-knowledge proof system in shielded transactions
- Enabling secure authorization of shielded TRC20 transfers
Body
Authentication secret key for signing (32 bytes, hex without 0x prefix)
"0f63eabdfe2bbfe08012f6bb2db024e6809c16e8ed055aa41a6095424f192005"
Alpha parameter for randomization (32 bytes, hex without 0x prefix)
"d0f0768664f5c807f9e70d05993f029c71da529afaa5c037b44c63d6e13bc907"
Transaction hash being authorized (32 bytes, hex without 0x prefix)
"7fb99e66df052f430d50e80a3f197c319a4e35184ed48a433d6219e025741337"
Response
Successfully created spending authorization signature
Generated spending authorization signature (hex string without 0x prefix)
"66c806bc592a7599e65833bf25c3c7005c8b21b7895dd835a84c97d7bec49d0f1493d2c73a68eeb9b9699b92cae42406f9e44ebe19acaea3d5febfe28de57109"
Was this page helpful?