Repository navigation
Conversation
…nfirm The withdraw flow accepted any string as a Bitcoin destination (`bip122` validation was a no-op), so a `0x` or testnet address reached the review step. Worse, the review summary swallowed every fee-estimation failure into "Unable to estimate": libqc's `estimateEmptyVaultFee` throws `InvalidDestinationAddressError` for a bad address and `NoWithdrawableAssetsError` when the balance is below the dust limit after fees, and both were logged and discarded. The user was shown the asset list, an enabled confirm button and a fee that "could not be estimated", then hit a hard failure from `emptyVault` on the error screen - "no assets available to withdraw" right after being shown the assets. - Add a cheap Bitcoin mainnet shape check (legacy base58, bech32, bech32m) on the address step so obvious mistakes are caught inline; libqc stays the authoritative validator. - Map typed estimation failures to two new summary states, `invalid-destination` and `insufficient-for-fee`, which block confirm and explain why. Unknown estimation failures still degrade to a confirmable review with an unknown fee, as before. - Move destination validation into `lib/withdraw-destination.ts` so it can be unit tested without mounting the screen.
kriss39
requested review from
antoni0dev,
conor-deegan,
crosby and
ralphking
as code owners
September 13, 2026 12:54
This branch has not been deployed
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.
…nfirm
The withdraw flow accepted any string as a Bitcoin destination (
bip122validation was a no-op), so a0xor testnet address reached the review step. Worse, the review summary swallowed every fee-estimation failure into "Unable to estimate": libqc'sestimateEmptyVaultFeethrowsInvalidDestinationAddressErrorfor a bad address andNoWithdrawableAssetsErrorwhen the balance is below the dust limit after fees, and both were logged and discarded. The user was shown the asset list, an enabled confirm button and a fee that "could not be estimated", then hit a hard failure fromemptyVaulton the error screen - "no assets available to withdraw" right after being shown the assets.invalid-destinationandinsufficient-for-fee, which block confirm and explain why. Unknown estimation failures still degrade to a confirmable review with an unknown fee, as before.lib/withdraw-destination.tsso it can be unit tested without mounting the screen.Why
How
Security / Environment Variables (if applicable)
Testing