sBTC Bridge on Regtest
Run the bridge and dashboard purely on localhost
The project has the following components (the first is in separate repo the other three are subpaths in a mono repo);
and dependencies on ;
Bitcoin Core (Version 24)
Clarinet
Step 1: Run all services
Run clarinet integrate;
cd stacks-sbtc/sbtc-mini
clarinet integrateBitcoin regtest (see appendix A for example config)
/Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt -regtest -datadir=${home}/Library/Application\ Support/Bitcoin -conf=${home}/Library/Application\ Support/Bitcoin/regtest/bitcoin.confRun bridge and signer dashboard web apps
cd sbtc-bridge-web
npm i // node -v 18.xx
npm run sim
# starts on port 8080
cd sbtc-bridge-api/sbtc-signer-web
npm i // node -v 18.xx
npm run sim
# starts on port 8081Run bridge and signer dashboard api apps;
Step 2: Bootstrap the sBTC Mini Contracts
Add the localhost:3999 network to Hiro wallet

Connect the signer dashboard (localhost:8081) to the deployer account (sbtc-mini/settings/Devnet.toml)

Click the upgrade button and check the transaction confirms;

The Signer Dashboard has a button for this;

Step 3: Create and fund a regtest descriptor wallet
See Appendix A for examples and config files. Summary of the steps;
Run bitcoin on regtest on a different network to clarinets bitcoind.
Connect this node to clarinets network
Create a descriptor wallet
Generate the descriptor keys
Generate receiving addresses
For funding the addresses see Appendix B. Check Clarinet sees the newly mined blocks.
Appendix A: Run Bitcoin regtest and create descriptor wallet
We need a regtest bitcoin core wallet that connects to the bitcoind running via clarinet integrate. The following config file acheive this;
Note 1: the ports are different from the clarinet network
Note 2: connect allows this node to connect to the pre-existing bitcoin network
addressType allows us to make taproot, bech32m addresses and public keys.
Curl the node and check you have the same block height reported by clarinet.
Generate keys in order to create receiving addresses;
These two links are involved but extremely helpful
Step 1) create a wallet
Step 2) Genrate keys
For example...
Change addresses - require import descriptors with
internal: true
next_index: 1001
Step 3)
Generate addresses - use the console, curl, or..
Appendix B: Mine Regtest Bitcoin
Perform actions in appendix A and then generate a new address.
Create two wallets, one for a user, say Alice and one for the peg wallet.
then mine some bitcoin to this address using the cli.
Appendix C: Alias for running bitcoin regtest on mac
Last updated