sbtc
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChinesesBTC 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 first). Balance and info queries work without a wallet.
bun run wallet/wallet.ts unlock提供sBTC(Stacks L2上的包装比特币)操作功能。sBTC采用8位小数——与比特币一致。转账和存入操作需要解锁钱包(请先执行)。余额和信息查询无需钱包即可使用。
bun run wallet/wallet.ts unlockUsage
使用方法
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:
- (optional) — Stacks address to check (uses active wallet if omitted)
--address
Output:
json
{
"address": "SP2...",
"network": "mainnet",
"balance": {
"sats": "100000",
"btc": "0.001 sBTC"
}
}查询指定Stacks地址的sBTC余额。
bun run sbtc/sbtc.ts get-balance [--address <addr>]选项:
- (可选)——要查询的Stacks地址(若省略则使用当前活跃钱包)
--address
输出:
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 in satoshis (1 sBTC = 100,000,000 satoshis).
--amountbun run sbtc/sbtc.ts transfer --recipient <addr> --amount <sats> [--memo <text>] [--fee low|medium|high|<microStx>] [--sponsored]Options:
- (required) — Stacks address to send to
--recipient - (required) — Amount in satoshis (e.g., "100000" for 0.001 sBTC)
--amount - (optional) — Memo message to include
--memo - (optional) — Fee preset (low|medium|high) or micro-STX amount; auto-estimated if omitted
--fee - (flag) — Use fee sponsorship if available
--sponsored
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位小数。请以聪为单位指定参数(1 sBTC = 100,000,000聪)。
--amountbun run sbtc/sbtc.ts transfer --recipient <addr> --amount <sats> [--memo <text>] [--fee low|medium|high|<microStx>] [--sponsored]选项:
- (必填)——接收方的Stacks地址
--recipient - (必填)——转账金额(以聪为单位,例如"100000"代表0.001 sBTC)
--amount - (可选)——附带的备注信息
--memo - (可选)——手续费预设值(low|medium|high)或micro-STX金额;若省略则自动估算
--fee - (标志位)——若可用则使用赞助手续费
--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-infoOutput (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-infoOutput:
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:
- (required) — Amount to deposit in satoshis (1 BTC = 100,000,000 satoshis)
--amount - (optional) —
--fee-rate(~10 min),fast(~30 min),medium(~1 hr), or number in sat/vB (default:slow)medium - (optional) — Max fee the sBTC system can charge in satoshis (default: 80000)
--max-signer-fee - (optional) — Blocks until reclaim becomes available if deposit fails (default: 950)
--reclaim-lock-time - (flag) — Include ordinal UTXOs (WARNING: may destroy valuable inscriptions!)
--include-ordinals
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]选项:
- (必填)——存入金额(以聪为单位,1 BTC = 100,000,000聪)
--amount - (可选)——
--fee-rate(约10分钟)、fast(约30分钟)、medium(约1小时),或以聪/字节为单位的数值(默认值:slow)medium - (可选)——sBTC系统可收取的最高手续费(以聪为单位,默认值:80000)
--max-signer-fee - (可选)——存入失败后可赎回的区块等待时间(默认值:950)
--reclaim-lock-time - (标志位)——包含序数UTXO(警告:可能会销毁有价值的铭文!)
--include-ordinals
输出:
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:
- (required) — Bitcoin transaction ID of the deposit
--txid - (optional) — Output index of the deposit (default: 0)
--vout
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>]选项:
- (必填)——存入交易的比特币交易ID
--txid - (可选)——存入交易的输出索引(默认值:0)
--vout
输出:
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 command uses Bitcoin L1 — ensure you have BTC in your wallet's Bitcoin address
deposit - After depositing, sBTC tokens appear in your Stacks address after Bitcoin confirmation
- 余额和信息查询使用Hiro API(无需认证)
- 转账和存入操作需要解锁钱包
- sBTC采用8位小数——与比特币的聪一致
- 命令使用比特币L1网络——确保你的钱包比特币地址中有BTC余额
deposit - 存入完成后,比特币交易确认后sBTC代币将出现在你的Stacks地址中