sbtc

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

sBTC Skill

sBTC Skill

Provides sBTC (wrapped Bitcoin on Stacks L2) operations. sBTC uses 8 decimals — the same as Bitcoin. Transfer and deposit operations require an unlocked wallet (use
bun run wallet/wallet.ts unlock
first). Balance and info queries work without a wallet.
提供sBTC(Stacks L2上的包装比特币)操作功能。sBTC采用8位小数——与比特币一致。转账和存入操作需要解锁钱包(请先执行
bun run wallet/wallet.ts unlock
)。余额和信息查询无需钱包即可使用。

Usage

使用方法

bun run sbtc/sbtc.ts <subcommand> [options]
bun run sbtc/sbtc.ts <subcommand> [options]

Subcommands

子命令

get-balance

查询余额

Get the sBTC balance for a Stacks address.
bun run sbtc/sbtc.ts get-balance [--address <addr>]
Options:
  • --address
    (optional) — Stacks address to check (uses active wallet if omitted)
Output:
json
{
  "address": "SP2...",
  "network": "mainnet",
  "balance": {
    "sats": "100000",
    "btc": "0.001 sBTC"
  }
}
查询指定Stacks地址的sBTC余额。
bun run sbtc/sbtc.ts get-balance [--address <addr>]
选项:
  • --address
    (可选)——要查询的Stacks地址(若省略则使用当前活跃钱包)
输出:
json
{
  "address": "SP2...",
  "network": "mainnet",
  "balance": {
    "sats": "100000",
    "btc": "0.001 sBTC"
  }
}

transfer

转账

Transfer sBTC to a recipient. Requires an unlocked wallet.
sBTC uses 8 decimals. Specify
--amount
in satoshis (1 sBTC = 100,000,000 satoshis).
bun run sbtc/sbtc.ts transfer --recipient <addr> --amount <sats> [--memo <text>] [--fee low|medium|high|<microStx>] [--sponsored]
Options:
  • --recipient
    (required) — Stacks address to send to
  • --amount
    (required) — Amount in satoshis (e.g., "100000" for 0.001 sBTC)
  • --memo
    (optional) — Memo message to include
  • --fee
    (optional) — Fee preset (low|medium|high) or micro-STX amount; auto-estimated if omitted
  • --sponsored
    (flag) — Use fee sponsorship if available
Output:
json
{
  "success": true,
  "txid": "abc123...",
  "from": "SP2...",
  "recipient": "SP3...",
  "amount": "0 sBTC",
  "amountSats": "100000",
  "network": "mainnet",
  "explorerUrl": "https://explorer.hiro.so/txid/abc123...?chain=mainnet"
}
向接收方转账sBTC。需要解锁钱包。
sBTC采用8位小数。请以聪为单位指定
--amount
参数(1 sBTC = 100,000,000聪)。
bun run sbtc/sbtc.ts transfer --recipient <addr> --amount <sats> [--memo <text>] [--fee low|medium|high|<microStx>] [--sponsored]
选项:
  • --recipient
    (必填)——接收方的Stacks地址
  • --amount
    (必填)——转账金额(以聪为单位,例如"100000"代表0.001 sBTC)
  • --memo
    (可选)——附带的备注信息
  • --fee
    (可选)——手续费预设值(low|medium|high)或micro-STX金额;若省略则自动估算
  • --sponsored
    (标志位)——若可用则使用赞助手续费
输出:
json
{
  "success": true,
  "txid": "abc123...",
  "from": "SP2...",
  "recipient": "SP3...",
  "amount": "0 sBTC",
  "amountSats": "100000",
  "network": "mainnet",
  "explorerUrl": "https://explorer.hiro.so/txid/abc123...?chain=mainnet"
}

get-deposit-info

获取存入信息

Get information about how to deposit BTC to receive sBTC. If a wallet with Taproot keys is unlocked, returns a personalized deposit address. Otherwise returns general instructions.
bun run sbtc/sbtc.ts get-deposit-info
Output (with unlocked wallet):
json
{
  "network": "mainnet",
  "depositAddress": "bc1p...",
  "maxSignerFee": "80000 satoshis",
  "reclaimLockTime": "950 blocks",
  "stacksAddress": "SP2...",
  "instructions": [...]
}
Output (without wallet):
json
{
  "network": "mainnet",
  "depositAddress": "bc1p...",
  "minDeposit": "...",
  "maxDeposit": "...",
  "instructions": [...]
}
获取关于如何存入BTC以兑换sBTC的信息。若已解锁带有Taproot密钥的钱包,将返回个性化存入地址;否则返回通用操作指引。
bun run sbtc/sbtc.ts get-deposit-info
已解锁钱包时的输出:
json
{
  "network": "mainnet",
  "depositAddress": "bc1p...",
  "maxSignerFee": "80000 satoshis",
  "reclaimLockTime": "950 blocks",
  "stacksAddress": "SP2...",
  "instructions": [...]
}
未解锁钱包时的输出:
json
{
  "network": "mainnet",
  "depositAddress": "bc1p...",
  "minDeposit": "...",
  "maxDeposit": "...",
  "instructions": [...]
}

get-peg-info

获取挂钩信息

Get sBTC peg information including total supply and peg ratio.
bun run sbtc/sbtc.ts get-peg-info
Output:
json
{
  "network": "mainnet",
  "totalSupply": {
    "sats": "1000000000",
    "btc": "10 sBTC"
  },
  "pegRatio": "1.000000"
}
获取sBTC挂钩信息,包括总供应量和挂钩比率。
bun run sbtc/sbtc.ts get-peg-info
输出:
json
{
  "network": "mainnet",
  "totalSupply": {
    "sats": "1000000000",
    "btc": "10 sBTC"
  },
  "pegRatio": "1.000000"
}

deposit

存入

Deposit BTC to receive sBTC on Stacks L2. Builds, signs, and broadcasts a Bitcoin transaction to the sBTC deposit address. After Bitcoin confirmation, sBTC tokens are minted to your Stacks address. Requires an unlocked wallet with Bitcoin and Taproot keys.
By default only uses cardinal UTXOs (safe to spend — no inscriptions).
bun run sbtc/sbtc.ts deposit --amount <sats> [--fee-rate fast|medium|slow|<number>] [--max-signer-fee <sats>] [--reclaim-lock-time <blocks>] [--include-ordinals]
Options:
  • --amount
    (required) — Amount to deposit in satoshis (1 BTC = 100,000,000 satoshis)
  • --fee-rate
    (optional) —
    fast
    (~10 min),
    medium
    (~30 min),
    slow
    (~1 hr), or number in sat/vB (default:
    medium
    )
  • --max-signer-fee
    (optional) — Max fee the sBTC system can charge in satoshis (default: 80000)
  • --reclaim-lock-time
    (optional) — Blocks until reclaim becomes available if deposit fails (default: 950)
  • --include-ordinals
    (flag) — Include ordinal UTXOs (WARNING: may destroy valuable inscriptions!)
Output:
json
{
  "success": true,
  "txid": "btcTxid123...",
  "explorerUrl": "https://mempool.space/tx/btcTxid123...",
  "deposit": {
    "amount": "0.001 BTC",
    "amountSats": 100000,
    "recipient": "SP2...",
    "bitcoinAddress": "bc1q...",
    "taprootAddress": "bc1p...",
    "maxSignerFee": "80000 sats",
    "reclaimLockTime": "950 blocks",
    "feeRate": "5 sat/vB"
  },
  "network": "mainnet",
  "note": "sBTC tokens will be minted to your Stacks address after Bitcoin transaction confirms."
}
存入BTC以在Stacks L2上获取sBTC。构建、签名并广播一笔比特币交易至sBTC存入地址。比特币交易确认后,sBTC代币将铸造至你的Stacks地址。需要解锁带有比特币和Taproot密钥的钱包。
默认情况下仅使用基数UTXO(可安全花费——不含铭文)。
bun run sbtc/sbtc.ts deposit --amount <sats> [--fee-rate fast|medium|slow|<number>] [--max-signer-fee <sats>] [--reclaim-lock-time <blocks>] [--include-ordinals]
选项:
  • --amount
    (必填)——存入金额(以聪为单位,1 BTC = 100,000,000聪)
  • --fee-rate
    (可选)——
    fast
    (约10分钟)、
    medium
    (约30分钟)、
    slow
    (约1小时),或以聪/字节为单位的数值(默认值:
    medium
  • --max-signer-fee
    (可选)——sBTC系统可收取的最高手续费(以聪为单位,默认值:80000)
  • --reclaim-lock-time
    (可选)——存入失败后可赎回的区块等待时间(默认值:950)
  • --include-ordinals
    (标志位)——包含序数UTXO(警告:可能会销毁有价值的铭文!)
输出:
json
{
  "success": true,
  "txid": "btcTxid123...",
  "explorerUrl": "https://mempool.space/tx/btcTxid123...",
  "deposit": {
    "amount": "0.001 BTC",
    "amountSats": 100000,
    "recipient": "SP2...",
    "bitcoinAddress": "bc1q...",
    "taprootAddress": "bc1p...",
    "maxSignerFee": "80000 sats",
    "reclaimLockTime": "950 blocks",
    "feeRate": "5 sat/vB"
  },
  "network": "mainnet",
  "note": "比特币交易确认后,sBTC代币将铸造至你的Stacks地址。"
}

deposit-status

存入状态查询

Check the status of an sBTC deposit transaction via the Emily API.
bun run sbtc/sbtc.ts deposit-status --txid <btcTxid> [--vout <index>]
Options:
  • --txid
    (required) — Bitcoin transaction ID of the deposit
  • --vout
    (optional) — Output index of the deposit (default: 0)
Output:
json
{
  "txid": "btcTxid123...",
  "vout": 0,
  "status": "pending",
  "explorerUrl": "https://mempool.space/tx/btcTxid123...",
  "network": "mainnet"
}
通过Emily API查询sBTC存入交易的状态。
bun run sbtc/sbtc.ts deposit-status --txid <btcTxid> [--vout <index>]
选项:
  • --txid
    (必填)——存入交易的比特币交易ID
  • --vout
    (可选)——存入交易的输出索引(默认值:0)
输出:
json
{
  "txid": "btcTxid123...",
  "vout": 0,
  "status": "pending",
  "explorerUrl": "https://mempool.space/tx/btcTxid123...",
  "network": "mainnet"
}

Notes

注意事项

  • Balance and info queries use the Hiro API (no authentication required)
  • Transfer and deposit operations require an unlocked wallet
  • sBTC uses 8 decimal places — same as Bitcoin satoshis
  • The
    deposit
    command uses Bitcoin L1 — ensure you have BTC in your wallet's Bitcoin address
  • After depositing, sBTC tokens appear in your Stacks address after Bitcoin confirmation
  • 余额和信息查询使用Hiro API(无需认证)
  • 转账和存入操作需要解锁钱包
  • sBTC采用8位小数——与比特币的聪一致
  • deposit
    命令使用比特币L1网络——确保你的钱包比特币地址中有BTC余额
  • 存入完成后,比特币交易确认后sBTC代币将出现在你的Stacks地址中