Sign a transaction

What is 'Sign a transaction' ?

The Sign a Transaction endpoint enables you to use your private key for a specific asset to sign a prepared transaction, making it ready for execution on the designated blockchain. This step remains an integral part of the Overledger Prepare-Sign-Execute Pattern.

While the Prepare and Execute steps of the pattern are handled via the Overledger API, the Sign a Transaction step specifically focuses on signing the transaction with the private key associated with your asset on the selected DLT.


Prerequisites

Create an hdAccountId Create an hdAccountId under one of the service providers if you have not already done so.

Generate a key Generate a private key for your asset under your hdAccountId if you have not already done so

Call the endpoint

Once the transaction has been prepared using the Overledger Prepare step. The sign transaction endpoint can be reached at:

https://hook.eu2.make.com/vbsev95xq873vucyb5o24s8hww9pqjba

The request body contains the native data from the Prepare step, along with other critical details specifying the location of the private key for a particular DLT asset:

curl --request POST \
     --url https://https://hook.eu2.make.com/vbsev95xq873vucyb5o24s8hww9pqjba \
     --header 'Authorization: Bearer token' \
     --header 'accept: application/json' \
     --header 'content-type: application/json' \
     --data '
{
  "clientId": "6rigmpr3qtji7dbfolrsbdh4ic"
  "serviceProvider": {
                      "name": "fireblocks",
                      "hdAccountId": 107
  },
  "location": {
                "technology": "ethereum",
                "network": "ethereum sepolia testnet"
  },
  "nativeData": {
        "nonce": 0,
        "gasPrice": 10000000000,
        "gasLimit":  1600000,
        "to": "0x2C25F9F544c264B5f6C3D30cD01eae4cbC0BAA65",
        "value": "0.001",
        "data": "0x00",
        "chainId": 11155111
  }
}
'

If the request is successful you would receive a response with the serialised signed transaction :

{
  "signed": "0x02f87583aa36a78084b2d05e0085174876e80083027100942c25f9f544c264b5f6c3d30cd01eae4cbc0baa65865af3107a400080c080a045c4317d1ed77e87e2f49f9142c135abccd46fd85093335927c61f4e972d2c54a021f4a1b98e2e5d6242b159fec1539df7006f37d77fcc5eb1233e50b35eacd2a9"
}

The signed response data can then be used in the Overledger execute step to complete the transaction.

Please note: In order to execute the signed transaction, the address of your asset has to be funded with the native token of the DLT network it is on.