Create sign

Produces a secp256k1 signature from one of the caller org's wallets over a 32-byte digest, through whichever custody backend that wallet uses.

POST /v1/wallet/{id}/sign

Addresshttps://api.hanzo.ai/v1/wallet/{id}/sign
MethodPOST
Operationpost_wallet_by_id_sign
AuthAuthorization: Bearer $HANZO_API_KEY

Produces a secp256k1 signature from one of the caller org's wallets over a 32-byte digest, through whichever custody backend that wallet uses. Give it either a digest (32 bytes as hex, signed verbatim) or a message (hashed with Keccak256 first) — exactly one is required. The private key never leaves its backend: KMS custody opens the sealed key in-process, MPC custody produces a threshold signature on the ring. The answer carries the digest that was signed alongside the signature, so a caller can verify what it got.

Request

3 fields, body application/json (required).

FieldInTypeRequiredDescription
idpathstringyes
digestbodystring—Digest is a pre-computed 32-byte digest as hex, with or without the 0x prefix.
messagebodystring—Message is arbitrary text to hash with Keccak256 and sign.

Response

StatusBodyMeaning
200wallet.signatureok
defaultproblem-detailsrefused

200 body — 4 fields.

FieldInTypeAlwaysDescription
addressbodystring—Address is the wallet's on-chain address, the one this signature recovers to.
digestbodystring—Digest is the 32-byte digest that was signed, hex with an 0x prefix.
signaturebodystring—Signature is the 65-byte secp256k1 signature, hex with an 0x prefix.
walletIdbodystring—WalletID is the wallet that signed.

Failure carries the platform error shape — see Errors.

Examples

hanzo wallet sign <id>
import { Configuration, WalletApi } from 'hanzoai';

const api = new WalletApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.postWalletByIdSign({ id: 'id', digest: "<digest>", message: "<message>" });
from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import WalletApi

client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = WalletApi(client).post_wallet_by_id_sign(id='id', digest="<digest>", message="<message>")
cfg := hanzoai.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := hanzoai.NewAPIClient(cfg)

resp, _, err := client.WalletAPI.PostWalletByIdSign(context.Background()).Execute()
if err != nil {
	return err
}
use hanzo_client::apis::{configuration::Configuration, wallet_api};

let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();

let result = wallet_api::post_wallet_by_id_sign(&cfg, Default::default()).await?;
import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.WalletApi;

ApiClient client = new ApiClient();
client.setBearerToken(System.getenv("HANZO_API_KEY"));

var result = new WalletApi(client).postWalletByIdSign();
curl -X POST https://api.hanzo.ai/v1/wallet/<id>/sign \
  -H "Authorization: Bearer $HANZO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
       "digest": "<digest>",
       "message": "<message>"
     }'

MCP reaches wallet through the wallet tool, which names its 7 operations with its own verbs — this one among them, under a name only MCP declares. describe explains any of them:

curl -X POST https://api.hanzo.ai/v1/mcp \
  -H "Content-Type: application/json" \
  -d '{
       "jsonrpc": "2.0",
       "id": 1,
       "method": "tools/call",
       "params": {
         "name": "describe",
         "arguments": {
           "op": "list_wallets"
         }
       }
     }'

Wallet API · All Hanzo APIs · Interactive reference

Was this page useful?