This repository offers utilities for Bitcoin and RGB++ asset integration.
Bitcoin/RGB++ Assets Service
CKB Bitcoin SPV Type Script: A type script for Bitcoin SPV clients which synchronize Bitcoin state into CKB
RGB++ scripts/contracts: RgbppLockScript and BtcTimeLockScript
Creation of rgbpp_ckb_tx_virtual
using @rgbpp-sdk/ckb
[!IMPORTANT] It's recommended to save the
rgbpp_ckb_tx_virtual
locally in case you need it in the future.
Creation of rgbpp_btc_tx
through @rgbpp-sdk/btc
rgbpp_btc_tx
based on rgbpp_ckb_tx_virtual
and rgbpp commitmentrgbpp_btc_tx
to obtain rgbpp_btc_txid
JoyID or dApp sends rgbpp_btc_txid
and rgbpp_ckb_tx_virtual
to RGB++ CKB transaction Queue (API Endpoint: /rgbpp/v1/transaction/ckb-tx
)
RGB++ CKB transaction Queue
will process the following things:
verify the received requests
continuously fetch request from the queue through a cron job
check whether the confirmations of req.rgbpp_btc_txid
is sufficient
generate the witnesses for RgbppLocks in the rgbpp_ckb_tx_virtual
add a paymaster cell into rgbpp_ckb_tx_virtual
inputs if the CKB capacity is insufficient
based on the exchange rates of BTC and CKB, the paymaster BTC UTXO's value required to subsidize a paymaster CKB cell is approximately:
paymaster_utxo_sats ~= 316 * ${ckb_price} / ${btc_price} * 100000000
finalize the rgbpp_ckb_tx_virtual
to a rgbpp_ckb_tx
broadcast rgbpp_ckb_tx
and mark the job as completed upon tx-confirmation
Bitcoin/RGB++ Assets Service
is an open-source project designed to streamline the transaction workflow for Bitcoin and RGB++ Assets. Developers have the option to enhance it by implementing its features by themselves without limitations. Bitcoin/RGB++ Assets Service
, please follow the instructions at the Deployment section in the btc-assets-api repository.See Generate a JSON Web Token (JWT) for Bitcoin/RGB++ Assets Service
See RGB++ Lock Script Error Codes
ISC License