How to generate unique addresses for multiple NFT collections on TON blockchain

I’m trying to understand how TON blockchain generates addresses for NFT collections. I’m working on creating multiple NFT collections from a single wallet, but I’m running into issues where the collections seem to replace each other instead of creating separate addresses.

I’m using the standard nft-collection.fc contract file along with its TypeScript wrapper. Here’s what I’m struggling with:

  • How does TON actually determine the contract address for NFT collections?
  • What parameters need to be changed to ensure each collection gets a unique address?

I thought each deployment would automatically get a different address, but that doesn’t seem to be happening. The collections keep overwriting the previous ones. Is there something specific in the contract initialization or deployment process that controls address generation?

Any help understanding the address creation mechanism would be great!

Address collisions happen because TON uses hash(state_init) - where state_init includes your contract code and initial data. Deploy multiple collections with identical parameters? You’ll get the same address every time. I hit this exact issue deploying gaming NFT collections. Fix it by modifying the collection’s initial state data. Most devs just add a unique seed to the init parameters - random number, timestamp, whatever works. For your nft-collection contract, pass different values for owner_address plus some unique identifier. Don’t rely on just changing metadata URIs - if the core init data’s identical, you’re stuck. Double-check your deployment script. You’re probably reusing the same init data structure without realizing it. The contract won’t generate uniqueness automatically.

Oh yeah, been there! If collections are overwriting each other, you’re definitely generating the same address somehow.

Are you changing the init data between deployments? TON calculates addresses from init code + init data - if both stay the same, you get identical addresses every time.

What init parameters are you passing? Using any salt or unique identifier? Also, deploying from the same wallet each time?

You probably need to add randomness or increment a counter in your init data. Try adding a nonce or timestamp to make each deployment unique.

What’s your deployment code look like? Would be easier to spot the address collision issue if we can see how you’re initializing things.