Install NodeJS 18 from their website according to your plateform.
Use one of the executable for your OS. It will be referred to as recover-v1-safe-wallet
in this document.
- recover-v1-safe-wallet-linux
- recover-v1-safe-wallet-macos
- recover-v1-safe-wallet-win.exe
To recover the BTC in your wallet, you will need to input the following data:
- BitGo user account access token, make sure you have enough spending limit.
- One-time password (OTP) to login; only if you need to unlock your access token.
- Wallet password
- Recovery destination. This is the address where the recovered funds will be sent to.
- User private key. This is the encrypted user private key. You can find it on the key card.
- Backup private key. This is the encrypted backup private key. You can find it on the key card.
This following information are already pre-filled for you but you can change them:
- Wallet id with BitGo
- Wallet balance to be recovered
- The recovery transactions fee on the Bitcoin network
You can fill in these data in the .env file or pass them as arguments to the script. The one-time password expires sooner so you can pass it as an argument to the script.
- Edit the .env file and fill in the data.
# Fill in the following variables with your own values
ACCESS_TOKEN=<BitGo user access token>
# OTP=<BitGo user OTP code> # can be specified with '--otp' in command line instead
WALLET_PASSCODE=<BitGo wallet password>
RECOVERY_DESTINATION=<Bitcoin address to send the recovery funds to>
USER_KEY=<Encrypted user key> # looks like: {"iv":"...", ...}
BACKUP_KEY=<Encrypted backup key> # looks like: {"iv":"...", ...}
- Run the script:
recover-v1-safe-wallet
If your token needs to be unlocked, you should specify the OTP code with the --otp
argument:
recover-v1-safe-wallet --otp <BitGo user OTP code>
You can find all command line arguments with -h
:
recover-v1-safe-wallet -h
The script should eventually print out the raw Bitconi transaction like this:
----------------------------------
Signed Raw Tx: 0100000002f244479a...a78700000000
Copy the raw transaction (just the hex string) and broadcast it on the Bitcoin network. You can use blockstream.info to broadcast the transaction. Check your wallet balances after the transaction has been confirmed on the Bitcoin network.