Skip to content

Docs: add more resources / info #2

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

EntryCategoryDescription
x402StacksClient-Side IntegrationsTypeScript SDK (x402-stacks on npm)
x402Stacks FacilitatorFacilitatorsTransaction settlement service
x402StacksScanInfrastructure & ToolingEcosystem explorer and stats
AIBTC Sponsor RelayInfrastructure & ToolingSponsored / gasless transaction relay
STX402Endpointsx402 powered registry (mainnet)
AIBTC x402 APIEndpointsAI inference and app storage (mainnet + testnet)
x402 BiwasEndpointsAI-powered DeFi analytics

x402 Supported Tokens

TokenMainnetTestnet
STXNativeNative
sBTCSM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-token::sbtc-tokenST1F7QA2MDF17S807EPA36TSS8AMEFY4KA9TVGWXT.sbtc-token::sbtc-token
USDCxSP120SBRBQJ00MCWS7TM5R8WJNTTKD5K0HFRC2CNE.usdcx::usdcx-tokenNot 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

AspectDetail
SettlementPre-signed transaction broadcast via Hiro API
VerificationDeferred to settlement — poll Hiro API for tx confirmation
Key formatHex (secp256k1, via @stacks/transactions)
Address formatPrincipal — SP…/SM… (mainnet), ST…/SN… (testnet)
Token standardSIP-010 fungible tokens (transfer contract call)
Fee payerSender pays by default — co-signing supported for sponsored transactions (see x402-sponsor-relay)
CAIP-2 IDsstacks:1 (mainnet), stacks:2147483648 (testnet)

Supported tokens:

TokenTypeMainnet ContractTestnet Contract
STXNative
sBTCSIP-010SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4.sbtc-tokenST1F7QA2MDF17S807EPA36TSS8AMEFY4KA9TVGWXT.sbtc-token
USDCxSIP-010SP120SBRBQJ00MCWS7TM5R8WJNTTKD5K0HFRC2CNE.usdcxST2Y455NJPETB2SRSD0VDZP3KJE50WNHY0BN3TWY5.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

ResourceLink
Stacks facilitator (Go)https://github.com/x402Stacks/x402-stacks-facilitator
x402-stacks npm packagex402-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