# 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](/guides/tokenizing-real-world-assets.md)’ 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.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.keeta.com/components/blocks/operations/generateidentifier.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
