Skip to content

Docs: add more resources / info #2

@whoabuddy

Description

@whoabuddy

Giant dump of info:

About Stacks

  • Bitcoin L2 with 100% Bitcoin finality for smart contracts and DeFi
  • Proof of Transfer (PoX) consensus anchored to Bitcoin's security
  • Fast blocks (~5 seconds) with multiple Stacks blocks per Bitcoin block
  • Clarity smart contracts with native Bitcoin state visibility
  • sBTC for decentralized, programmable BTC; STX for gas
  • Stacks Website | sBTC | Docs

x402 Ecosystem Entries

Entry Category Description
x402Stacks Client-Side Integrations TypeScript SDK (x402-stacks on npm)
x402Stacks Facilitator Facilitators Transaction settlement service
x402StacksScan Infrastructure & Tooling Ecosystem explorer and stats
AIBTC Sponsor Relay Infrastructure & Tooling Sponsored / gasless transaction relay
STX402 Endpoints x402 powered registry (mainnet)
AIBTC x402 API Endpoints AI inference and app storage (mainnet + testnet)
x402 Biwas Endpoints AI-powered DeFi analytics

x402 Supported Tokens

Token Mainnet Testnet
STX Native Native
sBTC SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token::sbtc-token ST1F7QA2MDF17S807EPA36TSS8AMEFY4KA9TVGWXT.sbtc-token::sbtc-token
USDCx SP120SBRBQJ00MCWS7TM5R8WJNTTKD5K0HFRC2CNE.usdcx::usdcx-token Not yet deployed

Link Dump

Protocol / facilitator:

Sponsored / gasless TX relay:

stx402 endpoints:

AIBTC endpoints:

Biwas endpoints:

First Integration Issue Details

Overview

Add Stacks as a third supported blockchain alongside EVM and Solana. The settlement model mirrors Solana (pre-signed transaction broadcast, not EVM-style authorization), making it a natural fit for the existing architecture. This brings three new payment tokens: STX, sBTC, and USDCx.

There's an existing Stacks x402 facilitator written in Go (x402-stacks-facilitator) and a TypeScript client/server library (x402-stacks). The goal here is to implement Stacks settlement natively in TypeScript within OpenFacilitator's core, following the same pattern as the existing EVM and Solana modules. A working crosschain example demonstrates EVM + Stacks in a single app using the x402 v2 protocol.

Stacks Settlement Model

Aspect Detail
Settlement Pre-signed transaction broadcast via Hiro API
Verification Deferred to settlement — poll Hiro API for tx confirmation
Key format Hex (secp256k1, via @stacks/transactions)
Address format Principal — SP…/SM… (mainnet), ST…/SN… (testnet)
Token standard SIP-010 fungible tokens (transfer contract call)
Fee payer Sender pays by default — co-signing supported for sponsored transactions (see x402-sponsor-relay)
CAIP-2 IDs stacks:1 (mainnet), stacks:2147483648 (testnet)

Supported tokens:

Token Type Mainnet Contract Testnet Contract
STX Native
sBTC SIP-010 SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token ST1F7QA2MDF17S807EPA36TSS8AMEFY4KA9TVGWXT.sbtc-token
USDCx SIP-010 SP120SBRBQJ00MCWS7TM5R8WJNTTKD5K0HFRC2CNE.usdcx ST2Y455NJPETB2SRSD0VDZP3KJE50WNHY0BN3TWY5.usdcx ¹

Settlement Implementation Details

The settlement flow has been validated against the existing Go facilitator implementation.

Hiro API endpoints needed:

  • GET /extended/v1/tx/{txid} — fetch transaction details (status, recipient, amount)
  • POST /v2/transactions — broadcast signed transaction bytes (Content-Type: application/octet-stream)

Free API keys with generous rate limits are available at https://platform.hiro.so.

Transaction parsing — two transaction types to handle:

  • STX (native): tx_type: "token_transfer" — read token_transfer.recipient_address and token_transfer.amount directly
  • SIP-010 tokens (sBTC, USDCx): tx_type: "contract_call", function_name: "transfer" — parse function args for amount (format: u1000000) and recipient/to (format: 'SP… with quote prefix)

Verification rules — after broadcast, poll until confirmed, then verify:

  1. Transaction status is not failed, abort_by_response, or abort_by_post_condition
  2. Transaction is confirmed (status: "success", block_height > 0)
  3. Recipient matches expected address
  4. Amount >= required minimum
  5. Optional: sender match, memo match

Reference Implementations

Resource Link
Stacks facilitator (Go) https://github.com/x402Stacks/x402-stacks-facilitator
x402-stacks npm package x402-stacks@2.0.1
Crosschain example (EVM + Stacks) https://github.com/aibtcdev/x402-crosschain-example
stx402 (production Stacks x402 service) https://github.com/whoabuddy/stx402
x402-api (Stacks x402 API service) https://github.com/aibtcdev/x402-api

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions