# generateIdentifier

The ‎`generateIdentifier()` operation creates a new identifier for an account or asset, such as a network, token, or storage entity. This function is typically used when initializing new assets or accounts that require a unique identifier on the Keeta Network.

This operation is part of the ‎\`builder\` and is added to a transaction before publishing.

## When to Use

* Creating a new token, network, or storage account
* Assigning a unique identifier to a new asset
* Initializing accounts before attaching metadata or permissions

## When to Use It?

* Ensuring each asset or account has a unique and valid identifier
* Streamlining the creation of new entities on the network

## Example; Creating a new token account with generateIdentifier and setting info

Here’s a simplified example using the transaction builder. See the ‘[Tokenizing Real-World Assets](https://docs.keeta.com/guides/tokenizing-real-world-assets)’ section for a full implementation,

```typescript
// Step 1: Generate a new token identifier with custom options
const pendingAccount = builder.generateIdentifier('TOKEN', {
  owner: user.account,           // Assign the initial owner of the token
  symbol: 'DEMO',                // Token symbol
  decimals: 2,                   // Number of decimal places
  metadata: {
    category: 'Real World Asset',
    createdBy: 'Demo Script'
  }
});

// Step 2: Prepare base64-encoded metadata (for demonstration)
const assetInfo = {
  assetType: 'Real World Asset',
  issuer: 'Demo Organization',
  issuedAt: new Date().toISOString()
};
const metadata_base64 = Buffer.from(JSON.stringify(assetInfo)).toString('base64');

// Step 3: Attach info and default permissions to the new token account
builder.setInfo({
  name: 'DEMORWA',
  description: 'Demo Token for Real World Asset',
  metadata: metadata_base64, // base64-encoded JSON with asset info + signature
  defaultPermission: newKeetaNet.lib.Permissions(['ACCESS'], [])
}, {
  account: pendingAccount.account // The account you're attaching this info to
});

```

* ‎type – The category of identifier to generate. Can be ‎\`NETWORK\`, ‎\`TOKEN\`, or ‎\`STORAGE\`.
* ‎options – (Optional) Additional parameters to customize the identifier generation.
* Returns – A ‎\`PendingAccount\<Algo>\` object representing the newly created identifier.
