0

I've been working on a React Multisig UI for offline creation and signing of transactions. I'm wondering how to create a signature identical to that of nacl.sign.detached() or web3js.partialSign() using a wallet adapter for an arbitrary multisig-nonce transaction.

With the current flow, a Transaction is created and serialized then encoded into a bs58 string that is copy pasted between UI instances, with which, the transaction is repopulated and signed. Then the individual Signatures will be shared with one of the multi-signers who will add all of the signatures to a transaction.

Throughout my testing of this strategy I have used with walletProvider.signTransaction() which doesn't seem to create a valid signature for multisig purposes as the transaction deserializes into a recent-blockhash transaction (the nonce becomes the recent-blockhash) and once all signatures are combined the tx.verifySignatures() returns false.

I've also experimented with passing a JSON between the users holding all information necessary to create an identical transaction in each client. This also resulted in invalid signatures being created using walletProvider.sendTransaction()

The only instance this has worked is if the offline signatures are created with nacl.sign.detached and finally the sender uses walletProvider.signAndSendTransaction() to submit the transaction.

As far as i'm aware, wallet adapters haven't integrated Multisig support so I'm hoping someone else has found a workaround for creating a valid detached signature for a Nonce Transaction using a wallet adapter?

Solution: I added a priority fee instructions to my Transaction instead of letting Phantom do it as suggested in another stack exchange thread and explained here and It seems to have solved my signature validity error!

        const PRIORITY_RATE = 100;
    const PRIORITY_FEE_IX = ComputeBudgetProgram.setComputeUnitPrice({microLamports: PRIORITY_RATE});
tx.add(PRIORITY_FEE_IX)

0

Your Answer

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

Browse other questions tagged or ask your own question.