Skip to content

fix(setup): strip 0x prefix from stacksSignature before sending to /api/register #23

@Abh1shxkk

Description

@Abh1shxkk

Bug

During Step 5 (Register on AIBTC), the registration script sends the Stacks signature with the 0x prefix returned by stacks_sign_message. The /api/register endpoint rejects this.

Error

{"error":"Invalid Stacks signature: Cannot convert 0x0xbbf028d0...to a BigInt","code":"INVALID_STX_SIGNATURE"}

Note the double 0x0x — the server adds 0x internally but the payload already has it.

Root Cause

stacks_sign_message returns a signature string starting with 0x. The registration endpoint expects raw hex without the prefix.

Fix

Strip the 0x prefix before including in the POST body:

STX_SIG=$(echo "$RAW_SIG" | sed 's/^0x//')

Or in the skill docs, add:

The Stacks signature from stacks_sign_message includes a 0x prefix — remove it before sending: stacksSignature: sig.replace(/^0x/, '')

Related

Reproduced

Onboarding run on 2026-03-25 mainnet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions