> For the complete documentation index, see [llms.txt](https://docs.keeta.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.keeta.com/components/blocks/operations/generateidentifier.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
