> 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](https://docs.keeta.com/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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

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

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
