From 31eab30a24c5c4fd2c90ac28e44efb0922e13413 Mon Sep 17 00:00:00 2001 From: ieow Date: Tue, 17 Dec 2024 17:16:02 +0800 Subject: [PATCH] fix: pubkey --- .../mpc-core-kit-bitcoin/src/BitcoinComponent.tsx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mpc-core-kit-web/mpc-core-kit-bitcoin/src/BitcoinComponent.tsx b/mpc-core-kit-web/mpc-core-kit-bitcoin/src/BitcoinComponent.tsx index 944db876..c66ed9f3 100644 --- a/mpc-core-kit-web/mpc-core-kit-bitcoin/src/BitcoinComponent.tsx +++ b/mpc-core-kit-web/mpc-core-kit-bitcoin/src/BitcoinComponent.tsx @@ -73,8 +73,8 @@ export const BitcoinComponent: React.FC = ({ coreKitInsta if (coreKitInstance) { const localSigner: SignerAsync = createBitcoinJsSigner({ coreKitInstance, network: bitcoinNetwork }); setSigner(localSigner); - const bip340Signer: SignerAsync = createBitcoinJsSignerBip340({ coreKitInstance, network: bitcoinNetwork }); - setBip340Signer(bip340Signer); + const localbip340Signer: SignerAsync = createBitcoinJsSignerBip340({ coreKitInstance, network: bitcoinNetwork }); + setBip340Signer(localbip340Signer); } }, []); @@ -117,7 +117,7 @@ export const BitcoinComponent: React.FC = ({ coreKitInsta ? payments.p2pkh({ pubkey: signer.publicKey, network: bitcoinNetwork }) : transactionType === "Segwit" ? payments.p2wpkh({ pubkey: signer.publicKey, network: bitcoinNetwork }) - : payments.p2tr({ pubkey: bip340Signer.publicKey, network: bitcoinNetwork }); + : payments.p2tr({ pubkey: bip340Signer.publicKey.subarray(1, 33), network: bitcoinNetwork }); const utxos = await fetchUtxos(account.address!);