808bits

A reproducible Fireblocks recovery check that leaves a signed proof

· 2026-12-01 · 7 min · custody operations

A recovery drill with Fireblocks’ open-source key recovery script ends with the word Verified! on a laptop screen. The only thing to take away is a public key, and a public key says nothing about who holds the private one. I ported the script to Go so that a drill leaves two things behind: a program whose hash anyone can reproduce from the source, and a message signed by the recovered keys.

The script is the older of the two recovery tools Fireblocks publishes. A customer runs it on an offline laptop, usually in front of witnesses, to show that a backup kit can rebuild the workspace keys without Fireblocks. I have written about what that check proves and about the drill around it.

The port is called fb_recover_keys. I rebuilt its release from two fresh clones and got the published hash both times, and I checked its signatures in Electrum and in the Solana command line tool.

What it does

The port covers fb_recover_keys.py and nothing else in the repository. It reads the backup ZIP, the RSA recovery key and the owner’s passphrase, rebuilds each key in memory and compares it with the public key in the kit. For a key that matches, it prints the extended public key, derives one address and signs a message with it:

$ ./fb_recover_keys backup_new.zip priv2.pem
Please enter mobile recovery passphrase:
Message to sign [Signed during a key recovery ceremony on 2026-12-01]: Key recovery drill, 2026-12-01

MPC_ECDSA_SECP256K1 XPUB - Key Set 1:
xpub661MyMwAqRbcFUTqYcrDh3pBvXu1uQeJZR9rizkNCiWZnddTAgnz7UMejwX7u4xLmh2JMTtL7DdZmBWGUKa7v836UarassQ3DVFATMzRycV	Verified!
Derivation Path: m/44/0/0/0/0
Bitcoin Address: bc1q9dttlwuva9xrvsz98tk8x7c6u9snf25yxs6t6s
Message Signature: H2iRzlFyMdCuLoppB03G/20wHTQpqVMl/oJtxmHdFVsBRTkN7WWvXaYzVmZ11W/TcidmI0/CxiF6Of4Q7Ff4z6U=

The kit’s second key gets the same lines with a Solana address. This backup is one of eight test kits in the upstream repository, and the Go tests recover all eight and compare the keys with the values upstream’s own tests expect.

Nothing makes the port print a private key. Upstream has a --prv flag for that, and the port answers it with an error.

The signed proof

Verified! compares the rebuilt key with a public key stored in the same kit, and the chain code used for derivation is copied from the kit unchecked. The kit is shown to agree with itself.

A signature gives the witnesses a value from outside the kit. Fireblocks documents its derivation path as m/purpose/coinType/account/change/index, with the vault account ID as the account. That makes m/44/0/0/0/0 the first Bitcoin address of vault account 0 and m/44/501/0/0/0 its Solana address, and the console shows both. If the address the tool prints is the one in the console, the kit belongs to this workspace and its chain code is right, since a wrong chain code derives a different address. The signature then shows that whoever ran the drill held the private key for that address, and the key never left the process.

Bitcoin and Solana are there to exercise both kinds of key in a kit: the secp256k1 key that signs with ECDSA and the ed25519 key that signs with EdDSA. Ethereum addresses come from the same secp256k1 key as the Bitcoin one, and Cardano addresses from the same ed25519 key as the Solana one, each along a different path. Derivation only adds a public offset to the key, so whoever can sign for one address can sign for the others. The tool signs for Bitcoin and Solana only, and for the other chains this rests on that arithmetic with no test behind it.

The message is free text, and the default carries the date from the system clock. Offline laptops are often wrong about the date, so a recent block hash typed into the message is better evidence of when the drill happened. The same kit and message always give the same signature, which lets two runs of a drill be compared line by line.

I gave the two signatures from the test kit to Electrum and to the Solana command line tool. Both accepted them, and both refused them once I added a full stop to the message. The Bitcoin one is in the form Electrum writes, and Bitcoin Core’s verifymessage will reject it, because it accepts only legacy addresses.

I have run the tool on upstream’s test kits only. They belong to no live workspace, so comparing the address with a console is the one step here that I describe without having done it.

The same bytes

A witness can only vouch for a program they can identify. The release is one static file, and its hash is that identity. The build is one line in the Makefile:

go build -trimpath -buildvcs=false -ldflags="-s -w -buildid=" -o fb_recover_keys .

It runs with cgo off and with the exact Go version named in go.mod. The Go team describes what turning cgo off does: it “removes the host C toolchain as a relevant input”. No library from the build machine ends up in the binary. CI builds every push on an x86-64 runner and again on an arm64 runner, and fails if the two files differ.

Rebuilding it years from now takes the source, that Go version and five small modules whose hashes are in go.sum. Go keeps its old releases online, and the Makefile has the go command download the right one and check it. The module mirror says it “does not save all modules forever”, so I would keep a copy of the five, and go.sum vouches for any copy.

The frozen Python

Upstream publishes no binary, so every drill installs Python and the packages again. The Docker route in its README no longer builds. The Dockerfile starts from Debian 10, which has left the mirrors, and apt-get update stops with a 404.

The usual way to get one file out of a Python program is PyInstaller, which packs the script, the Python interpreter and the shared libraries they need. I froze the script with it in five containers and looked at what went into each file.

Python compiled bySystemOpenSSL packed
Docker’s python imageDebian 101.1.1n
Docker’s python imageDebian 111.1.1w
DebianDebian 111.1.1w, a later build
Docker’s python imageDebian 123.0.17
GitHub, for its CI runnersUbuntu 24.043.0.13

Five environments gave five different files. Two builds in the same container were identical, so PyInstaller did its part, and the differences came from what it was handed to pack.

The script imports one compiled package, pycryptodome, and its libraries were the same in all five files, because requirements.txt pins it. Nothing else was. The rest is the interpreter, plus copies of OpenSSL, zlib, libffi and a few more in whatever version the system’s package manager had installed that day. The two Debian 11 rows hold different OpenSSL builds for that reason.

Which libraries get packed also depends on who compiled Python. Debian builds its Python against the system’s libexpat and libmpdec, so that file contains both and the other four contain neither. The Docker build and the GitHub build of the same Python version share no identical library outside pycryptodome, and one file is nearly twice the size of the other.

Old inputs were already hard to get during the test. Debian 11 is one release newer than the Dockerfile’s base, and apt-get install python3 failed there with a 404 as well. Both releases are still in Debian’s archive, and snapshot.debian.org keeps old package versions by date, so a frozen build can be reconstructed from a pinned image and some digging. requirements.txt records none of it, while the Go build’s whole list of inputs is go.mod and go.sum.

The 79 packages

Upstream’s requirements.txt pins 79 packages, without hashes, and 22 of them contain compiled code. The script I ported imports two. The repository also holds an interactive menu and helpers for individual chains, and the README’s one install command puts everything on what it calls “a designated offline machine”.

The Go binary contains five modules, and everything else is Go’s standard library. So 79 packages became 5.

What is missing

The port has no --prv, no menu, no key generation and none of the chain helpers, so moving funds in a real recovery still takes upstream. It signs at one path per key, for vault account 0, and says nothing about other accounts or about key sets created after the backup was cut. Go cannot reliably wipe memory, so the laptop should be treated as having held the keys, as with upstream. I am leaving out the key file formats it reads and the stricter checks on the ZIP, which the README lists.

The objection I would raise myself is that this is a stranger’s rewrite running next to live keys. It cannot print a private key, it is short enough to read before the drill, and the extended public keys it prints can be compared with the ones upstream prints from the same kit. In my five frozen Python builds and the Go binary, they were the same two strings.

the next one by rss or telegram