eos icon indicating copy to clipboard operation
eos copied to clipboard

cleos sign produces inconsistent results

Open michaeljyeates opened this issue 8 years ago • 2 comments

When the json file being signed is not in the same directory that cleos is run from, it produces inconsistent signatures. This is using cleos 1.0.5 on OSX

cleos sign --chain-id aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 ~/Downloads/upgrade_system_contract_official_trx.json | tail -n 5
private key:   "signatures": [
    "SIG_K1_JxUsq6aY3oN5ebpk9TdwaBjVe9icG75jRFKfu5tDbcpMf11hCHpNBVCR3ZCJeNKGTjDMUB4DDKae82jJhkGPvBVisJEEyK"
  ],
  "context_free_data": []
}
cleos sign --chain-id aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 ~/Downloads/upgrade_system_contract_official_trx.json | tail -n 5
private key:   "signatures": [
    "SIG_K1_KcWA59zW8DwgyKnhDqKUsG2TQpbm8xujF6vYFCHBw6Yqcms1fgaN76zDxmaj76zos2j2hwHo2xtgNx7yow64sncWgiiJme"
  ],
  "context_free_data": []
}

Now I move the json file to pwd

cleos sign --chain-id aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 upgrade_system_contract_official_trx.json | tail -n 5
private key:   "signatures": [
    "SIG_K1_KVkV1BEzv8WUSwPxu1Bzn7RyGvzeaSbz9WvuhHzzF7oVXpNVyw96NTRFyhxDcnBsC6oyTsPYjyL6rnihKiYGXK65JhaVWG"
  ],
  "context_free_data": []
}
cleos sign --chain-id aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 upgrade_system_contract_official_trx.json | tail -n 5
private key:   "signatures": [
    "SIG_K1_KVkV1BEzv8WUSwPxu1Bzn7RyGvzeaSbz9WvuhHzzF7oVXpNVyw96NTRFyhxDcnBsC6oyTsPYjyL6rnihKiYGXK65JhaVWG"
  ],
  "context_free_data": []
}

michaeljyeates avatar Jun 18 '18 18:06 michaeljyeates

I am not able to reproduce this and cannot find anything in the code that could explain why you would get different signatures rerunning the same cleos sign command with the same private K1 key. Are you positive you are pasting in the same private key each time?

If you are still able to consistently rerun cleos sign with the same private K1 key and get different signatures can you do the following?

./cleos --chain-id aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 ~/Downloads/upgrade_system_contract_official_trx.json > trx1.json
./cleos --chain-id aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906 ~/Downloads/upgrade_system_contract_official_trx.json > trx2.json
diff trx1.json trx2.json

arhag avatar Jun 18 '18 18:06 arhag

We haven't received any update for this. Please test with the latest version to see if this still happens. If you still have the problem and wish to discuss further, please post it in https://eosio.stackexchange.com.

taokayan avatar Oct 31 '18 06:10 taokayan