Skip to content
3. Identity Management

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-owner

Request

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

CodeErrorCause
400INVALID_DIDDID 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_ROLE assigned 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-owner

Request

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

FieldTypeRequiredDescription
walletIdstringYesWallet ID that currently owns the identity
passwordstringYesWallet password
newOwnerstringYesNew owner address (format: 0x...)

Response (200 OK)

{}

Success returns an empty response. The blockchain transaction has been executed.

Error Responses

CodeErrorCause
404WALLET_NOT_FOUNDWallet doesn’t exist
400WRONG_PASSWORDWallet password incorrect
400INVALID_DIDDID format invalid
400NEW_OWNER_NOT_VALIDNew owner address format invalid
403INVALID_WALLETWallet doesn’t belong to your account
403IDENTITY_OWNER_ROLE_REQUIREDMissing required role
500TRANSACTION_ERRORBlockchain 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-delegate

Request

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

FieldTypeRequiredDescription
walletIdstringYesYour wallet ID
passwordstringYesWallet password
delegateTypestringYesType of delegation (max 255 chars)
delegatestringYesDelegate address (format: 0x...)
validitystringYesExpiration date (ISO 8601 format, must be future date)

Delegate Types

Common delegate types:

  • HARDWARE_OPERATOR: Can update hardware resources
  • ACCESS_MANAGER: Can manage access permissions
  • BENCHMARK_EXECUTOR: Can execute benchmarks
  • Custom types as needed

Response (200 OK)

{}

Error Responses

CodeErrorCause
404WALLET_NOT_FOUNDWallet doesn’t exist
400WRONG_PASSWORDWallet password incorrect
400INVALID_DIDDID format invalid
400INVALID_DELEGATE_TYPEDelegate type empty or too long (> 255 chars)
400INVALID_DELEGATEDelegate address format invalid
400INVALID_VALIDITYDate not in ISO format or in the past
403INVALID_WALLETWallet doesn’t belong to your account
403IDENTITY_OWNER_ROLE_REQUIREDMissing required role
500TRANSACTION_ERRORBlockchain 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-delegate

Request

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

FieldTypeRequiredDescription
walletIdstringYesYour wallet ID
passwordstringYesWallet password
delegateTypestringYesType of delegation to revoke
delegatestringYesDelegate 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:

Related Topics