sBTC bridge interracts with the sBTC protocol to provide decentralised, permissionless deposits and withdrawals of Bitcoin to layer 2 - via Stacks.
node -v
v19.7.0
npm install
npm run dev
# or
npm run dev -- --open
The bridge application has 3 main components;
for more information about how to use these is your own application see the sBTC-bridge-lib README
First build the application;
npm run build
Note you can preview the production build locally with npm run preview
.
App has been tested with the Electrum wallet. On MacOs open Electrum wallet on testnet;
/Applications/Electrum.app/Contents/MacOS/run_electrum --testnet
To load the transaction;
- Tools
- Load Transaction
- From text
Paste in the hex generated by the app. Check the tx fees. Sign and broadcast the tx.
The application is currently working with Electrum 4.3.3 and Bitcoin Core v22.
Support is planned for Ledger and Trezor.
Ledger Live is the interface for Ledger hardware wallets
Note this is NOT Ledger Connect - Ledger Connect is browser extension only supporting Safari and Ethereum/Polygon chains.
Test Mode
- Download
- Ledger on Bitcoin testnet
- Enable developer mode
Links
Trezor Suite is the interface for Trezor hardware wallets
Trezor hardware wallet can be paired with Electrum
Transaction signing error: -22: TX decode failed. Make sure the tx has at least one input.
Requires access to github settings and for a branch gh-pages
to be created from main
.
Then run;
node ./gh-pages.js
This pushes the contents of build/
to the gh-pages
branch. Github Pages
has been configured on the repository to serve the application from;
https://trust-machines.github.io/sbtc-bridge
The basic strategy is to deploy the distribution files
to a branch called gh-pages
and then configure Github Pages to serve the application from there. Details on Github Pages and Svelte
applications can be found in these guides.
Create your preferred target environment (Debian VM + Nginx for example). Update the deploy script with your config and add your public ssh key to known hosts. Then run;
bash ./deploy-remote.sh
The application can be packaged and uploaded to the npm registry;
./node_modules/.bin/svelte-kit package
cd package
npm publish
gsutil cors set gcp-cors.json gs://sbtc-bridge-web
gcloud storage buckets describe gs://sbtc-bridge-web --format="default(cors)"
docker build --file Dockerfile --progress=plain --output build .
VERSION="$(date +%s)-$(git rev-parse --short HEAD)" BUCKET="gs://sbtc-bridge-web/$VERSION"
gcloud storage rm --recursive "gs://sbtc-bridge-web/**" gcloud storage cp --recursive build/* "gs://sbtc-bridge-web/"
gcloud storage cp --recursive build/* "$BUCKET/"
gsutil -m setmeta -h "Cache-Control:public, max-age=3600" "$BUCKET/**"
gcloud compute url-maps edit sbtc-bridge-web-load-balancer --global
gsutil -m rm -r gs://[BUCKET_NAME]/versions/[OLD_VERSION_NUMBER]