Solana NFT: Minting with separate update authority and owner

Hey everyone! I’m new here and need some help with Solana NFTs.

I want to mint an NFT for my friend but keep the ability to update its metadata. I’m using my public key as the update authority in the CreateMetadataAccountV3InstructionAccounts, but I’m getting an error:

Program log: Mint authority provided does not match the authority on the mint

Here’s a simplified version of what I’m trying to do:

const friendPubkey = new web3.PublicKey('friend_address');
const myPubkey = new web3.PublicKey('my_address');

const mint = web3.Keypair.generate();

// ... other setup code ...

const metadataAccounts = {
  metadata: getMetadata(mint.publicKey),
  mint: mint.publicKey,
  mintAuthority: friendPubkey,
  payer: myPubkey,
  updateAuthority: myPubkey,
};

createCreateMetadataAccountV3Instruction(metadataAccounts, metadataArgs);

What am I doing wrong? How can I mint an NFT to my friend’s wallet while keeping update rights? Thanks for any help!

hey there elias87! welcome to the forum :slight_smile:

i’m curious about your project - sounds like a cool idea to mint an nft for your friend! have you considered minting it to your own wallet first and then transferring it? that might be an easier way to keep update authority.

also, i’m wondering why you want to keep update rights? are you planning to change the metadata later on? it would be interesting to hear more about your use case.

btw, have u looked into using a smart contract for this? might give you more flexibility. just a thought!

let us know how it goes - always fun to see new nft projects coming to life on solana!

hey elias, i’ve dealt with this before. the issue is ur using different keys for mintAuthority and updateAuthority. Try setting both to ur pubkey initially, mint the NFT, then transfer ownership to ur friend. After that u can still update metadata. hope this helps!

I’ve encountered a similar issue before. The problem lies in the mismatch between the mint authority and the update authority. In my experience, a reliable solution is to set both the mint authority and the update authority to your own public key when minting the NFT. After minting, you can then transfer the NFT to your friend’s wallet. This approach enables you to maintain the ability to update the metadata while your friend becomes the owner of the NFT. It is important to handle the transfer carefully to ensure a secure transaction and maintain transparency about the arrangement.