Request Ownership Challenge
curl --request POST \
--url https://api.example.com/v1/wallets/challengeimport requests
url = "https://api.example.com/v1/wallets/challenge"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/wallets/challenge', 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://api.example.com/v1/wallets/challenge",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/wallets/challenge"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/wallets/challenge")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/wallets/challenge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyWallets
Request Ownership Challenge
POST /v1/wallets/challenge — Get a one-time message to sign with a wallet, to prove you control it
POST
/
v1
/
wallets
/
challenge
Request Ownership Challenge
curl --request POST \
--url https://api.example.com/v1/wallets/challengeimport requests
url = "https://api.example.com/v1/wallets/challenge"
response = requests.post(url)
print(response.text)const options = {method: 'POST'};
fetch('https://api.example.com/v1/wallets/challenge', 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://api.example.com/v1/wallets/challenge",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/v1/wallets/challenge"
req, _ := http.NewRequest("POST", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/v1/wallets/challenge")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/v1/wallets/challenge")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
response = http.request(request)
puts response.read_bodyEndpoint:
POST https://api.rebelfi.io/v1/wallets/challengemessage with the wallet, then send the
challengeId and the signature to Register Wallet (as proof) or
Verify Wallet. A wallet proven this way is CONTROLLED: its balance is booked to your
organization, and it can Supply, Unwind and Transfer Out.
A challenge is bound to your organization, the chain and the address. It can be used once and expires after about ten
minutes (expiresAt).
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
walletAddress | string | Yes | Wallet address on the blockchain |
blockchain | string | Yes | Blockchain network: solana, polygon, ethereum, or base |
Example Request
curl -X POST "https://api.rebelfi.io/v1/wallets/challenge" \
-H "x-api-key: your_api_key" \
-H "Content-Type: application/json" \
-d '{
"walletAddress": "So11...abc",
"blockchain": "solana"
}'
const { challengeId, message, expiresAt } = await client.wallets.challenge({
walletAddress: 'So11...abc',
blockchain: 'solana'
});
Example Response
{
"challengeId": 917,
"message": "Midas wallet ownership\nOrganization: 12\nChain: solana\nAddress: So11...abc\nNonce: 4f9c2a...\nExpires: 2024-01-15T10:40:00.000Z",
"expiresAt": "2024-01-15T10:40:00.000Z"
}
Response Fields
| Field | Type | Description |
|---|---|---|
challengeId | number | Send it with the signature |
message | string | The exact text to sign. Don’t change or trim it |
expiresAt | string | Sign and submit before this time (ISO 8601) |
Signing the Message
Sign with the same key that controls the address, using the signer you already use for transactions.- Solana
- EVM
An ed25519 signature over the UTF-8 bytes of
message, base58-encoded. Wallet adapters expose this as
signMessage.import nacl from 'tweetnacl';
import bs58 from 'bs58';
const bytes = new TextEncoder().encode(message);
const signature = bs58.encode(nacl.sign.detached(bytes, keypair.secretKey));
// Wallet adapter: bs58.encode(await wallet.signMessage(bytes))
A
personal_sign signature of message (EIP-191), as 0x hex. Smart contract wallets are verified on-chain with
ERC-1271 (isValidSignature), so a Safe or other contract account works if it can sign messages.// ethers v6
const signature = await signer.signMessage(message);
// viem
const signature = await walletClient.signMessage({ account, message });
A wallet that can’t sign messages (for example a Solana multisig or a program-derived address) can’t use this flow.
Contact support to verify it another way.
Errors
| Code | HTTP | Description |
|---|---|---|
VALIDATION_FAILED | 400 | Missing field, or an address that isn’t valid for the chain |
FORBIDDEN | 403 | Admin API keys are read-only; use a key scoped to a wallet profile |