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

# Sign a transaction or message by curve

> Signs a raw hex digest using the specified elliptic curve.
The `data` field in the response is a hex string **without** the leading `0x`.




## OpenAPI

````yaml /openapi/enclave-mpc-api.yaml post /v1/raw/sign/{curve}
openapi: 3.1.0
info:
  title: Portal Enclave MPC API
  version: '1.0'
  description: |
    The Enclave MPC API provides endpoints for MPC wallet generation, signing,
    backup, and recovery. All endpoints require a Client API Key or Client
    Session Token as a Bearer token.

    ## Base URL
    `https://mpc-client.portalhq.io`
servers:
  - url: https://mpc-client.portalhq.io
security:
  - bearerAuth: []
tags:
  - name: MPC Operations
    description: MPC wallet generation, signing, asset transfers, backup, and recovery
paths:
  /v1/raw/sign/{curve}:
    post:
      tags:
        - MPC Operations
      summary: Sign a transaction or message by curve
      description: >
        Signs a raw hex digest using the specified elliptic curve.

        The `data` field in the response is a hex string **without** the leading
        `0x`.
      operationId: rawSign
      parameters:
        - $ref: '#/components/parameters/Curve'
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/RawSignRequest'
            example:
              params: '7369676e2074686973'
              share: eyJjbG...
      responses:
        '200':
          description: Signed successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/SignResponse'
              example:
                data: >-
                  f7a6a07fa599db56fca50fa1202670b59054e7ed452ea57b3f5b43148b8bdb165beb3a4b0fd532162a1f0fd475de1a9ecd07c95186f7a0856ce1bffa45e3acc91b
        '400':
          description: Bad request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MpcErrorResponse'
              example:
                id: BAD_REQUEST
                message: Can't parse the request body
        '401':
          description: Unauthorized
          content:
            text/plain:
              schema:
                type: string
              example: Incorrect API key format
        '404':
          description: >-
            Portal-managed presignature not found or not decryptable with the
            supplied share
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MpcErrorResponse'
components:
  parameters:
    Curve:
      name: curve
      in: path
      required: true
      description: The elliptic curve to use.
      schema:
        type: string
        enum:
          - SECP256K1
          - ED25519
  schemas:
    RawSignRequest:
      type: object
      description: Request body for signing a raw hex digest by curve.
      properties:
        params:
          type: string
          description: |
            A hex string of the digest to sign **without** the leading `0x`
            (e.g. `"7369676e2074686973"`).
        share:
          type: string
          description: The MPC share for the relevant curve.
        presignature:
          type: string
          description: >
            The `data` value from a client-stored presign response. Omit for
            standard

            (non-presigned) signing. Mutually exclusive with `presignatureId`.
        presignatureId:
          type: string
          description: >
            The `id` value from a Portal-managed presign response. Omit for
            standard

            (non-presigned) signing. Mutually exclusive with `presignature`.
        signingScheme:
          type: string
          enum:
            - cggmp
            - frost
          description: |
            The signing scheme to use. Defaults to `cggmp`.
      required:
        - params
        - share
    SignResponse:
      type: object
      description: Response containing the signed data.
      properties:
        data:
          type: string
          description: The signed data as a hex string.
      required:
        - data
    MpcErrorResponse:
      type: object
      description: Standard error response from the Enclave MPC API.
      properties:
        id:
          type: string
          description: >-
            Short error identifier (e.g. `DKG_FAILED`, `BAD_REQUEST`,
            `RPC_OP_FAILED`).
        message:
          type: string
          description: Human-readable error details.
      required:
        - id
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: Client API Key or Client Session Token

````