In this section, we construct a “signed transaction” in our quarantined environments, verify it, and then use QR codes to extract it from the quarantined environments (for execution in the following section).
- Execute Section VI of the Setup Protocol to prepare your quarantined workspace.
Construct the withdrawal transaction.
On the Q1 computer:
- Import QR code data
Start the QR code reader:
A window will appear with your laptop’s video feed.
For each QR code you printed out in Section I:
- Hold the QR code up to the webcam.
- When a green square appears around the QR code on the video feed, it has been successfully read.
- Verify the decoded QR code is shown in the terminal window.
- Copy-paste the decoded data (everything after, but not including, “QR-code:”) into the Quarantined Scratchpad.
- Make a note of what the data is, based on your handwritten label from the printed QR code (i.e. “raw unspent transaction” or “redemption script”).
- Close the window with the live video feed.
- Verify the destination address in the Quarantined Scratchpad matches your handwritten copy of the destination address.
- Transcribe the other information you will be using into the Quarantined
Scratchpad. If you make a transcription error, it will be easier to
identify and fix in the scratchpad compared to a situation where you
transcribed it directly
- Private keys
Transcribe the private keys with reasonable care, but painstaking verification is not critical. (If you make an error, the withdrawal will simply fail, prompting you to fix your transcription error.)
If any raw unspent transactions are too long, move each too-long transaction to its own file.
GlacierScript normally takes input by copy-pasting values, but it can only accept copy-pasted values up to about 4000 characters in size.
- If any raw unspent transaction is longer than 4000 characters,
you’ll need to save it to its own file on disk.
- If you’re not sure if it’s 4000 characters, you can try the copy-paste method. If it’s too long (or if there is some other problem with it), you’ll receive a “TX decode” error (code 22).
- You can do this by opening a new TextEdit window, pasting the raw unspent transaction into it, and saving the file.
- Make sure to save it to the folder containing
- If any raw unspent transaction is longer than 4000 characters, you’ll need to save it to its own file on disk.
- Begin construction of the withdrawal transaction:
$ cd ~/glacier $ ./glacierscript.py create-withdrawal-data
- When prompted for the number of private keys to use:
- If you are doing an initial test withdrawal for a new cold storage address, choose N (i.e. the total number of keys in your multisignature withdrawal policy – 4 if you use the default recommendation).
- Otherwise, select 2 (assuming you’re using the recommended 2-of-n withdrawal policy).
- Enter all data as prompted by copy-pasting from the Quarantined
- Technical note for experienced Bitcoin users: If the withdrawal amount & fee are cumulatively less than the total amount of the unspent transactions, the remainder will be sent back to the same cold storage address as change.
The script will output a “raw signed transaction” and a fingerprint of the signed transaction for verification purposes.
- Import QR code data
- Verify transaction construction
- On the Q2 computer, repeat step 2 above.
- Note: it is important to enter the private keys in the same order on each of the quarantined computers.
- Verify that the “Transaction fingerprint” output by GlacierScript is identical on both computers. It is possible for malware to exfiltrate bits of the private key in the transaction signature by choosing the nonce in a particular way. Bitcoin Core generates the nonce deterministically, as a function of a hash of the transaction, so we can detect the presence of any environment-specific malware by comparing the transaction generated in each quarantined environment.
- If there are any discrepancies, do not proceed. Restart the Withdrawal Protocol and seek assistance if discrepancies persist.
- On the Q2 computer, repeat step 2 above.
Visually hide all critically sensitive data.
We’ll be using a smartphone with a live Internet connection to read QR codes from the quarantined computer screens. Any malware (or a malicious QR reader app) could steal sensitive data if it is not visually hidden.
This step is important. Failing to execute it properly creates a substantial security risk.
- Put your Cold Storage Information Packets out of sight – this prevents a smartphone camera from accidentally seeing them.
- Delete all text from the Quarantined Scratchpad on the Q1 and Q2 computers.
- On the Q1 computer:
- Copy-paste the raw signed transaction from the terminal window to the Quarantined Scratchpad.
- Enable line wrapping so the entire
raw signed transaction
can be seen.
- With the Quarantined Scratchpad window active, go to the menu bar at the top of the screen.
- Select Edit.
- Select Preferences.
- Select the View tab.
- Uncheck “Do not split words over two lines”.
- Clear the terminal windows on the Q1 and Q2 computers.
- Extract the signed transaction from the quarantined environment.
- QR reader setup
- Transfer the signed transaction data to a non-quarantined computer.
- On the Q1 computer, display the raw
signed transaction as a QR code on the screen:
- In File Manager, navigate to the “Home” folder, then the “glacier” folder, and double-click “transaction.png”.
- Use the smartphone’s QR code reader to read the QR code. When the QR code is successfully read, the smartphone should display the raw signed transaction.
Verify the raw signed transaction on the smartphone matches the signed transaction data in the Quarantined Scratchpad.
You only need to verify the first 16 characters, last 16 characters, and a few somewhere in the middle.
- If it does not match, do not proceed. Try using a different QR reader application or restarting the Withdrawal Protocol. Seek assistance if discrepancies persist.
- Use the smartphone to send the raw signed transaction to yourself using a messaging app which you’ll be able to access from a laptop.
- On the Q1 computer, display the raw signed transaction as a QR code on the screen:
- Shut down both quarantined computers entirely. As a precaution against
side channel attacks, the quarantined computers should not be active except
when they absolutely need to be.
$ sudo shutdown now
The recommended Acer laptop may require you to hold down the power button for several seconds to complete the shutdown.