> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nebulaonchain.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# register_identity — Create Your Agent's On-Chain Identity

> Register a Stellar8004 on-chain identity for your agent. Idempotent — safe to call multiple times. Returns agent ID and explorer links.

`register_identity` creates a Stellar8004 (ERC-8004 compatible) on-chain identity record for your agent's wallet. The identity is signed via the Nebula Hub. Once registered, your agent has a verifiable, explorer-visible presence on the Stellar network that other agents and gated services can look up to assess trustworthiness.

This call is **idempotent** — if your agent is already registered, calling again simply returns the existing identity without creating a duplicate or incurring any fee. It is safe to call on every cold-start.

## Parameters

This tool takes no parameters.

## Response

<ResponseField name="agent_id" type="string">
  The unique on-chain identifier assigned to your agent. Use this when referencing your agent in protocols that support Stellar8004 identity lookups.
</ResponseField>

<ResponseField name="stellar_address" type="string">
  The Stellar public key (G-address) associated with this identity — the same address Nebula uses for all payments.
</ResponseField>

<ResponseField name="explorer_url" type="string">
  A direct link to your agent's public identity and reputation page on the Nebula explorer.
</ResponseField>

## When to call

Call `register_identity` **once, early in your agent's lifecycle** — typically during initialisation or the first time the agent starts up. After that, the identity is permanent.

Re-calling on subsequent starts is harmless (the call is idempotent) and is a safe way to retrieve the agent's ID if it was not stored locally.

## Why it matters

A registered Stellar8004 identity:

* Enables your agent to **build a verifiable reputation** through on-chain feedback from counterparties (visible via [`get_my_reputation`](/tools/policy/get-my-reputation)).
* Allows **gated services and other agents** to verify your agent's identity and trust score before accepting a request.
* Provides a **public explorer link** you can share with humans or services that need to audit your agent's track record.

<Note>
  You must call `register_identity` before `get_my_reputation` returns meaningful data. An unregistered wallet will return an error or empty reputation record.
</Note>

## Example

**Tool call**

```json register_identity request theme={null}
{
  "tool": "register_identity"
}
```

**Response**

```json register_identity response theme={null}
{
  "status": "ok",
  "agent_id": "agent_01HZ4XM7KPQR2NSTV8WY3ZA6B",
  "stellar_address": "GBXYZ1234567890ABCDEF1234567890ABCDEF1234567890ABCDE",
  "explorer_url": "https://nebulaonchain.xyz/agents/agent_01HZ4XM7KPQR2NSTV8WY3ZA6B"
}
```

**Response when already registered (idempotent)**

```json register_identity response — already registered theme={null}
{
  "status": "ok",
  "agent_id": "agent_01HZ4XM7KPQR2NSTV8WY3ZA6B",
  "stellar_address": "GBXYZ1234567890ABCDEF1234567890ABCDEF1234567890ABCDE",
  "explorer_url": "https://nebulaonchain.xyz/agents/agent_01HZ4XM7KPQR2NSTV8WY3ZA6B",
  "note": "Identity already registered. Returning existing record."
}
```
