This repository offers utilities for Bitcoin and RGB++ asset integration.
- @rgbpp-sdk/btc: Bitcoin part of the SDK
- @rgbpp-sdk/ckb: Nervos CKB part of the SDK
- @rgbpp-sdk/service: A wrapped class to interact with
Bitcoin/RGB++ Assets Service
- Find code examples at https://github.com/ckb-cell/rgbpp-sdk/tree/develop/examples/rgbpp
-
CKB Bitcoin SPV Type Script: A type script for Bitcoin SPV clients which synchronize Bitcoin state into CKB
-
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- construct isomorphic rgbpp_btc_tx based on rgbpp_ckb_tx_virtual and rgbpp commitment
- sign and broadcast rgbpp_btc_tx to obtain
rgbpp_btc_txid
-
JoyID or dApp sends
rgbpp_btc_txid
andrgbpp_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
- need to verify the existence of paymaster UTXO in the rgbpp_btc_tx
- sign the paymaster cell and the entire transaction if needed
- finalize the rgbpp_ckb_tx_virtual to a rgbpp_ckb_tx
- broadcast rgbpp_ckb_tx and mark the job as completed upon tx-confirmation
- The RGB++ CKB transaction Queue is designed to streamline the transaction workflow. Developers have the option to implement its features by themselves without limitation.
ISC License