I'm trying to sign a VersionedTransaction using Solana Wallet Adapter and getting

TypeError: Blob.encode[data] requires (length 40) Uint8Array as src

My code:

            const tx = new TransactionMessage({
                payerKey: publicKey,
                instructions: ixG
            let preSignedTx = new VersionedTransaction(tx.compileToV0Message());
            signTransaction ? await signTransaction(preSignedTx) : alert("Error");

I was able to create a legacy tx and sign that fine, don't know what the error is for V0 tx.


1 Answer 1


I don't know what the current situation is, but at the time when we were implementing versioned transactions, they weren't supported by the majority of wallets. We tested our implementation with Phantom and Solflare because they were among the few wallets that supported versioned transactions. Also make sure you have recent version of @solana/wallet-adapter packages, check https://github.com/solana-labs/wallet-adapter/blob/master/APP.md for more details...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.