3

How to verify the signature of data returned from $ cleos get block BLOCKNUM to insure that the data returned came from the blockchain and not 'spoofed' by a man-in-the-middle?

cleos get block 132

{"producer_signature":
  "SIG_K1_JzJjQSJdXdqE9H9JDgXumppkjv2AhpJWNxXuoJzqrQsmNDBqyhrz1TnkRUMT7WbGJwpA3kyj3c9TSthJwfzb22se4CPdbD",
  ...
  "trx": {
    "id": "a4c3cd072387dbb00dd27b99b2ed6d4ea8520239a11a775fdc6036bdc690aa55",
    "signatures": [
      "SIG_K1_KVXChzbL8gnEELY72qXhBd1xYfPkez2AAFtAB1RyiwbtEkt5zRSBSzXwDotdzymB75WLi9e7i4178HXDVk8yAci5tYWTnU"
    ],
0

You can recover public key of the producer which signed the Block.

Take a look at https://github.com/EOSIO/eosjs-ecc, it contains all the neccessary cryptographic functions you need.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.