7.5. Signing a message

Certain actions – which go to the blockchain – need to be signed by the private key. As described in the previously, the signer first needs to obtain a challenge:

curl -s -L https://app.smartbl.io/api/v1/challenge/

Response:

{
"challenge_string": "cHoPMZxRry_hnhXnmRofKHJGKgU"
}

This challenge is then signed using the SHA-3 and user’s private key. The easiest way to sign the message is using the Web3 javascript library: https://web3js.readthedocs.io/en/1.0/web3-eth-personal.html#sign.

The following command is used to invoke the private key container (e.g. a hardware wallet, MetaMask or in-memory private key):

You can find a working example of signing a message using a Trezor hardware wallet at the following URL: https://trezor.github.io/connect/examples/signtx-ethereum.html

If you need further help signing a message, please get in touch with CargoX.