Skip to content

fix(bitcoin): reject Taproot source addresses up front in reserve proof path#477

Open
jeffrey701 wants to merge 1 commit into
entrius:testfrom
jeffrey701:fix/taproot-source-reserve-proof-guard-476
Open

fix(bitcoin): reject Taproot source addresses up front in reserve proof path#477
jeffrey701 wants to merge 1 commit into
entrius:testfrom
jeffrey701:fix/taproot-source-reserve-proof-guard-476

Conversation

@jeffrey701

Copy link
Copy Markdown

#453 made is_valid_address accept Taproot (bc1p) addresses, which is right for swap destinations. But the proof path (sign_from_proof / verify_from_proof) is BIP-137 only, so a bc1p source now passes validation and then dead-ends at reserve — the CLI prompts for a signing key that can never work, and the only hint that the address type is the blocker is a buried provider log line.

This rejects Taproot sources up front instead. Added BitcoinProvider.is_proof_supported() (true only for the P2PKH/P2WPKH/P2SH-P2WPKH types the proof path can actually handle) and check it in sign_or_prompt_external for BTC sources, printing an explicit message before the misleading key prompt. Destinations are unaffected (is_valid_address unchanged), and the validator already rejects P2TR proofs, so this is the CLI-side half. Tests cover the new capability check.

Closes #476

…of path

is_valid_address accepts Taproot (bc1p) via address_to_scriptpubkey, which is
correct for swap destinations, but sign_from_proof/verify_from_proof only
support BIP-137 (P2PKH/P2WPKH/P2SH-P2WPKH). A bc1p source therefore passed
validation and then dead-ended at reserve with messages about missing keys or
bad signatures that never named the address type.

Add BitcoinProvider.is_proof_supported() as the capability check for the proof
path and guard sign_or_prompt_external on it for BTC sources, so a Taproot
source is rejected up front with an explicit message instead of the misleading
external-signature prompt. Destinations are unaffected (is_valid_address
unchanged); the validator backstop already rejects P2TR proofs.

Closes entrius#476
@xiao-xiao-mao xiao-xiao-mao Bot added the bug Something isn't working label Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug] Taproot (bc1p) source passes validation but reserve proof always fails

1 participant