Skip to content

Draft BIP-EXFIL: interactive anti-exfil for Taproot PSBT signing - #1

Open
Sjors wants to merge 2 commits into
masterfrom
2026/10/taproot-anti-exfil
Open

Sjors wants to merge 2 commits into
masterfrom
2026/10/taproot-anti-exfil

Conversation

@Sjors

@Sjors Sjors commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Jade's native PSBT signer currently chooses the entire BIP340 nonce. A
compromised signer can use that freedom to encode information in otherwise valid
signatures. This implements the draft single-signer BIP-EXFIL protocol: the host
commits to its entropy, Jade returns a public nonce without signing, and a second
PSBT invocation opens the commitment. Jade recomputes and checks the original
nonce, incorporates the host scalar, and verifies the final BIP340 signature
before returning it. HWI independently verifies both the signature and the nonce
relation before accepting the result.

This is an experimental fork PR. The provisional PSBT namespace and
BIP-EXFIL/host / BIP-EXFIL/nonce tags must be regenerated together with the
shared vectors when a BIP number is assigned.

Related PRs and build dependencies

The two anti-exfil increments build on upstream Jade master and use its bundled
ESP-IDF, libwally and secp256k1-zkp dependencies.

  • BIP draft specifies the protocol, host
    checks, failure/retry behavior, provisional PSBT fields and eight shared vectors.
  • HWI host/device PR supplies independent
    host verification. Its Jade increments are Enable Jade Taproot key-path
    signing for current firmware
    , Support draft Taproot anti-exfil in Jade
    native PSBT signing
    , and Test refusal of anti-exfil on released Jade
    firmware
    .
  • libsecp256k1 API proposal implements
    the same protocol and vectors. It is a companion API, not a compile dependency
    of this PR. Jade uses the existing public custom-nonce API of its bundled
    secp256k1-zkp through libwally. The dedicated API could replace the small adapter
    in a later library update.
  • Bitcoin Core host PR consumes HWI
    at application level. It is not a Jade build dependency; these device tests
    use released Core for funding, finalization and broadcast.

Increments

  1. Add draft BIP-EXFIL single-signer Schnorr primitives adds dedicated nonce
    derivation and commit/sign helpers, shared vectors, transcript rejection and
    scalar-boundary tests, and wires the helper into both firmware build modes.
  2. Implement two-round Taproot anti-exfil in native PSBT signing integrates
    both rounds, advertises the capability, rejects unsupported transcript forms
    and documents the API. It uses upstream's shared PSBT/PSET pipeline, preserves
    ordinary Liquid signing, and rejects anti-exfil requests for Liquid.

Scope and failure behavior

get_version_info adds JADE_TAPROOT_ANTI_EXFIL: true. HWI requires this before
sending a protected signing request, so released firmware cannot ignore unknown
fields and sign normally. The commitment round returns only the full compressed
public nonce. The reveal round requires the exact commitment and nonce from the
first round.

The implementation supports Bitcoin PSBTv0/v2, SIGHASH_DEFAULT/ALL and BIP86
key-path inputs. Every input must belong to this Jade and carry a request for
the same round. It rejects Liquid/PSET anti-exfil requests, script paths, merkle
roots, pre-existing signatures, mixed rounds, fields outside input maps and an
output key that differs from the actual tweaked signing key. Ordinary transaction
and fee review runs in both invocations.

No secret nonce state persists between calls. Hosts must retain the original
transcript, verify the ordinary signature and sig.r == x(R0 + rho*G), and must
not automatically restart a failed session with fresh entropy.

Local validation

  • python3 test_anti_exfil.py passes against the actual bundled secp dependency:
    all eight shared vectors, changed key/message/commitment/nonce/entropy rejection,
    invalid entropy and scalar-order boundaries.
  • QEMU firmware builds pass with and without CONFIG_AMALGAMATED_BUILD using
    the upstream-pinned ESP-IDF toolchain and matching QEMU.
  • The actual-QEMU HWI matrix passes with two inputs, PSBTv0/v2, DEFAULT/ALL,
    reconnect/repeat commitment stability, five direct firmware transcript faults,
    independent host proofs, mempool acceptance, broadcast and confirmation. Core
    receives v0 only after v2 preservation and proofs have been checked.
  • The full ordinary HWI Jade library suite passes with expected skips. Full
    device runs use the shared device-suite lock to prevent enumeration collisions.
  • Released Jade compatibility checks pass for ordinary legacy/SegWit/Taproot
    mixed/external-input signing. An actual-QEMU test verifies both HWI entry points
    refuse AE and guards that no signing RPC is called on released firmware.
  • Scoped HWI Jade flake8 and mypy checks pass.

The HWI PR contains the common host,
application obligations, reproduction commands and temporary fork CI wiring.
GitHub CI results are recorded by the PR checks.

@Sjors
Sjors force-pushed the 2026/10/taproot-anti-exfil branch from 409ac5d to ff8b53f Compare October 25, 2026 09:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant