GUI: allow withdrawing Bitcoin to Taproot addresses#1153
Open
pokefan77 wants to merge 1 commit into
Open
Conversation
The withdrawal address field previously rejected Taproot (bc1p.../tb1p...) addresses because isBtcAddressValid capped the bech32 body at 49 chars. Add an opt-in allowTaproot flag (widens the cap to 87) and enable it on the withdrawal AddressInputPage. The swap refund-address field is left unchanged. The backend already sends to any recipient script type, so no Rust changes are required.
Author
|
allowtaproot is intended so we can allow it later for the refund address too but this is a bigger change which should be done while also upgrading alice to taproot and the whole atomic swap setup. as a quick QOL improvement this PR to let users withdraw to taproot this has been tested and is ready to merge |
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.
What
Allow entering Taproot (
bc1p…/tb1p…) destination addresses in the GUI Bitcoin withdrawal dialog.Why
The withdrawal address field rejected Taproot addresses, so users couldn't sweep the internal wallet to a Taproot address. The block was purely in the frontend:
isBtcAddressValidcapped the bech32 body at 49 characters, while a Taproot address is ~59 characters after thebc1/tb1prefix, so the Withdraw button never enabled.The backend already supports it — the withdrawal path only validates the network and builds the recipient output from
address.script_pubkey(), which works for any address type. No Rust changes are required.How
isBtcAddressValidgains an opt-inallowTaprootflag that widens the length cap (49 → 87) so Taproot/longer bech32(m) addresses pass.BitcoinAddressTextFieldforwards a new optionalallowTaprootprop.AddressInputPageenablesallowTaproot.Scoped to withdrawal only: the swap External Bitcoin refund address field is intentionally left unchanged.
Testing
Manually tested end-to-end on Windows: withdrawing (sweeping) the internal wallet to a mainnet Taproot (
bc1p…) address succeeded.