Signing with the Fireblocks API

This guide assumes that you are familiar with using the Fireblocks API. Refer to their Getting Started documentation for details. Before starting with raw signing, please check our recipes for sample code on how to stake on each network from Fireblocks.

  • ETH Staking Contract Call Signing (Recommended)

    To sign a transaction with the Fireblocks API, first obtain the contract_call_data payload from the Figment API response, then submit it to the Fireblocks API using the Create Transaction endpoint with the operation field set to contract_call.
  • SOL Staking Program Call Signing (Recommended)

    To sign a transaction with the Fireblocks API, first obtain the unsigned_tx_serialized_base64 payload from the Figment API response, then submit it to the Fireblocks API using the Create Transaction endpoint with the operation field set to program_call.
  • RAW Transaction Signing for ETH, SOL, and Supported Networks Using Figment API

    To sign a transaction with the Fireblocks API, first obtain the signing_payload from the Figment API response, then submit it to the Fireblocks API using the Create Transaction endpoint with the operation field set to raw_signing.

Fireblocks will return a signed transaction which can be used to complete the flow.

The Signing Payload

For Ethereum, the relevant field is unsigned_transaction_hashed. For Solana and other supported networks, it is signing_payload. Figment’s API returns this field in the data array under staking_transaction.

Note that some networks, such as Polkadot, may require modifications to the signing_payload before submission.

{
  "data": [
    {
      "network": "hoodi",
      "pubkey": "0x8fc7b098767d6b45f431ac820f6884f6f74bbebee4e6f30456bbcf48a280248307a8260f2913a27c076f2f0c64c67aad",
      "status": "provisioned",
      "withdrawal_address": "0xE40F80618324C814cD444434670a44ba4583aE38",
      "withdrawal_credentials": "0x010000000000000000000000e40f80618324c814cd444434670a44ba4583ae38",
      "net_fee_payout_address": "0xE40F80618324C814cD444434670a44ba4583aE38",
      "fee_recipient_address": "0xE40F80618324C814cD444434670a44ba4583aE38",
      "region": "ca-central-1",
      "deposit_data": {
        "deposit_data_root": "0xfd997ecea9711498990181f0e3f8426b1c9528e61a8fbcc999db5fb3b3d6ca4b",
        "deposit_message_root": "0xae8ccf82724a48014e7f694c3ee329210e435059d73a4fa4da2bcd825ced381e",
        "fork_version": "0x01017000",
        "signature": "0x802bec470e333c380a0c530361e76cfa27f662a411d993a663aa080070601411aae1263ccbd8f812199b1fff091e20fc0b7e793c1d0313d36d27040588d578fd8b6029be264cf79533132d1df0d40dc9ce5ba159fe4c936e9c4b4c9bf2988a29",
        "figment_signature": "0x308188024200e8a18a258b03149255a0fc4a62a6c51b99ce38c8a33b91b57d76ca1f37484a18d1efa2c2bc6182ad284ff8aad076248f27af179c0b86a6542fa67185aa1cc9f50e02420147dacbaf9cdae0638d44b824f199d9f8047d5eb9ae4ee3dfe9d1860ba7582ac4be464d46647d7ed3adac83789ec88f2b6d4ac426d90126076589291d83735c63a3",
        "deposit_cli_version": "2.7.0",
        "amount": 32000000000
      },
      "status_history": {
        "events": [
          {
            "status": "provisioned",
            "changed_at": "2024-02-22T14:14:07.848Z"
          }
        ]
      },
      "status_estimates": {
        "estimated_active_at": null,
        "estimated_exit_at": null,
        "estimated_withdrawal_at": null
      },
      "on_demand_exit": {
        "requested_at": null,
        "approved_at": null,
        "submitted_at": null,
        "request_id": null
      },
      "exit_message": null,
      "staking_request": {
        "id": "f9764269-ddb8-451f-9f81-fd460e3e2f14",
        "created_at": "2024-02-22T14:14:07.848Z"
      }
    },
    {
      "network": "hoodi",
      "pubkey": "0xaafc7b098767d6b45f431ac820f6884f6f74bbebee4e6f30456bbcf48a280248307a8260f2913a27c076f2f0c64c67c3e",
      "status": "provisioned",
      "withdrawal_address": "0xE40F80618324C814cD444434670a44ba4583aE38",
      "withdrawal_credentials": "0x010000000000000000000000e40f80618324c814cd444434670a44ba4583ae38",
      "net_fee_payout_address": "0xE40F80618324C814cD444434670a44ba4583aE38",
      "fee_recipient_address": "0xE40F80618324C814cD444434670a44ba4583aE38",
      "region": "ca-central-1",
      "deposit_data": {
        "deposit_data_root": "0xfd997ecea9711498990181f0e3f8426b1c9528e61a8fbcc999db5fb3b3d6ca4c",
        "deposit_message_root": "0xae8ccf82724a48014e7f694c3ee329210e435059d73a4fa4da2bcd825ced381f",
        "fork_version": "0x01017000",
        "signature": "0x802bec470e333c380a0c530361e76cfa27f662a411d993a663aa080070601411aae1263ccbd8f812199b1fff091e20fc0b7e793c1d0313d36d27040588d578fd8b6029be264cf79533132d1df0d40dc9ce5ba159fe4c936e9c4b4c9bf2988a29",
        "figment_signature": "0x308188024200e8a18a258b03149255a0fc4a62a6c51b99ce38c8a33b91b57d76ca1f37484a18d1efa2c2bc6182ad284ff8aad076248f27af179c0b86a6542fa67185aa1cc9f50e02420147dacbaf9cdae0638d44b824f199d9f8047d5eb9ae4ee3dfe9d1860ba7582ac4be464d46647d7ed3adac83789ec88f2b6d4ac426d90126076589291d83735c63a3",
        "deposit_cli_version": "2.7.0",
        "amount": 33000000000
      },
      "status_history": {
        "events": [
          {
            "status": "provisioned",
            "changed_at": "2024-02-22T14:14:07.848Z"
          }
        ]
      },
      "status_estimates": {
        "estimated_active_at": null,
        "estimated_exit_at": null,
        "estimated_withdrawal_at": null
      },
      "on_demand_exit": {
        "requested_at": null,
        "approved_at": null,
        "submitted_at": null,
        "request_id": null
      },
      "exit_message": null,
      "staking_request": {
        "id": "f9764269-ddb8-451f-9f81-fd460e3e2f14",
        "created_at": "2024-02-22T14:14:07.848Z"
      }
    }
  ],
  "meta": {
    "staking_request": {
      "id": "f9764269-ddb8-451f-9f81-fd460e3e2f14",
      "created_at": "2024-02-22T14:14:07.848Z",
      "amounts": [
        "32",
        "33"
      ],
      "withdrawal_address": "0xE40F80618324C814cD444434670a44ba4583aE38",
      "network": "hoodi",
      "region": "ca-central-1"
    },
    "staking_transaction": {
      "from": "0xE40F80618324C814cD444434670a44ba4583aE38",
      "to": "0xA627f94a8F94E4713d38F52aC3a6377B0a111d47",
      "amount_wei": "65000000000000000000",
      "contract_call_data": "0x4f498c730000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000308fc7b098767d6b45f431ac820f6884f6f74bbebee4e6f30456bbcf48a280248307a8260f2913a27c076f2f0c64c67aad00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000020010000000000000000000000e40f80618324c814cd444434670a44ba4583ae38000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060802bec470e333c380a0c530361e76cfa27f662a411d993a663aa080070601411aae1263ccbd8f812199b1fff091e20fc0b7e793c1d0313d36d27040588d578fd8b6029be264cf79533132d1df0d40dc9ce5ba159fe4c936e9c4b4c9bf2988a290000000000000000000000000000000000000000000000000000000000000001fd997ecea9711498990181f0e3f8426b1c9528e61a8fbcc999db5fb3b3d6ca4b",
      "unsigned_transaction_hashed": "0x3ac39ee1d324ed9816a8de4fc5f41d071bb2e522bac1fa9ea85684f6911977c4",
      "unsigned_transaction_serialized": "0x02f902d9824268058459682f0084ce33ae928305dc8f94a627f94a8f94e4713d38f52ac3a6377b0a111d478901bc16d674ec800000b902a44f498c730000000000000000000000000000000000000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000012000000000000000000000000000000000000000000000000000000000000001a000000000000000000000000000000000000000000000000000000000000002600000000000000000000000000000000000000000000000000000000000000001000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000000308fc7b098767d6b45f431ac820f6884f6f74bbebee4e6f30456bbcf48a280248307a8260f2913a27c076f2f0c64c67aad00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000020010000000000000000000000e40f80618324c814cd444434670a44ba4583ae38000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000060802bec470e333c380a0c530361e76cfa27f662a411d993a663aa080070601411aae1263ccbd8f812199b1fff091e20fc0b7e793c1d0313d36d27040588d578fd8b6029be264cf79533132d1df0d40dc9ce5ba159fe4c936e9c4b4c9bf2988a290000000000000000000000000000000000000000000000000000000000000001fd997ecea9711498990181f0e3f8426b1c9528e61a8fbcc999db5fb3b3d6ca4bc0",
      "max_gas_wei": "1328940220021646"
    }
  }
}
{
  "data": {
    "unsigned_transaction_serialized": "0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d845490355ff6299455677fe89a2ed65e74330b9d21200e5d6b66e0959cafda22e7447a11ce519ed8243e85b8aadded47943b6f79235f8beaa1dcd0e7cecdb030200080a5ac99cdc63139ca6cfaa9ebcf2b8e56da99eb01d445c818088976dacd1a356869b8e0bdb0624debb7c1dab0365fae980eb8e612fc6627ac0dd1c693a5015bef600000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a40000000ddf42a04800a54de2e583f94f17b089725b772d1333526271241532776d2ffc606a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a1d817a502050b680791e6ce6db88e1e5b7150f61fc6790a4eb4d10000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000006a7d517192c5c51218cc94c3d4af17f58daee089ba1fd44e3dbd98a0000000006a7d517193584d0feed9bb3431d13206be544281b57b8566cc5375ff4000000cfba7719d3267f0cb2f320ab3ec5a415ba51b8e2067327e593044a360c169c8104020200013400000000c0c62d0000000000c80000000000000006a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc0000000000502010874000000005ac99cdc63139ca6cfaa9ebcf2b8e56da99eb01d445c818088976dacd1a356865ac99cdc63139ca6cfaa9ebcf2b8e56da99eb01d445c818088976dacd1a35686000000000000000000000000000000005ac99cdc63139ca6cfaa9ebcf2b8e56da99eb01d445c818088976dacd1a3568603000903204e00000000000005060104070906000402000000",
    "unsigned_tx_serialized_hex": "0200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000d845490355ff6299455677fe89a2ed65e74330b9d21200e5d6b66e0959cafda22e7447a11ce519ed8243e85b8aadded47943b6f79235f8beaa1dcd0e7cecdb030200080a5ac99cdc63139ca6cfaa9ebcf2b8e56da99eb01d445c818088976dacd1a356869b8e0bdb0624debb7c1dab0365fae980eb8e612fc6627ac0dd1c693a5015bef600000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a40000000ddf42a04800a54de2e583f94f17b089725b772d1333526271241532776d2ffc606a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a1d817a502050b680791e6ce6db88e1e5b7150f61fc6790a4eb4d10000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000006a7d517192c5c51218cc94c3d4af17f58daee089ba1fd44e3dbd98a0000000006a7d517193584d0feed9bb3431d13206be544281b57b8566cc5375ff4000000cfba7719d3267f0cb2f320ab3ec5a415ba51b8e2067327e593044a360c169c8104020200013400000000c0c62d0000000000c80000000000000006a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc0000000000502010874000000005ac99cdc63139ca6cfaa9ebcf2b8e56da99eb01d445c818088976dacd1a356865ac99cdc63139ca6cfaa9ebcf2b8e56da99eb01d445c818088976dacd1a35686000000000000000000000000000000005ac99cdc63139ca6cfaa9ebcf2b8e56da99eb01d445c818088976dacd1a3568603000903204e00000000000005060104070906000402000000",
    "unsigned_tx_serialized_base64": "MDIwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw\\nMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw\\nMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMGQ4NDU0\\nOTAzNTVmZjYyOTk0NTU2NzdmZTg5YTJlZDY1ZTc0MzMwYjlkMjEyMDBlNWQ2\\nYjY2ZTA5NTljYWZkYTIyZTc0NDdhMTFjZTUxOWVkODI0M2U4NWI4YWFkZGVk\\nNDc5NDNiNmY3OTIzNWY4YmV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MTA0MDIwMjAwMDEzNDAwMDAwMDAw\\nYzBjNjJkMDAwMDAwMDAwMGM4MDAwMDAwMDAwMDAwMDAwNmExZDgxNzkxMzc1\\nNDJhOTgzNDM3YmRmZTJhN2FiMjU1N2Y1MzVjOGE3ODcyMmI2OGE0OWRjMDAw\\nMDAwMDAwMDUwMjAxMDg3NDAwMDAwMDAwNWFjOTljZGM2MzEzOWNhNmNmYWE5\\nZWJjZjJiOGU1NmRhOTllYjAxZDQ0NWM4MTgwODg5NzZkYWNkMWEzNTY4NjVh\\nYzk5Y2RjNjMxMzljYTZjZmFhOWViY2YyYjhlNTZkYTk5ZWIwMWQ0NDVjODE4\\nMDg4OTc2ZGFjZDFhMzU2ODYwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAwMDAw\\nMDAwMDVhYzk5Y2RjNjMxMzljYTZjZmFhOWViY2YyYjhlNTZkYTk5ZWIwMWQ0\\nNDVjODE4MDg4OTc2ZGFjZDFhMzU2ODYwMzAwMDkwMzIwNGUwMDAwMDAwMDAw\\nMDAwNTA2MDEwNDA3MDkwNjAwMDQwMjAwMDAwMA==\\n",
    "signing_payload": "0200080a5ac99cdc63139ca6cfaa9ebcf2b8e56da99eb01d445c818088976dacd1a356869b8e0bdb0624debb7c1dab0365fae980eb8e612fc6627ac0dd1c693a5015bef600000000000000000000000000000000000000000000000000000000000000000306466fe5211732ffecadba72c39be7bc8ce5bbc5f7126b2c439b3a40000000ddf42a04800a54de2e583f94f17b089725b772d1333526271241532776d2ffc606a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc00000000006a1d817a502050b680791e6ce6db88e1e5b7150f61fc6790a4eb4d10000000006a7d51718c774c928566398691d5eb68b5eb8a39b4b6d5c73555b210000000006a7d517192c5c51218cc94c3d4af17f58daee089ba1fd44e3dbd98a0000000006a7d517193584d0feed9bb3431d13206be544281b57b8566cc5375ff4000000cfba7719d3267f0cb2f320ab3ec5a415ba51b8e2067327e593044a360c169c8104020200013400000000c0c62d0000000000c80000000000000006a1d8179137542a983437bdfe2a7ab2557f535c8a78722b68a49dc0000000000502010874000000005ac99cdc63139ca6cfaa9ebcf2b8e56da99eb01d445c818088976dacd1a356865ac99cdc63139ca6cfaa9ebcf2b8e56da99eb01d445c818088976dacd1a35686000000000000000000000000000000005ac99cdc63139ca6cfaa9ebcf2b8e56da99eb01d445c818088976dacd1a3568603000903204e00000000000005060104070906000402000000",
    "last_valid_block_height": 291621448,
    "stake_account": "tfUTBG4BH5Cg9PdhNHiohL1fjXWkEyi6S9qZsBdT2HLQ",
    "network": "devnet"
  }
}

Sending Payloads to the Fireblocks API

Fireblocks transaction objects have a RawMessageData property, which can be passed an array of UnsignedRawMessage objects.

When sending the signing_payload from a Staking API flow to the Fireblocks API for signing, the extraParameters.rawMessageData.messages[].contentproperty of the Fireblocks transaction object is where you want to insert the signing_payload.

The Fireblocks API will return a signedMessages[] array, containing the required signatures.

Ethereum Specifics

You can use Figment's dedicated endpoint to broadcast transactions. You have two options:

  1. Send the signed_transaction: The unsigned transaction, serialized with the signature. See here. You must format the full signature value from signedMessages like so: "0x" + signedMessages[0].signature.fullSig.
  2. Send the unsigned_transaction_serialized along with its corresponding signature
  • Figment Broadcast Staking transaction endpoint: here

Cardano Specifics

Use Fireblocks API to sign the signing_payloadand then after signing, you will receive a signature that can be submitted via:

  • 👉 Endpoint: POST /broadcast: Use this endpoint when signing with proprietary custody solutions or any non-Fireblocks service. You must merge two witnesses into one cbor object before calling this endpoint. Please see here. Some of the hot wallets takes care of this merge process internally. In this case, see here
  • 👉 Endpoint: POST /broadcast/fireblocks: When signing Cardano transactions via the Fireblocks API, the response includes a publicKey and a FullSig. Simply pass the array returned from Fireblocks directly to the dedicated broadcast endpoint. This endpoint will automatically generate the two required witnesses for broadcasting the transaction, eliminating the need to create them manually. See here

Polkadot Specifics

If the transaction you are signing is part of a Polkadot flow, you must remove the leading 0x from the signing_payload before sending it to the Fireblocks API.

When sending the resulting signature from Fireblocks to the Staking API, you must prepend 0x00 to the signedMessages[].signature.fullSig value returned by the Fireblocks API.

Other Networks

Other networks only require the signedMessages[].signature.fullSig value.

References