Repository navigation
Conversation
The preceding registration test persists account 0 on the simulator. Registering the same descriptor again as HWI_testing_0 can be refused as a duplicate by current firmware, leaving a prompt active. Use accounts 1 and 2 for the multi-policy test. It still signs inputs from both registered policies and an inferred wallet, without relying on duplicate-policy registration being allowed.
Current firmware master uses DeviceInfo field 8 for its password- stretching string. Move the experimental capability to field 10 to match the rebased firmware, preserving its new upstream allocation. Check actual string wire bytes and the earlier draft's bool allocation so neither can advertise support without the dedicated capability.
This was referenced Oct 25, 2026
This was referenced Oct 25, 2026
Sjors
force-pushed
the
2026/10/taproot-anti-exfil
branch
from
October 25, 2026 09:54
5cde690 to
7a8ddb2
Compare
A valid protected signature does not authenticate arbitrary device metadata. Validate the complete raw response first, then reconstruct the signtx reply from the pristine host request. Copy only target nonce receipts in round one or verified target signatures in round two. Preserve caller metadata and the private transcript for the trusted host's verification. HWI and its calling application remain trusted parts of the same host. Cover device-response additions, mutations and removals across PSBT maps, in-place request mutation, existing untargeted signatures, invalid proofs, and ordinary metadata passthrough. Exercise the actual Jade and Coldcard decoders with adversarial raw device bytes, and check exact host-PSBT preservation in their native DEFAULT/ALL and v0/v2 simulator matrices.
Sjors
force-pushed
the
2026/10/taproot-anti-exfil
branch
from
October 25, 2026 15:00
7a8ddb2 to
b75558c
Compare
The device harness only uses RPC to create wallets, fund transactions and mine blocks. Selecting a random P2P port releases it before bitcoind can bind, so an unrelated socket can claim it and abort startup. Disable P2P listening instead of selecting an unnecessary P2P port.
Use 2026/10/taproot-anti-exfil in Sjors/bitcoin, ledger-bitcoin-app, trezor-firmware, Jade, bitbox02-firmware, and firmware. Coldcard's firmware gitlink also requires the matching Sjors/libngu branch. Branch refs follow signing-only commit SHA changes before publication. Retain Ubuntu 24.04 and GCC 12/13 for the tested simulator toolchains. Keep release ancestry available to version scripts. Advertise Ledger's current 2.5.1 app version in Speculos. Build minimal, pinned SDL3 and SDL3_image libraries for Trezor and bundle them beside each emulator with relative runtime paths. Select the current Rust nightly and T2T1 model, and stage the new xtask output at the path expected by the HWI harness. Keep a Coldcard compiler-patch fallback for current new_edge. Run protected signing in the existing interface and distribution matrices, and include the Core-managed Ledger integration test. Remove or repoint this temporary integration commit as the companion work lands upstream. The firmware forks and branches must exist before GitHub can execute this workflow.
Sjors
force-pushed
the
2026/10/taproot-anti-exfil
branch
from
October 26, 2026 04:02
b75558c to
fa10417
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A valid signature can leak a device's secrets through its nonce. Add a two-round
single-signer Taproot flow: the host commits to randomness, records the device's
full original nonce, reveals its contribution, and checks both BIP340 validity
and the nonce relation before accepting a signature. Six Taproot-capable device
variants implement the protocol; the four remaining HWI variants reject explicit
requests before signing.
The additive construction follows Snigirev's nonce-blinding/PSBT proposal and
Scheme 6 in Wuille's anti-covert-channel overview. The companion BIP defines the
exact domains, parity, failure rules, PSBT transport, and independent vectors.
This is an experimental implementation, with no claim of a new security proof.
Dependencies and companion PRs
This branch starts from HWI master and has no MuSig2-branch dependency.
Each firmware uses its own bundled SDK/secp primitives. Core's host PR builds on
the external-signer hardening work described in that PR. Coldcard's dependency
increment changes its libngu URL and gitlink, so publish libngu first and refresh
the firmware gitlink if its dependency is rewritten. The other temporary CI
references follow the published fork branch names.
Reviewable increments
The shared host increment, Verify interactive Taproot anti-exfil transcripts at
the HWI boundary, implements independent transcript verification. Reject
anti-exfil requests before invoking unsupported signers adds capability
preflight so an explicit request cannot silently fall back to ordinary signing.
Device increments add Ledger nonce-yield transport; Trezor protobuf receipts and
the One/T bridges; Jade native PSBT transport; BitBox02 streaming rounds and raw
SDK guards; and Coldcard Edge PSBT transport. Separate test increments register
the ordinary and protected suites, exercise mixed or untargeted inputs, reject
swapped Trezor receipts, and check refusal on released firmware.
Keep anti-exfil device logs and exceptions private to the signing context
and Protect anti-exfil CLI diagnostics across reconnect and close protect the
whole SDK/CLI lifetime described below.
Return only verified anti-exfil results in the host PSBT closes the metadata
channel in native device PSBT replies. After raw-response verification,
commands.signtxand the CLI reconstruct the response from the pristine callerrequest and copy only validated nonce receipts or verified target signatures.
Small compatibility and test-harness increments:
test: keep registered wallet accounts distinct across cases uses accounts
1 and 2 in the multi-policy test, avoiding a policy already registered by the
preceding case under another name.
bitbox02: move draft anti-exfil capability to unused DeviceInfo field moves
the decoder to field 10, preserving upstream's field-8 password-stretching
string and field-9 bootloader version. Its regression checks actual string
wire encoding and the previous draft's bool at field 8; neither advertises
field 10.
test: disable unused P2P in the device node disables the unused P2P listener.
The harness uses RPC for local wallet funding and mining; an unrelated socket
can otherwise claim the chosen P2P port before node startup.
This is the P2P-listening part of bitcoin-core/HWI#864.
That upstream PR also increases the initial mining RPC timeout; the timeout
change is not included here.
Each HWI increment was installed from its own exported tree and ran the
non-device tests available at that revision. Firmware PRs separate crypto/vector
support from wire or PSBT integration; Trezor separates its two signing engines.
Scope and application obligations
Single-signer Taproot key path, no annex, DEFAULT or explicit ALL. Several device
adapters retain their BIP86-only restriction. Script paths, MuSig2, FROST and a
general sign-to-contract API are outside this work. Existing ECDSA anti-klepto
interfaces retain their behavior.
PSBTv0/v2 carry proprietary input keys
fc 02 61 65 <subtype> <actual output key32>. Subtypes 0/1/2 contain commitment32,original nonce33 and entropy32. First-round replies contain no signature and
report
signed=false. The second round returns the usual Taproot key signature.The provisional hash tags are
BIP-EXFIL/hostandBIP-EXFIL/nonce; BIP assignmentrequires coordinated vector regeneration in every implementation.
The
commands.signtx/CLI bridge checks the original transaction includingsequences, UTXOs, requested key, sighash, transcript and per-input signatures.
Missing proofs, changed protected fields, early signatures and new untargeted
signatures fail. It validates the raw device response, then returns the original
caller PSBT with only the validated nonce receipts or verified target signatures
copied in. Caller metadata and the private transcript are retained unchanged;
unrelated device-added, changed or removed metadata is not forwarded.
This boundary handles device-controlled bytes from native PSBT transports such
as Jade and Coldcard within an honest HWI. The application and HWI are trusted
parts of the same host. Core already copies only verified signatures into its
original PSBT; this change also closes the arbitrary-device-metadata channel
for standalone HWI consumers. Successful protected replies remain private
protocol messages. The trusted host collectively retains original state and
verifies device contributions; an application may delegate these checks to HWI's
checked boundary. Core adds its own verification and remains in the same trust
boundary as HWI. The final host strips transcripts before exporting a completed
PSBT. Direct
HardwareWalletClient.sign_tx/SDK callers must apply the same checks and originalPSBT reconstruction themselves. Interrupted-session recovery requires the exact
original tuple; there is no transparent restart with fresh entropy.
The common host verifier rejects new untargeted signatures in a protected
invocation. Device support for subset targeting varies: Jade and BitBox02 require
all owned inputs to participate. Core targets all its owned unsigned inputs.
Device coverage and implementation differences
All ten full library-mode suites passed locally, with expected skips. These are
locally built simulators, not physical-device flashes. Full suites ran serially
because generic enumeration probes other simulators; private endpoints were used
only with explicit paths and no discovery.
Jade needed the narrowest bridge change because its native PSBT command already
carries the transcript. Edge also has a suitable PSBT transport, but needs a
separate libngu dependency. Ledger needs custom nonce handling through its SDK
and a new nonce-yield receipt. Trezor requires protobuf transport and two signing
engines; tests caught optional-field defaults on ordinary requests and the extra
ALL witness byte in fee-weight estimates. BitBox02 needs explicit invocation
rounds, two-pass guards and protobuf/SDK changes, making it one of the more
involved adaptations. The unsupported variants need ordinary Taproot support
first.
Privacy and error handling
Raw public nonce points can themselves carry secret information. Actual Jade
CBOR log packets and SDK exceptions reproduced a path into default logging and
debug tracebacks. A context-local filter protects the SDK operation and the
CLI's discovery/initialization, reconnect, signing and close. It preserves
unrelated threads' logging, restores handlers on success/failure, and suppresses
chained raw exceptions using fixed error categories. Cleanup failure returns no
otherwise-complete transcript. Ordinary requests retain their diagnostic text.
Library callers constructing and closing clients themselves can use
anti_exfil.private_operation()around that lifetime. Successful PSBT repliesare host-local protocol messages, not diagnostic output to publish.
Local validation
and subset targeting, malformed responses, actual Jade SDK logging, CLI
lifecycle and traceback privacy, restoration, unrelated-thread logging and
the BitBox02 capability wire regression.
The protected-response regressions simulate device metadata additions,
mutations and removals across every map, in-place decoding, existing signatures
and transcript preservation. Actual Jade and Coldcard driver decoders also
process adversarial raw device-response bytes, rejecting invalid proofs before
reconstruction. Their native PSBT simulator matrices check exact caller-PSBT
preservation in both rounds for DEFAULT/ALL and v0/v2.
companion Core. Consecutive funding/mining nodes start while the P2P port is
deliberately held throughout, using RPC.
actual firmware rejection after bypassing host preflight, DEFAULT/ALL and
PSBTv0/v2, independent host proofs, mempool acceptance, broadcast and mining.
Taproot paths were checked too. All four unsupported variants reject an
explicit request with the expected error and no returned PSBT.
including walletprocesspsbt, transcript removal, send, mempool and confirmation.
lifecycle and non-BitBox driver modules. Full optional typing remains limited
by third-party stubs/SDK imports and existing BitBox generated-protobuf and
PubkeyProvider errors; no complete typing pass is claimed.
coverage and small-order zero-nonce checks, Ledger native crypto tests,
BitBox02's actual ARM firmware build and full Rust unit suite, and libngu's
embedded tests with Schnorr enabled and disabled and without MuSig.
Install HWI, build the matching firmware with
test/setup_environment.sh, andrun from
test/:Use
--ledger-pathfor both Ledger variants.--ledger-anti-exfil-coreselectsthe Ledger protected suite plus the Core-managed test and needs the companion
Core build with
-signerantiexfil. The ordinary suite runs separately. Thecliand
stdininterfaces are supported too; Edge was tested through all three.TEMPORARY fork CI commit
The last commit, TEMPORARY: CI build anti-exfil firmware and Core from Sjors
forks, is integration scaffolding to remove or repoint as the companion work
lands upstream. It builds Core and the supported-device firmware from the public
2026/10/taproot-anti-exfilbranches inSjors/bitcoin,Sjors/ledger-bitcoin-app,Sjors/trezor-firmware,Sjors/Jade,Sjors/bitbox02-firmwareandSjors/firmware. Coldcard fetches its libngusubmodule from
Sjors/libngu. The Ledger clone explicitly uses theapp-bitcoindestination expected by its builder.
The firmware PRs follow upstream's development lines: Ledger
develop, Trezormain, Jade and BitBox02master, Coldcardnew_edge, and libngumaster.The setup derives Jade's ESP-IDF and BitBox02's SDK image from the firmware
sources. Fresh fork clones need upstream release tags for version metadata:
Blockstream/Jadetags give ESP-IDF a SemVer firmware version, and signedBitBoxSwiss/bitbox02-firmwaretags drive its version-header generator. Itsupplies the tested Trezor SDL3/Rust runtime layout and Coldcard compiler-patch
fallback while retaining release ancestry for version scripts.
The temporary CI wiring runs protected suites in the existing Python,
interface and wheel/sdist/bindist matrices; Ledger also exercises the actual
Core host. YAML, embedded shell syntax and the Trezor relocated runtime bundle
were checked locally. Current GitHub CI results are recorded by this PR's checks.