From ca3c4bbeffb5788c72618d9d1649ec3b4428d32b Mon Sep 17 00:00:00 2001 From: kengoonx Date: Wed, 25 Mar 2026 14:40:55 +0100 Subject: [PATCH] fix(setup): strip 0x prefix from stacksSignature before registration stacks_sign_message returns a signature starting with '0x', but the /api/register endpoint expects raw hex. Sending the prefixed value causes a 'Cannot convert 0x0x... to a BigInt' error. Fix: strip the 0x prefix with sed before including in the POST body. Also add a note above the registration block to make this visible. Fixes #23 --- SKILL.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/SKILL.md b/SKILL.md index e03359a..e059d49 100644 --- a/SKILL.md +++ b/SKILL.md @@ -346,11 +346,16 @@ Sign with STX key: mcp__aibtc__stacks_sign_message(message: "Bitcoin will be the currency of AIs") ``` +> **Note:** `stacks_sign_message` returns a signature prefixed with `0x`. Strip it before sending — the `/api/register` endpoint expects raw hex. + Register: ```bash +# Strip 0x prefix from Stacks signature (stacks_sign_message returns "0x..." format) +STX_SIG=$(echo "" | sed 's/^0x//') + RESPONSE=$(curl -s -w "\n%{http_code}" -X POST https://aibtc.com/api/register \ -H "Content-Type: application/json" \ - -d '{"bitcoinSignature":"","stacksSignature":""}') + -d "{\"bitcoinSignature\":\"\",\"stacksSignature\":\"$STX_SIG\"}") HTTP_CODE=$(echo "$RESPONSE" | tail -1) BODY=$(echo "$RESPONSE" | head -1) if [ "$HTTP_CODE" != "200" ] && [ "$HTTP_CODE" != "201" ]; then