NCW iOS SDK Init

Hi
We initialized the SDK as described in flow -

and then trying to generate the MPC keys -

So we get the following payload data that we trying to pass forward using our backend -

“{"params":[{"names":["policy_service","signing_service","zona_service","nckms","ncw-service"]}],"headers":{"platformType":"iOS","mpcVersion":"6","physicalDeviceId":"75bc5fc9-32a4-445c-81e9-eef8e13f58f3","sdkVersion":"2.7.1"},"method":"get_service_certificates"}”

“{"params":[{"names":["policy_service","signing_service","zona_service","nckms","ncw-service"]}],"method":"get_service_certificates","headers":{"platformType":"iOS","sdkVersion":"2.7.1","mpcVersion":"6","physicalDeviceId":"75bc5fc9-32a4-445c-81e9-eef8e13f58f3"}}”

But it seems that our payload data that we get from SDK use, not as described in manuals.

Could you assist with this issue please?

Hi @QeepexWallet, which step of the process are you at?

Have you already called the generateMPCKeys method in our SDK to initiate the generation of MPC keys.

Yes, we calling the generateMPCKeys, and get the result.
And then passing the result to Fireblocks via our backend, and get the error.
It seems thet the result form using generateMPCKeys is invalid in our case.

May be we need to provide more information from our side?

May be we need to provide more details?

yes could you share more details about the backend code that ingests the output from generateMPCKeys if possible?

ٍSo, we get the following result form generateMPCKeys SDK invoke:

“{"params":[{"names":["policy_service","signing_service","zona_service","nckms","ncw-service"]}],"headers":{"platformType":"iOS","mpcVersion":"6","physicalDeviceId":"75bc5fc9-32a4-445c-81e9-eef8e13f58f3","sdkVersion":"2.7.1"},"method":"get_service_certificates"}”

Then we pass it to invokeRPC, and get an error.

Example fo our request from back, and response from fireblocks:

{:url=>“https://sandbox-api.fireblocks.io/v1/ncw/wallets/449ab3e1-d5d2-4b78-85fd-cbd0bfe929ab/devices/65718d2e-2095-4977-b9e3-502d249e3ced/invoke”, :request_body=>“{"payload":"{\"method\":\"get_service_certificates\",\"headers\":{\"sdkVersion\":\"2.7.1\",\"platformType\":\"iOS\",\"physicalDeviceId\":\"75bc5fc9-32a4-445c-81e9-eef8e13f58f3\",\"mpcVersion\":\"6\"},\"params\":[{\"names\":[\"policy_service\",\"signing_service\",\"zona_service\",\"nckms\",\"ncw-service\"]}]}"}”}

{“message”=>“Unauthorized: Hash is incorrect.”, “code”=>-9}

We think that we get an invalid data from generateMPCKeys function, because in documentation shown other expexted data:

{“method”:“request_mpc_setup”,“params”:[{“algorithms”:[“MPC_CMP_ECDSA_SECP256K1”,“MPC_EDDSA_ED25519”]}],“headers”:{“sdkVersion”:1}}

ٍSo, we get the following result form generateMPCKeys SDK invoke:

“{“params”:[{“names”:[“policy_service”,“signing_service”,“zona_service”,“nckms”,“ncw-service”]}],“headers”:{“platformType”:“iOS”,“mpcVersion”:“6”,“physicalDeviceId”:“75bc5fc9-32a4-445c-81e9-eef8e13f58f3”,“sdkVersion”:“2.7.1”},“method”:“get_service_certificates”}”

Then we pass it to invokeRPC, and get an error.

Example fo our request from back, and response from fireblocks:

{:url=>“https://sandbox-api.fireblocks.io/v1/ncw/wallets/449ab3e1-d5d2-4b78-85fd-cbd0bfe929ab/devices/65718d2e-2095-4977-b9e3-502d249e3ced/invoke”, :request_body=>“{“payload”:“{"method":"get_service_certificates","headers":{"sdkVersion":"2.7.1","platformType":"iOS","physicalDeviceId":"75bc5fc9-32a4-445c-81e9-eef8e13f58f3","mpcVersion":"6"},"params":[{"names":["policy_service","signing_service","zona_service","nckms","ncw-service"]}]}”}”}

{“message”=>“Unauthorized: Hash is incorrect.”, “code”=>-9}

We think that we get an invalid data from generateMPCKeys function, because in documentation shown other expexted data:

{“method”:“request_mpc_setup”,“params”:[{“algorithms”:[“MPC_CMP_ECDSA_SECP256K1”,“MPC_EDDSA_ED25519”]}],“headers”:{“sdkVersion”:1}}