{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/paradex/json-schema/paradex-requests-create-subkey-schema.json",
  "title": "requests.CreateSubkey",
  "x-generated": "2026-11-10",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/paradex-subkey-api-openapi.yml#/components/schemas/requests.CreateSubkey",
  "type": "object",
  "required": [
    "name",
    "public_key"
  ],
  "properties": {
    "allowed_cidrs": {
      "description": "Optional IP CIDR allowlist applied atomically at creation, so the subkey\nis never live unrestricted. Empty/omitted = unrestricted. Max 50 entries;\nsame format as PUT .../allowed-cidrs (e.g. \"203.0.113.0/24\"). Not covered\nby the registration signature: the list is mutable post-creation via the\nJWT-only allowed-cidrs endpoint, so signing it would add no protection.",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "encrypted_key": {
      "description": "Encrypted private key (required if state=pending).",
      "type": "string"
    },
    "eph_public_key": {
      "description": "Ephemeral public key for signature verification (required if state=pending).",
      "type": "string"
    },
    "evm_signature": {
      "description": "EVM (EIP-191) registration signature, used in place of `signature` /\n`signature_timestamp` / `signature_expiry` when the account's main\nkey is a secp256k1 key (AccountSignerType == EIP191). The server\nreconstructs nothing — the raw SIWE message presented to the user is\nsupplied verbatim in `siwe_message` and the personal_sign signature\nin `evm_signature`. The SIWE message's Statement must equal\n\"Paradex Subkey Registration: 0x<new_subkey_pubkey>\" (lowercased\npubkey); that line is what binds the authorisation to the specific\nsubkey being registered.",
      "type": "string"
    },
    "name": {
      "description": "User-friendly name for the subkey.",
      "type": "string"
    },
    "public_key": {
      "description": "Public key to be registered as a subkey.",
      "type": "string"
    },
    "signature": {
      "description": "Signature from the account's main StarkNet private key over\npedersen_array(account, public_key, signature_timestamp, signature_expiry).\nRequired when the server enforces main-key authorization on subkey\nregistration (feature flag EnableSubkeyRegistrationSignature). Format: [r, s].",
      "type": "array",
      "items": {
        "type": "string"
      }
    },
    "signature_expiry": {
      "description": "Unix seconds; included in signed message and bounds replay window.",
      "type": "integer"
    },
    "signature_timestamp": {
      "description": "Unix seconds; included in signed message.",
      "type": "integer"
    },
    "siwe_message": {
      "type": "string"
    },
    "state": {
      "description": "State of the subkey: 'active' or 'pending'. Defaults to 'active'.",
      "type": "string",
      "default": "active"
    }
  }
}