Issues the single-use nonce and the exact message a wallet must sign to claim a…
Issues the single-use nonce and the exact message a wallet must sign to claim a validator slot.
GET /v1/validator/challenge
| Address | https://api.hanzo.ai/v1/validator/challenge |
| Method | GET |
| Operation | get_validator_challenge |
| Auth | Authorization: Bearer $HANZO_API_KEY |
Issues the single-use nonce and the exact message a wallet must sign to claim a validator slot.
The nonce is bound to (validated org, slot) and stored server-side, so a signature obtained for one org or one slot can never be replayed for another, and the message POST /v1/validator verifies is rebuilt from those same server facts rather than trusted from the caller. Redeem it with POST /v1/validator before it expires; it can be redeemed once.
A tokenId outside the Validator tier is refused here rather than after signing.
Request
1 field.
| Field | In | Type | Required | Description |
|---|---|---|---|---|
tokenId | query | string | — | TokenID is the Validator-tier GenesisNFT token id, as a decimal string in the ?tokenId= query. A value that is not a positive integer is 400. |
Response
| Status | Body | Meaning |
|---|---|---|
200 | challengeView | ok |
200 body — 5 fields.
| Field | In | Type | Always | Description |
|---|---|---|---|---|
expiresAt | body | integer | — | ExpiresAt is when the nonce stops being redeemable, as a Unix timestamp. |
message | body | string | — | Message is the EXACT text to personal_sign. |
nonce | body | string | — | Nonce is the single-use, org-bound challenge value to send back with the signature. |
tokenId | body | integer | — | TokenID is the slot the challenge was issued for. |
ttlSeconds | body | integer | — | TTLSeconds is the challenge lifetime in seconds. |
Failure carries the platform error shape — see Errors.
Examples
hanzo validators challengeimport { Configuration, ValidatorApi } from 'hanzoai';
const api = new ValidatorApi(new Configuration({ accessToken: process.env.HANZO_API_KEY }));
const { data } = await api.getValidatorChallenge();from hanzoai.cloud import ApiClient, Configuration
from hanzoai.cloud.api import ValidatorApi
client = ApiClient(Configuration(access_token=os.environ["HANZO_API_KEY"]))
result = ValidatorApi(client).get_validator_challenge()cfg := cloud.NewConfiguration()
cfg.AddDefaultHeader("Authorization", "Bearer "+os.Getenv("HANZO_API_KEY"))
client := cloud.NewAPIClient(cfg)
resp, _, err := client.ValidatorAPI.GetValidatorChallenge(context.Background()).Execute()
if err != nil {
return err
}use hanzo_cloud::apis::{configuration::Configuration, validator_api};
let mut cfg = Configuration::new();
cfg.bearer_access_token = std::env::var("HANZO_API_KEY").ok();
let result = validator_api::get_validator_challenge(&cfg, Default::default()).await?;import ai.hanzo.cloud.ApiClient;
import ai.hanzo.cloud.api.ValidatorApi;
ApiClient client = new ApiClient();
client.setRequestInterceptor(b -> b.header("Authorization", "Bearer " + System.getenv("HANZO_API_KEY")));
var result = new ValidatorApi(client).getValidatorChallenge();The method above is the one at the current release of the document. [email protected] (npm) and [email protected] (PyPI) were generated from an earlier release, where this operation carried a different id, so it spells the method differently — regenerating the clients is what makes the two agree. SDKs →
curl https://api.hanzo.ai/v1/validator/challenge \
-H "Authorization: Bearer $HANZO_API_KEY"Tool validators, op get_validator_challenge — POST the JSON-RPC envelope to https://api.hanzo.ai/v1/mcp.
curl -X POST https://api.hanzo.ai/v1/mcp \
-H "Authorization: Bearer $HANZO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"jsonrpc": "2.0",
"id": 1,
"method": "tools/call",
"params": {
"name": "validators",
"arguments": {
"op": "get_validator_challenge",
"input": {}
}
}
}'How is this guide?