Repository navigation
Conversation
Build on experimental libngu commit 933adde, based on upstream master ff4db2c. The fork URL is needed until that dependency lands upstream.
# Conflicts: # shared/psbt.py
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.
Coldcard Edge can perform the two-round draft BIP-EXFIL protocol through its existing PSBT upload/download interface. The first invocation returns a public nonce without signing. The second checks the host reveal and recorded nonce, then returns an ordinary Taproot key signature. HWI verifies the proof before releasing the response to its caller.
Base, increments and dependencies
Based on upstream
Coldcard/firmware:new_edge, including its PSBTv2, Miniscript and MuSig nonce-cache hardening.crypto: use libngu with interactive Schnorr anti-exfilpsbt: implement interactive anti-exfil for BIP86 inputsThe crypto increment depends on libngu, specifically
secp256k1: add interactive single-signer Schnorr anti-exfil. It providesanti_exfil_commit,anti_exfil_sign, shared vectors and embedded tests. It uses existing public APIs in libngu's nested secp256k1; this firmware has no compile-time dependency on the separate libsecp256k1 anti-exfil API.The BIP draft defines the protocol and shared vectors. Its
BIP-EXFILdomains and PSBT allocation are provisional; assigning a BIP number requires coordinated vector regeneration.HWI supplies host validation, the Edge driver and real simulator tests. Its temporary CI increment builds this firmware and the Bitcoin Core host. The build dependency is libngu → Coldcard firmware → HWI; Core drives HWI and verifies its responses.
Supported behavior
This implementation supports single-signer BIP86 key-path inputs, PSBT versions 0 and 2, absent or explicit SIGHASH_DEFAULT, and SIGHASH_ALL. It rejects this protocol for registered Miniscript wallets, script-tree commitments, script paths and MuSig2. Classic Coldcard lacks ordinary Taproot support and has an explicit unsupported-device rejection test in HWI.
The provisional fields are input-only proprietary keys
fc026165 || subtype || output_key32: subtype 0 contains the 32-byte host commitment, subtype 1 the original compressed 33-byte public nonce, and subtype 2 the 32-byte host scalar. Round one accepts subtype 0 only; round two requires all three. The final signature uses the normal Taproot key-signature field.The firmware checks the actual tweaked signing key against the target UTXO, ownership and ordinary transaction/change authorization. It preserves the sighash declaration exactly and signs only targeted inputs. It rejects mixed rounds, incomplete/noncanonical fields, duplicates, global/output transcript fields, wrong keys, existing target signatures/finalization and unsupported sighashes.
Anti-exfil preflight runs before MuSig session allocation or cache access. The inner signing function receives the validated round explicitly, retaining upstream nonce-cache binding, failure cleanup and WIF input handling. In round two, native code checks the rederived nonce and opening, performs scalar arithmetic, and verifies the resulting signature.
The nonce is deterministic in the key, message and host commitment, so reconnects need no retained secret state. The UI asks for approval in both invocations. The host must retain its original transcript and verify the nonce relation: restarting with fresh randomness after an interruption can restore a selective-abort channel. Transcript fields remain until host verification and must then be removed before exporting the completed PSBT.
Validation
The native simulator was built with GCC 13, HWI's simulator fixture, the MicroPython compiler compatibility patch and the libngu Bech32 patch. HWI carries the fallback compiler patch needed by this development branch.
The HWI multi-policy test uses distinct accounts across cases because current firmware refuses registering the same policy again under another name. It still covers two registered policies and an inferred wallet.
Only the native simulator was tested; no physical hardware was flashed. The construction and implementation need cryptographic review before deployment.
Updating the stack
Publish libngu before updating the first firmware increment's gitlink. If signing or rebasing changes the libngu revision, update that gitlink before publishing Coldcard; the PSBT increment can then be replayed. Once libngu is accepted upstream, restore its upstream URL and select the accepted revision. Keep HWI's temporary firmware checkout aligned, then remove its fork pins when upstream support is available.