Specification — v0.2.43

sBTC & SDK v8.x

The technical specification document for the sBTC integration and Stacks.js v8.x architecture.

01Protocol Overview

v0.2.43 introduces the core sBTC protocol handling into the CLI generator. The specification focuses on bridging Bitcoin onto Stacks using the sBTC Peg-in flow.

02New Components

use-sbtc-balance.ts

A standard hook that leverages the Hiro API read-only endpoints to fetch the sBTC balance from the official SIP-010 contract on testnet/mainnet.

use-sbtc-deposit.ts

Handles the complex P2TR address construction, Bitcoin transfer signing via Stacks Connect, and notification through the Emily API.

03Integration Specification

The CLI now injects the following configuration during the project build process if sBTC features are used:

// sBTC Contract Identity
const SBTC_CONTRACT = "SM3VDXK3WZZSA84XXFKAFAF15NNZX32CTSG82JFQ4";

// sBTC API Endpoint (Emily)
const SBTC_API_TESTNET = "https://api.testnet.hiro.so";
const SBTC_API_MAINNET = "https://api.mainnet.hiro.so";