I’m trying to figure out how to freeze a token account using the update authority for a MasterEdition NFT. The tricky part is that I don’t have freeze authority myself. The MasterEdition seems to hold that power. I know only the freeze authority can actually freeze a token account, but I’m not sure how to use the master edition account for this.
Here’s a simplified version of what I’ve tried:
async function lockTokenAccount(nftMint: PublicKey, tokenAcct: PublicKey) {
const accOwner = getWalletKey('owner_keyfile');
const updateAuth = getWalletKey('auth_keyfile');
const nftToken = new NFTToken(connection, nftMint, TOKEN_PROGRAM_ID, updateAuth);
const result = await nftToken.lockAccount(tokenAcct, accOwner, []);
}
The updateAuth is the NFT mint’s update authority keypair. The mint and freeze authority are now with the MasterEdition, but I’m not sure how to use that for freezing.
When I run this, I get an error saying ‘owner does not match’. I’ve double-checked all the keys and accounts, but I can’t figure out what’s wrong. Any ideas on what I’m missing or how to properly freeze a MasterEdition NFT token account?
To freeze a MasterEdition NFT token account, you need to interact with the Token Metadata Program, not just the Token Program. The MasterEdition indeed holds the freeze authority, so you’ll need to use it in your instruction.
Here’s a more precise approach:
- Derive the MasterEdition PDA for your NFT mint.
- Create a freeze delegated account instruction using the Token Metadata Program.
- Include this instruction in your transaction.
Your code might look something like this:
import { createFreezeDelegatedAccountInstruction } from '@metaplex-foundation/mpl-token-metadata';
const editionPDA = await MasterEdition.getPDA(nftMint);
const freezeInstruction = createFreezeDelegatedAccountInstruction({
delegate: updateAuth.publicKey,
tokenAccount: tokenAcct,
edition: editionPDA,
mint: nftMint,
tokenProgram: TOKEN_PROGRAM_ID
});
// Add this instruction to your transaction and sign with the update authority
Ensure you’re using the correct PDAs and that your update authority has the necessary permissions.
hey there! i’ve dealt with this before. the trick is to use the token metadata program, not just the token program. you’ll need to get the MasterEdition PDA and create a freeze instruction using that.
here’s a rough idea:
import * as mpl from '@metaplex-foundation/mpl-token-metadata';
const editionPDA = await mpl.MasterEdition.getPDA(nftMint);
const freezeIx = mpl.createFreezeDelegatedAccountInstruction({
// ... params here ...
});
hope that helps! lmk if u need more info
hey sparklinggem, that’s an interesting question! i’ve been curious about freezing MasterEdition NFTs too. 
from what i understand, you’re right that the MasterEdition holds the freeze authority. have you tried using the token metadata program instead of just the token program? i think you might need to interact with both.
maybe something like this could work:
import * as mpl from '@metaplex-foundation/mpl-token-metadata';
// ... your other code ...
const editionAcct = await mpl.MasterEdition.getPDA(nftMint);
const freezeIx = mpl.createFreezeDelegatedAccountInstruction({
delegate: updateAuth.publicKey,
tokenAccount: tokenAcct,
edition: editionAcct,
mint: nftMint,
tokenProgram: TOKEN_PROGRAM_ID,
});
// Add this instruction to your transaction
i’m not 100% sure if this is exactly right, but it might point you in the right direction. have you looked into using the metaplex sdk? they might have some helper functions for this.
btw, what’s your use case for freezing MasterEdition NFTs? sounds intriguing!