# Getting MPC signing failed from ios app

**URL:** <https://community.fireblocks.com/t/getting-mpc-signing-failed-from-ios-app/1338>\
**Category:** Developer Discussion\
**Created:** [August 21, 2024, 7:13am UTC](https://community.fireblocks.com/t/getting-mpc-signing-failed-from-ios-app/1338 "2024-08-21T07:13:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![tan](https://avatars.discourse-cdn.com/v4/letter/t/f07891/32.png) [@tan](https://community.fireblocks.com/u/tan)\
**Post date:** [August 21, 2024, 7:13am UTC](https://community.fireblocks.com/t/getting-mpc-signing-failed-from-ios-app/1338/1 "2024-08-21T07:13:54Z")

</div>

This is my txid - `cb9c0205-f6e0-47c5-97ab-3b1482da5562`

I am signing it using my mpc keys from ios app but its giving me , can you plz let me know the error

```auto
MPC signing failed

An internal Fireblocks error caused the MPC signing process to fail.

```

---

<div class="post-metadata">

**Author:** ![Wilfred](https://sea1.discourse-cdn.com/flex015/user_avatar/community.fireblocks.com/wilfred/32/403_2.png) [@Wilfred](https://community.fireblocks.com/u/Wilfred)\
**Post date:** [August 21, 2024, 7:22am UTC](https://community.fireblocks.com/t/getting-mpc-signing-failed-from-ios-app/1338/2 "2024-08-21T07:22:45Z")

</div>

Hi @tan I notice that you are initiating this contract call from the `NCW_SIGNER` user. Can you try initiating it from the `NCW_ADMIN` instead?

---

<div class="post-metadata">

**Author:** ![tan](https://avatars.discourse-cdn.com/v4/letter/t/f07891/32.png) [@tan](https://community.fireblocks.com/u/tan)\
**Post date:** [August 21, 2024, 7:44am UTC](https://community.fireblocks.com/t/getting-mpc-signing-failed-from-ios-app/1338/3 "2024-08-21T07:44:51Z")

</div>

> [@Wilfred](#):
>
> NCW\_SIGNER

I am using the same endpoint to sign the tx from the webapp using the NCW\_SIGNER only , then why this NCW\_ADMIN is required ?

This txId - `cebf6adb-2af4-48d2-8aa0-85a00342421d` already went through with the same NCW\_SIGNER

---

<div class="post-metadata">

**Author:** ![tan](https://avatars.discourse-cdn.com/v4/letter/t/f07891/32.png) [@tan](https://community.fireblocks.com/u/tan)\
**Post date:** [August 21, 2024, 3:49pm UTC](https://community.fireblocks.com/t/getting-mpc-signing-failed-from-ios-app/1338/4 "2024-08-21T15:49:25Z")

</div>

I tried doing tx using `NCW_ADMIN` , nope doesnt work gives

` data: { message: 'Unauthorized: Token was not accepted.', code: -7 }`

`Request failed with status code 401`

---

<div class="post-metadata">

**Author:** ![Wilfred](https://sea1.discourse-cdn.com/flex015/user_avatar/community.fireblocks.com/wilfred/32/403_2.png) [@Wilfred](https://community.fireblocks.com/u/Wilfred)\
**Post date:** [August 22, 2024, 12:49am UTC](https://community.fireblocks.com/t/getting-mpc-signing-failed-from-ios-app/1338/5 "2024-08-22T00:49:06Z")

</div>

@tan can you verify that the ‘{{baseUrl}}’ is _`sandbox-api.fireblocks.io/v2`_ and that you are using the right credentials (secret key) for the API user? That is the most likely cause for the `Unauthorized: Token was not accepted` error.

Coming back to the original txid you shared, it appears that the signing was cancelled or aborted. Would you be able to share the logs from the iOS app that you had running?

---

<div class="post-metadata">

**Author:** ![tan](https://avatars.discourse-cdn.com/v4/letter/t/f07891/32.png) [@tan](https://community.fireblocks.com/u/tan)\
**Post date:** [August 22, 2024, 5:46am UTC](https://community.fireblocks.com/t/getting-mpc-signing-failed-from-ios-app/1338/6 "2024-08-22T05:46:59Z")

</div>

I am using the fireblocks sdk and it generating the path like this when calling

```auto
 baseURL: 'https://sandbox-api.fireblocks.io/',
 method: 'post',
 url: '/v1/transactions',

```

there’s no [https://sandbox-api.fireblocks.io/v2](https://sandbox-api.fireblocks.io/v2) , is v2 required here ? cause i have been using the v1 only for doing all of my tx already .

Also yes the api secret is correct cause using the same sdk instance with other call which are working but this call just gives not authorized

 ![image](https://us1.discourse-cdn.com/flex015/uploads/fireblocks/original/1X/582a4829e4ade200ea7b8c2174a367341a1ff7d8.png)

Will send the ios sdk logs …

The first issue is the main issue on why fireblocks is giving the MPC sign failed , can you check internal logs on what exactly is the error there ?

---

<div class="post-metadata">

**Author:** ![Wilfred](https://sea1.discourse-cdn.com/flex015/user_avatar/community.fireblocks.com/wilfred/32/403_2.png) [@Wilfred](https://community.fireblocks.com/u/Wilfred)\
**Post date:** [August 22, 2024, 6:14am UTC](https://community.fireblocks.com/t/getting-mpc-signing-failed-from-ios-app/1338/7 "2024-08-22T06:14:15Z")

</div>

apologies for the confusion, /v1 is fine.  
I’ve checked the internal logs and it looks like the signing process was cancelled by the end user or the backend.

---

<div class="post-metadata">

**Author:** ![tan](https://avatars.discourse-cdn.com/v4/letter/t/f07891/32.png) [@tan](https://community.fireblocks.com/u/tan)\
**Post date:** [August 22, 2024, 7:43am UTC](https://community.fireblocks.com/t/getting-mpc-signing-failed-from-ios-app/1338/8 "2024-08-22T07:43:02Z")

</div>

```auto
{
  "headers": {
    "platformType": "iOS",
    "sdkVersion": "2.7.0",
    "physicalDeviceId": "90147623-2bae-4a7f-a249-8655fda5bc80",
    "mpcVersion": "6"
  },
  "params": [
    {
      "code": 502,
      "message": "Failed to sign transaction",
      "stacktraces": [],
      "logs": [
        {
          "level": "INFO",
          "message": "broadcast_mpc_msg",
          "isoTimestamp": "2024-08-21T07:21:37.967Z"
        },
        {
          "isoTimestamp": "2024-08-21T07:21:37.962Z",
          "level": "INFO",
          "message": "Did send event: txId: 1c735396-2395-432c-98d1-87960660bd42, status: TIMEOUT. Error: ). - runningMethod: SIGN_TRANSACTION"
        },
        {
          "isoTimestamp": "2024-08-21T07:21:37.960Z",
          "message": "Reset timeout callback:MPC_START_SIGNING",
          "level": "INFO"
        },
        {
          "message": "mpcWrapper did destroy",
          "level": "INFO",
          "isoTimestamp": "2024-08-21T07:21:37.954Z"
        },
        {
          "level": "INFO",
          "isoTimestamp": "2024-08-21T07:21:37.953Z",
          "message": "In failedTx"
        },
        {
          "isoTimestamp": "2024-08-21T07:21:37.952Z",
          "level": "INFO",
          "message": "Calling finishSignTx with noFirstMessage from timer"
        },
        {
          "isoTimestamp": "2024-08-21T07:18:39.668Z",
          "message": "MEASURE - poll_mpc_msg 1716.4469957351685",
          "level": "INFO"
        },
        {
          "message": "Polling stopped successfully",
          "level": "INFO",
          "isoTimestamp": "2024-08-21T07:18:39.563Z"
        },
        {
          "isoTimestamp": "2024-08-21T07:18:39.562Z",
          "message": "Flow Completed: ONBOARDING_REPO",
          "level": "INFO"
        },
        {
          "message": "Step Succeeded: GET_SERVICE_CERTIFICATE",
          "level": "INFO",
          "isoTimestamp": "2024-08-21T07:18:39.562Z"
        },
        {
          "level": "INFO",
          "isoTimestamp": "2024-08-21T07:18:39.560Z",
          "message": "Step Succeeded: CLEAR_MPC_SETUP"
        },
        {
          "level": "INFO",
          "isoTimestamp": "2024-08-21T07:18:39.560Z",
          "message": "Step Succeeded: GET_SERVICE_CERTIFICATE"
        },
        {
          "isoTimestamp": "2024-08-21T07:18:39.558Z",
          "message": "Step Succeeded: GET_SERVICE_CERTIFICATE",
          "level": "INFO"
        },
        {
          "message": "Step Succeeded: SEND_MPC_PUBLIC_KEYS",
          "level": "INFO",
          "isoTimestamp": "2024-08-21T07:18:39.556Z"
        },
        {
          "isoTimestamp": "2024-08-21T07:18:39.556Z",
          "message": "Step Succeeded: GET_SERVICE_CERTIFICATE",
          "level": "INFO"
        },
        {
          "isoTimestamp": "2024-08-21T07:18:39.554Z",
          "message": "Step Succeeded: GET_SERVICE_CERTIFICATE",
          "level": "INFO"
        },
        {
          "isoTimestamp": "2024-08-21T07:18:39.552Z",
          "message": "Step Succeeded: CREATE_SIGNING_KEYS",
          "level": "INFO"
        },
        {
          "message": "Flow Completed: CREATE_SIGNATURE_KEYS_REPO",
          "level": "INFO",
          "isoTimestamp": "2024-08-21T07:18:39.552Z"
        },
        {
          "message": "Step Succeeded: START_MPC_SETUP",
          "level": "INFO",
          "isoTimestamp": "2024-08-21T07:18:39.551Z"
        },
        {
          "level": "INFO",
          "isoTimestamp": "2024-08-21T07:18:39.551Z",
          "message": "starting flow: CREATE_SIGNATURE_KEYS_REPO"
        },
        {
          "message": "Step Succeeded: GET_SERVICE_CERTIFICATE",
          "level": "INFO",
          "isoTimestamp": "2024-08-21T07:18:39.550Z"
        },
        {
          "message": "Step Succeeded: GET_SERVICE_CERTIFICATE",
          "isoTimestamp": "2024-08-21T07:18:39.549Z",
          "level": "INFO"
        },
        {
          "message": "Step Succeeded: REQUEST_MPC_SETUP",
          "isoTimestamp": "2024-08-21T07:18:39.547Z",
          "level": "INFO"
        },
        {
          "message": "Step Succeeded: GET_SERVICE_CERTIFICATE",
          "isoTimestamp": "2024-08-21T07:18:39.546Z",
          "level": "INFO"
        },
        {
          "isoTimestamp": "2024-08-21T07:18:39.545Z",
          "message": "Step Succeeded: GET_SERVICE_CERTIFICATE",
          "level": "INFO"
        },
        {
          "message": "Step Succeeded: REGISTER",
          "level": "INFO",
          "isoTimestamp": "2024-08-21T07:18:39.543Z"
        },
        {
          "isoTimestamp": "2024-08-21T07:18:39.542Z",
          "message": "Flow Completed: AUTH_REPO",
          "level": "INFO"
        },
        {
          "isoTimestamp": "2024-08-21T07:18:39.542Z",
          "message": "Step Succeeded: AUTH_REPO_COMPLETION",
          "level": "INFO"
        },
        {
          "message": "Step Succeeded: HANDLE_MISSING_KEYS",
          "isoTimestamp": "2024-08-21T07:18:39.541Z",
          "level": "INFO"
        },
        {
          "message": "Step Succeeded: HANDLE_KEY_EXIST",
          "level": "INFO",
          "isoTimestamp": "2024-08-21T07:18:39.540Z"
        },
        {
          "level": "INFO",
          "message": "Did send event: keyId: 51ff7497-cb80-4edf-9828-d265848eaa6a, algorithm: MPC_ECDSA_SECP256K1, keyStatus: READY. Error: ). - runningMethod: SIGN_TRANSACTION",
          "isoTimestamp": "2024-08-21T07:18:39.539Z"
        },
        {
          "isoTimestamp": "2024-08-21T07:18:39.537Z",
          "message": "Step Succeeded: CONTAINS_KEYS_STEP",
          "level": "INFO"
        },
        {
          "message": "Step Succeeded: HANDLE_MISSING_PUBLIC_KEYS",
          "level": "INFO",
          "isoTimestamp": "2024-08-21T07:18:39.533Z"
        },
        {
          "isoTimestamp": "2024-08-21T07:18:39.530Z",
          "message": "Step Succeeded: GET_ALL_KEYS",
          "level": "INFO"
        },
        {
          "message": "MEASURE - get_all_keys1597.527027130127",
          "isoTimestamp": "2024-08-21T07:18:39.525Z",
          "level": "INFO"
        },
        {
          "level": "INFO",
          "message": "poll_mpc_msg",
          "isoTimestamp": "2024-08-21T07:18:37.951Z"
        },
        {
          "isoTimestamp": "2024-08-21T07:18:37.949Z",
          "level": "INFO",
          "message": "Initializing pending messages listener to txId: 1c735396-2395-432c-98d1-87960660bd42"
        },
        {
          "isoTimestamp": "2024-08-21T07:18:37.949Z",
          "level": "INFO",
          "message": "secret_service.cpp - secret_service_status secret_service_init(store_data, load_data, delete_data) - "
        },
        {
          "level": "INFO",
          "isoTimestamp": "2024-08-21T07:18:37.948Z",
          "message": "Start signing tx:1c735396-2395-432c-98d1-87960660bd42"
        },
        {
          "message": "Did send event: txId: 1c735396-2395-432c-98d1-87960660bd42, status: PENDING. Error: ). - runningMethod: SIGN_TRANSACTION",
          "isoTimestamp": "2024-08-21T07:18:37.947Z",
          "level": "INFO"
        }
      ],
      "method": "SIGN_TRANSACTION",
      "metadata": {
        "iosVersion": "17.4",
        "onboardedRecovery": false,
        "uptime": "timeval(tv_sec: 1724072029, tv_usec: 859423)",
        "completedMPC": true,
        "timezone": "IST",
        "environment": "sandbox",
        "device": "arm64",
        "hasCMPKey": true,
        "deviceId": "7a69240b-9f69-4ff9-aceb-0a6ea4aa71d2"
      },
      "level": "ERROR",
      "type": "FailedToSignTransaction_SIGN_TRANSACTION"
    }
  ],
  "method": "report_event"
}

```

This is the error log for txid - `1c735396-2395-432c-98d1-87960660bd42` … giving same error

---

<div class="post-metadata">

**Author:** ![Wilfred](https://sea1.discourse-cdn.com/flex015/user_avatar/community.fireblocks.com/wilfred/32/403_2.png) [@Wilfred](https://community.fireblocks.com/u/Wilfred)\
**Post date:** [August 22, 2024, 8:59am UTC](https://community.fireblocks.com/t/getting-mpc-signing-failed-from-ios-app/1338/9 "2024-08-22T08:59:12Z")

</div>

Hi @tan I see that you are using iOS SDK 2.7.0. There is a [new release](https://ncw-developers.fireblocks.com/docs/ios-sdk#whats-new-in-271) which addresses issue on signing transactions.

Can you download version 2.7.1 and try again?
