Your Signer Shouldn't Trust Your Computer
When you sign a Bitcoin transaction on an air-gapped device, the transaction was built by a computer you shouldn't trust.
That's how most self-custody setups work. A wallet app on your laptop, the coordinator (Sparrow, for example), knows your balance and builds the transaction. A signer, a small device that holds your private key and never touches the internet, signs it. The two talk through a QR code or an SD card.
What travels between them is a PSBT, a Partially Signed Bitcoin Transaction. It's a standard format (BIP174) for a transaction that isn't signed yet, plus the data a signer needs to review it: which coins are being spent, how much they're worth, which outputs go back to your own wallet.
The catch is that the laptop wrote all of that data. And the laptop is the part that can be compromised.
What a hostile computer can do
A compromised laptop doesn't need your key. It only needs you to sign something you didn't mean to sign. A few ways:
- Fake change. Most transactions send part of the money back to you, the change. The host can mark an attacker's output as change, so the signer shows it as your own money coming back.
- A hidden fee. The fee is what the inputs are worth minus what the outputs send. If the host lies about the inputs, the signer shows a normal fee and you pay the difference.
- A swapped sighash. The sighash flag says which parts of the transaction a signature covers. Change it, and your signature can end up covering less than you think.
There's a nastier one. In a native segwit (P2WPKH) transaction with two or more inputs, each signature only commits to the value of its own input. So the host asks you to sign twice, lying about a different input each time, and combines the two signatures into a transaction with a fee you never saw. This is the attack disclosed in 2020 as CVE-2020-14199, which affected hardware wallets across the board, Trezor among them. Krux, an open source signer, fixed its version of it in August 2026.
So a signer can't trust the PSBT. It has to prove every claim on its own, against the one thing it does trust: your wallet's descriptor, the description of which keys and scripts belong to you.
Who already does this
I wanted to see how existing signers handle it, so I read their code.
The DIY air-gapped signers are Krux, in MicroPython on a K210 board, and SeedSigner, in Python on a Raspberry Pi Zero. Their PSBT parsing is in Python, through the embit library, which is memory safe. But the full chain, from QR code to bytes to PSBT to signature, runs on top of C with no such guarantees: the MicroPython VM, a QR decoder that parses whatever the camera sees, the crypto library, the drivers.
Krux's psbt.py is about 900 lines, and it covers almost everything I want to build. Its checks also report in three different shapes: an exception that stops at the first error, a boolean, and a string already formatted for the screen.
My assumption going in was that the gap was the language. Nobody was doing this in Rust.
The gap is narrower than I thought
I was wrong. BitBox02 and Keystone, two commercial hardware wallets, already verify PSBTs in Rust, in no_std (Rust without the standard library, so it runs with no operating system), in production. There are DIY ones too, like picosigner. And parsing a PSBT is a solved problem: rust-bitcoin does it.
What none of them do is share the checks. BitBox02's logic is wired to its UI, its translations and its USB protocol. Keystone's is wired to its keystore. On crates.io, I found nothing that verifies a PSBT against a wallet: one crate signs whatever you hand it, one forwards the PSBT to a hardware wallet, one scores risk with heuristics and no descriptor. BDK, the main Rust wallet library, is built for the laptop side, and bdk_wallet doesn't compile on bare metal.
So every signer solves the same problem alone, and they don't agree on the answers. I compared five of them, and each one defines "high fee" differently. Every mature signer ended up with severity levels, refuse or warn, each in its own format. SeedSigner even has a TODO in its code asking for a table that maps each error to a severity and a message.
Signing a PSBT takes a few lines of code. Knowing what you signed takes Krux about 900 lines of Python, and BitBox02 about 1,400 lines of Rust, each written for its own device.
A library that only signs what it verified
That's the gap psbt-guard is for. It's a Rust library with one promise: given a PSBT and your wallet, say what the transaction really does, and sign only if it was approved.
PSBT + descriptor ──▶ [verify] ──▶ summary ──▶ user confirms ──▶ [sign] ──▶ signed PSBT
lib UI (not lib) libThe library is a pure function. Bytes and data go in, a decision and data come out. No I/O, no randomness, no idea that a screen, a camera or an SD card exists. Those belong to the signer that uses it.
The name doubles as the scope rule: if it doesn't protect a PSBT, it's not in psbt-guard. Registering a multisig wallet goes in, because without it a signer can't prove that a change output really goes back to the same group of keys. Exporting your public keys doesn't protect a PSBT, so it stays out.
Why Rust, and where it stops helping
A signer reads data from a machine it assumes is hostile. psbt-guard takes the PSBT as raw bytes and parses it itself, with rust-bitcoin, so in safe Rust the first code to touch hostile input can't have the memory bugs that turn it into an exploit. In no_std, it runs on bare metal, with no operating system between the private key and the hardware, so there's less code to attack. And the pieces already exist in no_std: rust-bitcoin, rust-miniscript, secp256k1.
But Rust removes memory bugs, not logic bugs. A memory-safe library can still believe the wrong output is change. That part comes from testing against the official BIP test vectors, real attack fixtures, and fuzzing.
Nothing works yet
Right now, psbt-guard is a design and a name. Version 0.0.1 on crates.io is a crate that does nothing, published only so nobody else takes the name. The first usable version will be 0.1.0.
The path there is in slices, each a small release:
- 0.0.2: a verified summary for single-sig native segwit (P2WPKH).
- 0.0.3: signing, after the user confirms.
- 0.0.4: more wallet types: Taproot, multisig, Miniscript.
- 0.0.5: configurable policies (what counts as a high fee is your call, not mine).
- 0.1.0: API review, full docs, fuzzing.
If you build or audit a signer, tell us what you need in the roadmap issue. If you want to help, there are good first issues: BIP174 test vectors, regtest fixtures from Bitcoin Core, and porting the Krux and SeedSigner attack tests.
The hard part of a signer was never signing. It's knowing what you're signing.
Sign what you verified, not what the coordinator claims.