3. Identity Management
Overview
In the dAIEDGE Middleware, your wallet address serves as your blockchain identity (also called DID - Decentralized Identifier). Identities enable:
- Resource ownership (hardware, datasets, AI models)
- Role assignments
- Access control permissions
- Delegation of authority to other addresses
Identity Concepts
- Identity: An Ethereum address (e.g.,
0x742d...) - Owner: The wallet that controls the identity (initially the wallet that created it)
- Delegate: An address authorized to perform specific actions on behalf of the identity
Prerequisites
- Completed Wallet Management tutorial
- Active session (
session_id) - At least one wallet created
Step 1: Understanding Identity Ownership
When you create a wallet, its address automatically becomes your identity. Initially, you are the owner of this identity.
Check Identity Owner
Query who owns a specific identity.
Endpoint
GET /api/v1/identities/{did}/identity-ownerRequest
curl -X GET "https://middleware-daiedge.bisite.usal.es/api/v1/identities/did:ethr:development:0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7/identity-owner"Response (200 OK)
{
"owner": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7"
}When the owner address equals the identity address, it means the identity owns itself (standard case for new wallets).
Error Responses
| Code | Error | Cause |
|---|---|---|
| 400 | INVALID_DID | DID is not a valid format |
Step 2: Transfer Identity Ownership
Transfer control of an identity to a different address.
Prerequisites for Steps 2, 3 and 4: Your wallet’s DID must have the
IDENTITY_OWNER_ROLEassigned by a platform administrator before performing these operations. Contact your administrator to grant this role. See the Role Management tutorial for more details.
Endpoint
POST /api/v1/identities/{did}/change-ownerRequest
curl -X POST https://middleware-daiedge.bisite.usal.es/api/v1/identities/did:ethr:development:0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7/change-owner \
-H "Content-Type: application/json" \
-H "x-session-id: {SESSION_ID}" \
-d '{
"walletId": "0000019a95f732ce0adb8f69ccc7d362",
"password": "WalletPass123!",
"newOwner": "0x8Ba1f109551bD432803012645Ac136ddd64DBA72"
}'Request Body
| Field | Type | Required | Description |
|---|---|---|---|
walletId | string | Yes | Wallet ID that currently owns the identity |
password | string | Yes | Wallet password |
newOwner | string | Yes | New owner address (format: 0x...) |
Response (200 OK)
{}Success returns an empty response. The blockchain transaction has been executed.
Error Responses
| Code | Error | Cause |
|---|---|---|
| 404 | WALLET_NOT_FOUND | Wallet doesn’t exist |
| 400 | WRONG_PASSWORD | Wallet password incorrect |
| 400 | INVALID_DID | DID format invalid |
| 400 | NEW_OWNER_NOT_VALID | New owner address format invalid |
| 403 | INVALID_WALLET | Wallet doesn’t belong to your account |
| 403 | IDENTITY_OWNER_ROLE_REQUIRED | Missing required role |
| 500 | TRANSACTION_ERROR | Blockchain transaction failed |
Important Note
After transferring ownership, you can no longer perform operations with this identity unless:
- You are added as a delegate
- Ownership is transferred back to you
Step 3: Add a Delegate
Delegates are addresses authorized to perform specific actions on behalf of your identity without being the owner.
Endpoint
POST /api/v1/identities/{did}/add-delegateRequest
curl -X POST https://middleware-daiedge.bisite.usal.es/api/v1/identities/did:ethr:development:0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7/add-delegate \
-H "Content-Type: application/json" \
-H "x-session-id: {SESSION_ID}" \
-d '{
"walletId": "0000019a95f732ce0adb8f69ccc7d362",
"password": "WalletPass123!",
"delegateType": "HARDWARE_OPERATOR",
"delegate": "0x8Ba1f109551bD432803012645Ac136ddd64DBA72",
"validity": "2099-12-31T23:59:59Z"
}'Request Body
| Field | Type | Required | Description |
|---|---|---|---|
walletId | string | Yes | Your wallet ID |
password | string | Yes | Wallet password |
delegateType | string | Yes | Type of delegation (max 255 chars) |
delegate | string | Yes | Delegate address (format: 0x...) |
validity | string | Yes | Expiration date (ISO 8601 format, must be future date) |
Delegate Types
Common delegate types:
HARDWARE_OPERATOR: Can update hardware resourcesACCESS_MANAGER: Can manage access permissionsBENCHMARK_EXECUTOR: Can execute benchmarks- Custom types as needed
Response (200 OK)
{}Error Responses
| Code | Error | Cause |
|---|---|---|
| 404 | WALLET_NOT_FOUND | Wallet doesn’t exist |
| 400 | WRONG_PASSWORD | Wallet password incorrect |
| 400 | INVALID_DID | DID format invalid |
| 400 | INVALID_DELEGATE_TYPE | Delegate type empty or too long (> 255 chars) |
| 400 | INVALID_DELEGATE | Delegate address format invalid |
| 400 | INVALID_VALIDITY | Date not in ISO format or in the past |
| 403 | INVALID_WALLET | Wallet doesn’t belong to your account |
| 403 | IDENTITY_OWNER_ROLE_REQUIRED | Missing required role |
| 500 | TRANSACTION_ERROR | Blockchain transaction failed |
Example Validity Dates
"2099-12-31T23:59:59Z"Step 4: Revoke a Delegate
Remove delegation authority from an address.
Endpoint
POST /api/v1/identities/{did}/revoke-delegateRequest
curl -X POST https://middleware-daiedge.bisite.usal.es/api/v1/identities/did:ethr:development:0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7/revoke-delegate \
-H "Content-Type: application/json" \
-H "x-session-id: {SESSION_ID}" \
-d '{
"walletId": "0000019a95f732ce0adb8f69ccc7d362",
"password": "WalletPass123!",
"delegateType": "HARDWARE_OPERATOR",
"delegate": "0x8Ba1f109551bD432803012645Ac136ddd64DBA72"
}'Request Body
| Field | Type | Required | Description |
|---|---|---|---|
walletId | string | Yes | Your wallet ID |
password | string | Yes | Wallet password |
delegateType | string | Yes | Type of delegation to revoke |
delegate | string | Yes | Delegate address to revoke (format: 0x...) |
Response (200 OK)
{}Error Responses
Same as Add Delegate (except INVALID_VALIDITY).
Identity and Resource Ownership
Your identity (wallet address) is used throughout the platform to establish ownership:
Resources Owned by Identity
- Hardware: Registered with your identity as owner
- Datasets: Published with your identity
- AI Models: Registered with your identity
- Benchmarks: Created by your identity
- Marketplace Listings: Sold by your identity
Example: Hardware Registration with Identity
# Your wallet address is your identity
WALLET_DID="did:ethr:development:0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb7"
# Register hardware (see Hardware Registration tutorial)
curl -X POST https://middleware-daiedge.bisite.usal.es/api/v1/hardware \
-H "Content-Type: application/json" \
-H "x-session-id: {SESSION_ID}" \
-d '{
"walletId": "0000019a95f732ce0adb8f69ccc7d362",
"password": "WalletPass123!",
"did": "$WALLET_DID",
"is_implemented": true,
"description": "NVIDIA RTX 4090 with 24GB VRAM (Updated with Triton)",
"family": "nvidia-ada",
"hardware_spec": {
"cost": { "value": 0.50, "currency": "EUR", "unit": "hour" },
"cpus": [],
"accelerators": [
{
"id": "gpu_001",
"type": "gpu",
"model": "rtx-4090",
"specs": {
"rate": { "value": 2520, "unit": "MHz", "kind": "frequency" },
"cores": { "value": 16384, "unit": "cores" },
"computing_power": { "value": 82580, "unit": "GFLOPS" }
}
}
],
"memory": {
"type": "GDDR6X",
"kind": "DEDICATED",
"specs": {
"size": { "value": 24576, "unit": "MB" },
"rate": { "value": 21000, "unit": "MHz", "kind": "frequency" }
}
},
"storage": {
"type": "NVMe",
"specs": {
"size": { "value": 1000, "unit": "GB" },
"rate": { "value": 7000, "unit": "MB/s", "kind": "read_speed" }
}
},
"power": {
"min": { "value": 100, "unit": "W" },
"max": { "value": 450, "unit": "W" }
}
},
"software_spec": {
"OS": "Ubuntu",
"version": "22.04 LTS",
"engines": [
{
"id": "trt_001",
"name": "TensorRT",
"family": "tensorrt",
"version": "8.6",
"computing_backends": ["gpu_001"],
"supported_applications": [
{
"type": "BENCHMARKING",
"details": { "supported_types": ["TYPE1", "TYPE2", "TYPE3"] }
}
]
},
{
"id": "triton_001",
"name": "Triton Inference Server",
"family": "triton",
"version": "2.0",
"computing_backends": ["gpu_001"],
"supported_applications": [
{
"type": "BENCHMARKING",
"details": { "supported_types": ["TYPE1", "TYPE2", "TYPE3"] }
}
]
}
]
}
}'The hardware is now owned by your identity did:ethr:development:0x742d....
Next Steps
Now that you understand identity management, proceed to:
- Role Management and Access Control - Learn about role-based permissions
- Hardware Registration - Register resources with your identity
Related Topics
- Wallet Management - Your wallet address is your identity
- Resource Access Control - Grant access using identities