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

# Identity

> Manage robot DIDs through lifecycle ROS 2 services with full transaction visibility.

<Warning>
  This concept has been absorbed into peaqOS. See [peaqID](/peaqos/concepts/peaqid) for the current identity model.
</Warning>

peaq ROS 2 brings the Robotics Python SDK’s identity APIs into the ROS 2 ecosystem. `core_node` exposes fully lifecycle-managed services so every robot can create and query decentralized identities (DIDs) without leaving ROS tooling.

| Service                           | Type                                      | Purpose                                           |
| --------------------------------- | ----------------------------------------- | ------------------------------------------------- |
| `/peaq_core_node/identity/create` | `peaq_ros2_interfaces/srv/IdentityCreate` | Create a DID with optional metadata               |
| `/peaq_core_node/identity/read`   | `peaq_ros2_interfaces/srv/IdentityRead`   | Return the DID document linked to the node wallet |

## When to Use It

* Provision new robots on the peaq network directly from ROS launch flows
* Attach metadata to robots for fleet discovery and access control
* Audit DID state via ROS services before orchestrating missions

## Launch Prerequisites

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
ros2 launch peaq_ros2_core core.launch.py \
  network:=agung \
  config_yaml:=/work/peaq_ros2_examples/config/peaq_robot.yaml

ros2 lifecycle set /peaq_core_node configure
ros2 lifecycle set /peaq_core_node activate
```

The core node must be active to serve identity calls. Ensure the wallet in `peaq_robot.yaml` holds sufficient testnet funds.

## Create a DID

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
ros2 service call /peaq_core_node/identity/create \
  peaq_ros2_interfaces/srv/IdentityCreate \
  '{metadata_json: "{\"fleet\": \"warehouse_drivers\"}"}'
```

Service response (abridged):

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
transaction_hash: 0xabc123...
status: PENDING
message: "Identity creation submitted"
```

Monitor progress via `peaq/tx_status`:

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
ros2 topic echo /peaq/tx_status
```

You will see phases such as `PENDING → IN_BLOCK → FINALIZED`. The node publishes the DID to `/tmp/core_node.log` once finalized.

## Read the DID Document

```bash theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
ros2 service call /peaq_core_node/identity/read \
  peaq_ros2_interfaces/srv/IdentityRead
```

Example output:

```text theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
document_json: '{"id":"did:peaq:5G...","metadata":{"fleet":"warehouse_drivers"}}'
exists: true
network: agung
```

Use this service to confirm metadata before handing off to mission control nodes.

## Integrate in Launch Files

Embed identity creation in automated provisioning flows:

```python theme={"theme":{"light":"github-light-default","dark":"github-dark"}}
# launch/identity_provision.launch.py
from launch import LaunchDescription
from launch_ros.actions import LifecycleNode

def generate_launch_description():
    return LaunchDescription([
        LifecycleNode(
            package='peaq_ros2_core',
            executable='core_node',
            name='peaq_core_node',
            parameters=[{'config_yaml': '/work/configs/peaq_robot.yaml'}]
        )
    ])
```

After activation, issue a `ros2 service call` or include a lightweight automation node that wraps the service call to guarantee every robot registers itself when it boots.

## Operational Tips

* Store metadata (e.g., `robot_model`, `location`) to simplify downstream access control rules.
* Use `FINAL` confirmation mode for production identity provisioning by setting `PEAQ_ROBOT_CONFIRMATION_MODE=FINAL`.
* Automate faucet funding in CI pipelines to avoid manual intervention when spinning up new test robots.

Continue to [Access Control](/peaqchain/sdk-reference/robotics-sdk/ros2/core-services/access) for managing roles once identities exist.
