BTC time lock 约束BTC time lock Constraints
来源:utxostack/rgbpp / contracts/btc-time-lock/src/main.rs · mainnet 0x70d6…5a62 / testnet3 0x00cd…9326 / signet 0x80a0…5b55,hash_type type(rgbpp-sdk)Source: utxostack/rgbpp / contracts/btc-time-lock/src/main.rs · mainnet 0x70d6…5a62 / testnet3 0x00cd…9326 / signet 0x80a0…5b55, hash_type type (rgbpp-sdk)
RGB++ (UTXO Stack)
- GitHubGitHubgithub.com/utxostack/rgbpp
- XXx.com/utxostack
来源:Source: utxostack GitHub org profile (X); org website https://www.utxostack.network returned HTTP 402 to automated checks, so omitted
1 → 1BTC 确认足够后释放到 CKB 地址Release to a CKB lock after enough BTC confirmations
Inputs 输入Inputs
BTC time lock cell(来自 RGB++ leap)BTC time lock cell (from an RGB++ leap)Cell{
lock: { codeHash: BTC_TIME_LOCK,
args: BTCTimeLock{ lock_script, after, btc_txid } },
capacity: C, type: T, data: D
}
witness[group 0].lockBTCTimeUnlock{ btc_tx_proof: SPV proof }
➜
Outputs 输出Outputs
同一序号的输出output at the same indexCell{
lock: lock_script,
capacity: C, type: T, data: D
}
args:BTCTimeLock(molecule table)args: BTCTimeLock (molecule table)
lock_scriptScript
after4B
btc_txid32B
- lock_script Script 到期后的接收 lockthe lock to release to = 同序号输出的 lock= lock of the output at the same index (0x40 (64))
- after 4B 所需 BTC 确认数 u32required BTC confirmations u32 RGB++ lock 创建时要求 ≥ 6RGB++ lock requires ≥ 6 at creation (0x41)
- btc_txid 32B 触发 leap 的 BTC 交易the BTC tx that triggered the leap 在轻客户端中确认 ≥ after≥ after confirmations in the light client (0x22)
限制Constraints
- args:: 合法 BTCTimeLock(否则合约 panic)valid BTCTimeLock (otherwise the script panics) (panic)
- outputs[i]:: 对每个本 lock 的输入 i:outputs[i].lock = lock_script,capacity、type、data 完全相同for each input i with this lock: outputs[i].lock = lock_script and capacity, type, data are identical (0x40)
- witness:: group 第一个 witness.lock 为 BTCTimeUnlockgroup first witness.lock is a BTCTimeUnlock (0x02 / 0x35)
- config:: cell_deps 中有 BTCTimeLock config cellBTCTimeLock config cell in cell_deps (0x10 / 0x11)
- SPV:: btc_txid 已有 ≥ after 个确认btc_txid has ≥ after confirmations (0x20–0x23)
部署与来源Deployments & source 未核验unverified
源码source utxostack/rgbpp@4abd216d · contracts/btc-time-lock/src/main.rs · crates/core (default-branch HEAD recorded at backfill 2026-10-21; spec/plugin were written from the default branch shortly before (exact read commit not recorded))
二进制核验binary check 未核验unverified no binary or checksum at the recorded commit matched the deployed data hash (reproducible build not attempted)
| 网络network | code_hash | cell_dep | type_id args | 数据哈希data hash | 部署交易deploy tx |
|---|---|---|---|---|---|
| mainnet | 0x70d64497a075bd651e98ac030455ea200637ee325a12ad08aff03f1a117e5a62 type | 0x3d1c26b966…c1d08b9b:0 code | 0x44b8253ae1…94028a8a | 0xfac2c0484b…b0439699 | 0x3d1c26b966…c1d08b9b #17659452 |
| testnet | 0x00cdf8fab0f8ac638758ebf5ea5e4052b1d71e8a77b9f43139718621f6849326 type | 0x8fb747ff04…dd9acc94:0 code | 0xc9828585e6…ffaec984 | 0xd3db94edf2…cfc3ad58 | 0x8fb747ff04…dd9acc94 #18311895 |
| testnet | 0x80a09eca26d77cea1f5a69471c59481be7404febf40ee90f886c36a948385b55 type | 0x5364b35359…28783e21:0 code | 0x32fc8c70a6…940aff92 | 0xd3db94edf2…cfc3ad58 | 0x5364b35359…28783e21 #13560123 |
链上数据核对于 on-chain data checked 2026-10-20
错误码同 RGB++ lock(crates/core/src/error.rs)Error codes are shared with RGB++ lock (crates/core/src/error.rs)
没有签名:任何人都可以在确认足够后提交释放交易No signature: anyone can submit the release once confirmed
没有签名:任何人都可以在确认足够后提交释放交易No signature: anyone can submit the release once confirmed