0

We are creating our hot and cold wallets from json files.

The cold wallet-json file looks something like this:

{ "version": 1, "address": "5AS4EbTaHoQ35Qyg3FEg9X25inJDsKCCzBWxDbL2ohGg8DHfhpG47mWQT1T6iA9jKMBGLLRgkPJBhR4Q6SDmWZjSEv7btZT", "spendkey": "4abc4c0b853444013c1b3ab5a6ba9220976f685305800acbf6c931dfa897bb0c", "password": "0b74713a7080027a0247ff811d42530ed7c9401479c73c0f5711a00fc609c51e", "scan_from_height": 0, "filename": "/var/Cold/XMR.5AS4EbTaHoQ35Qyg3FEg9X25inJDsKCCzBWxDbL2ohGg8DHfhpG47mWQT1T6iA9jKMBGLLRgkPJBhR4Q6SDmWZjSEv7btZT" }

And the hot wallet file looks something like this:

{ "version": 1, "viewkey": "f10b92787b01648bd5cab14500f36d5db1fb2391f4a5127a94e99dbdacc91c02", "address": "5AS4EbTaHoQ35Qyg3FEg9X25inJDsKCCzBWxDbL2ohGg8DHfhpG47mWQT1T6iA9jKMBGLLRgkPJBhR4Q6SDmWZjSEv7btZT", "watchonly": true, "password": "123", "scan_from_height": 165540, "filename": "/home/ksingh/Monero/hot/wallets/XMR.5AS4EbTaHoQ35Qyg3FEg9X25inJDsKCCzBWxDbL2ohGg8DHfhpG47mWQT1T6iA9jKMBGLLRgkPJBhR4Q6SDmWZjSEv7btZT" }

When we export outputs from the hot wallet, and try to import them into the cold wallet with a curl command like so:

curl -u user:password --digest -X POST http://127.0.0.1:18082/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"import_outputs","params":{"outputs_data_hex":"4d66e65726f206f7574707574206578706f727403f7b4ddcc53420e76945ab52934a4c39763cb7b46498e270f25c3284def0dd996dd7737e172abd271e22cf3f18cc5a673a0204b2153d33dfa3003367c2d33f55b5b58caa1376a2a98987049101f03a042b69036229c68f08044f877d157216c9bbf2f544c6a82f217cba4bcd6b223c31b1deb80f61945da5147a7e337711076cf44f1adbdb3e793601d3c1108669707646960a96510c1c2fb3cfb1f8b7aefc292823f12dee8b93765fbf76a69f6be755eebdac1ed6a5aa4a736edcb744f1fa3bf20fec3a5fa546a7bd8d052a0ca7bc4c6d992b13eb091a35fcd1859bb29e8f1d26101616f5e1504c720b67ca98c63e024ad7c2e4bb73e27a79be763eb9a3197374403b21ff7b071e6919ae959528aedda8d0c31ef0ff58372ef7287ce2f367db197ed50f62609837d9254045eb007e266ff760a877b912fb96e81e221ec709b3a9db680a18fb6962cfb2354f0f09596cf4a54e43c99d1816ce0714484a6dcaf0d00a42b5838be6565fb9c56912ef03b980ce6fa4e783828cb0c10782412e095835a3b4138ac9a34095af8d1c3c873918e72fbd4e52b160dce38121afc53f2987a5af1be46ef6f1a06c2ee5df7a7888f02e476f8c3e70a2818f80280f23a3b6df075addce2de5c57bc3a41bf9a5ed0a4d8f5a37ebac5d5a3b5e56ba3a4a9b998691def7a028ee9d5c885cb4cfa8dbe077bf7a84241ecf3b0b469d6e04a0f59fd45cc425729c809b3589f72af4c5a45b3a4c5d879362aaad63fafe02e7d8cd59fee795e9d7e2101fba99d4bffdb429357677aaa3f3e54a253ed8767656d26891d1e1ad0c3a18407"}}' -H 'Content-Type: application/json'

Note: the above curl command may not necessarily be for the same wallet files. Just showing this is an example of what is happening

It returns a response :

{ "error": { "code": -1, "message": "Failed to decrypt outputs: Failed to authenticate ciphertext" }, "id": "0", "jsonrpc": "2.0" }

Not sure if what I'm missing.

Another thing to note then I try the import_outputs command using the json_rpc, the response back is a 401 Unauthorized Access.

2
  • I realize that this question is similar to the one asked [here] (monero.stackexchange.com/questions/6792/…) However, I've pasted our wallet files that we generate the wallets both on the cold and hot side, and as you can see, its the same address. Commented Sep 19, 2018 at 15:53
  • Are the hot and cold wallet on systems with different operating systems (e.g. the hot wallet on Windows or Mac OS X and the cold wallet on Linux)?
    – dEBRUYNE
    Commented Sep 19, 2018 at 19:48

2 Answers 2

1

Your JSON data claims the wrong view secret key for the hot wallet. When you restore the cold wallet using your data, the viewkey command outputs:

secret: a0b8891884d22bd6e5ac514e79e87011964838c98c8ac468e51194ed2c7c560c
public: 3dba4b6f70744a631aba965544ab3a8e04b952775dfb4149003937b7155eceb6

However, your hot wallet JSON uses f10b92787b01648bd5cab14500f36d5db1fb2391f4a5127a94e99dbdacc91c02 as view secret key.

Note how this causes the hot and cold wallets to display different addresses on load.

1
  • The viewkey is giving us the public view key. The hot wallet needs the private view key. Commented Sep 21, 2018 at 12:06
0

So, I figured out what was going on. The json used to create the cold-wallet also needs the private view key.

We were only providing the private spend key to it.

BTW, we are using the monero-wallet-rpc --generate-from-json to create the wallet.

I've been told by another team member, that you can also use the monero-wallet-cli --generate-from-json and in that case the json does not have to have the private view key.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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