Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: OKX signature tweak signer #364

Open
wants to merge 4 commits into
base: v0.3.x
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion src/utils/wallet/providers/okx_wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,19 @@ export class OKXWallet extends WalletProvider {
throw new Error("OKX Wallet not connected");
}
// Use signPsbt since it shows the fees
return await this.bitcoinNetworkProvider.signPsbt(psbtHex);
return await this.bitcoinNetworkProvider.signPsbt(
psbtHex,
// Required on 3.29.26 version
{
toSignInputs: [
{
index: 0,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks hacky. signPsbt is being used to not only sign transactions with a single input. Also, what if the input is not a taproot one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree, but it's not failing to sign the psbt
We can do a list with options in src/app/common/utils/psbt.ts. This signPsbtTransaction is used only in Unbonding and Withdrawing

So if it's OKX and we are unbonding or withdrawing, we can pass the boolean flag

Based on that flag OKX will check whether the wallet is on Taproot, and if so - add the needed options


Another solution is for OKX to disable the changes, but question is what is more future-proof?

address: this.okxWalletInfo.address,
disableTweakSigner: true,
},
],
},
);
};

signPsbts = async (psbtsHexes: string[]): Promise<string[]> => {
Expand Down