0

I am trying to create a token 2022 with metadata pointer extension and signing with multi sig .

//This is how I am creating multi sig const multisigKey = await createMultisig( connection, payer, [ signer1.publicKey, signer2.publicKey, signer3.publicKey ], 2, undefined, undefined, TOKEN_2022_PROGRAM_ID );

const initializeMetadataInstruction = createInitializeInstruction({ programId: TOKEN_2022_PROGRAM_ID, // Token Extension Program as Metadata Program metadata: mintKeypair.publicKey, // Account address that holds the metadata updateAuthority: multisigKey, // Authority that can update the metadata mint: mintKeypair.publicKey, // Mint Account address mintAuthority: multisigKey, // Designated Mint Authority name: metaData.name, symbol: metaData.symbol, uri: metaData.uri, });

// Instruction to update metadata, adding custom field const updateFieldInstruction = createUpdateFieldInstruction({ programId: TOKEN_2022_PROGRAM_ID, // Token Extension Program as Metadata Program metadata: mintKeypair.publicKey, // Account address that holds the metadata updateAuthority: multisigKey, // Authority that can update the metadata field: metaData.additionalMetadata[0][0], // key value: metaData.additionalMetadata[0][1], // value }); enter code here

and When I sign with

transactionSignature = await sendAndConfirmTransaction( connection, transaction, [payer, mintKeypair,signer1,signer2,signer3] // Signers );

I am getting issue

Error creating mint: Error: unknown signer: 2CyNds8Cvt26oYnmKy8n7vS2nBeHSnAW724K5JTiTSpN

here 2CyNds8Cvt26oYnmKy8n7vS2nBeHSnAW724K5JTiTSpN => signer1 and If I remove singer1 , 2 , 3 from sendAndConfirmTransaction I get signature required for multisig public key.

2 Answers 2

0

means that signer1 is not expected to sign for any instruction directly, because the transaction is using multisigKey as authority — and the program expects the individual signer signatures to be part of the instruction as "remainingAccounts" for CPI-based signer verification.

So, you must NOT pass signer1, signer2, or signer3 to sendAndConfirmTransaction as signers (because that causes the transaction to try and sign for instructions they're not responsible for).

Instead, you do the following:

✅ Solution

  • Do not pass signer1/2/3 to sendAndConfirmTransaction.

  • Make sure to include the multisig signer accounts in the instructions as "remainingAccounts" when using them as authorities.

      import { createInitializeInstruction } from '@solana/spl-token-metadata';
    
      const initializeMetadataInstruction = createInitializeInstruction(
        {
          programId: TOKEN_2022_PROGRAM_ID,
          metadata: mintKeypair.publicKey,
          updateAuthority: multisigKey,
          mint: mintKeypair.publicKey,
          mintAuthority: multisigKey,
          name: metaData.name,
          symbol: metaData.symbol,
          uri: metaData.uri,
        },
        [
      // Remaining accounts (multisig signers)
      { pubkey: signer1.publicKey, isSigner: true, isWritable: false },
      { pubkey: signer2.publicKey, isSigner: true, isWritable: false },
    ]
    

);

Then send:

await sendAndConfirmTransaction(
  connection,
  transaction,
  [payer, mintKeypair] // Only payer and mintKeypair sign
);
7
  • I did this.In this case it is asking signature of multisigKey . @ Commented Apr 30 at 5:51
  • Create a multi-signature account const signer1 = Keypair.generate(); const signer2 = Keypair.generate(); const signer3 = Keypair.generate(); // Create a multi-signature account with the public keys of the signers const mintAuthority = await createMultisig( connection, payer, [ signer1.publicKey, signer2.publicKey, signer3.publicKey ], 2, undefined, undefined, TOKEN_2022_PROGRAM_ID ); Commented Apr 30 at 7:33
  • SystemProgram.createAccount({ fromPubkey: payer.publicKey, newAccountPubkey: mint.publicKey, space: mintLen, lamports: mintLamports, programId: TOKEN_2022_PROGRAM_ID, }), Commented Apr 30 at 7:34
  • createInitializeMetadataPointerInstruction(mint.publicKey, payer.publicKey, mint.publicKey, TOKEN_2022_PROGRAM_ID), createInitializeMintInstruction(mint.publicKey, decimals, mintAuthority, mintAuthority, TOKEN_2022_PROGRAM_ID), Commented Apr 30 at 7:34
  • createInitializeInstruction({}, [ { pubkey: signer1.publicKey, isSigner: true, isWritable: false }, ........ ]) Commented Apr 30 at 7:35
0

You did not provide details for how you're creating the multisig, but in general, multisigs work like this:

  1. You initialize the multisig PDA with all the desired signers.
  2. You queue a transaction for the multisig
  3. Each signer signs the queued transaction
  4. The transaction is sent through a CPI from the multisig program. The multisig program will check that the required signers have approved.

In your case, if you want the multisig to mint, it means only the multisig PDA must sign the transaction, not multisig participants.

You can find the Squads multisig example here

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.