1

I need to make a transfer on hot-wallet (view-only) and sign it on my offline wallet(cold-wallet) via wallet-rpc

And then send it to blockchain

It possible? I know how it can be done through a wallet-cli and unsigned_tx file

curl -X POST http://127.0.0.1:18083/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destinations":[{"amount":1000,"address":"9uUr8urCW73Hf1S2PxDkmKBk8wRujbSNuVgusyUDGv5seSjbKwDATafCXAmbWd8cWHghhzF2J4hpGLXEkUkxHCT35A4VaU3"}],"mixin":1,"get_tx_key": true}}' -H 'Content-Type:application/json'
{
  "error": {
    "code": -4,
    "message": "transaction was rejected by daemon"
  },
  "id": "0",
  "jsonrpc": "2.0"

with do_not_relay parameter it returns:

curl -X POST http://127.0.0.1:18083/json_rpc -d '{"jsonrpc":"2.0","id":"0","method":"transfer","params":{"destiations":[{"amount":1000,"address":"9uUr8urCW73Hf1S2PxDkmKBk8wRujbSNuVgusyUDGv5seSjbKwDATafCXAmbWd8cWHghhzF2J4hpGLXEkUkxHCT35A4VaU3"}],"mixin":1,"get_tx_key": true, "do_not_relay":true}}' -H 'Content-Type: application/json'
{
  "id": "0",
  "jsonrpc": "2.0",
  "result": {
    "amount": 1000,
    "fee": 851850000,
    "multisig_txset": "",
    "tx_blob": "",
    "tx_hash": "f7afba7ccb8e859a7600927053759d51f3904add1ba5217329a4a402d48fa6c5",
    "tx_key": "f9a932f872f28b1c1be19342c84e59fbe244b6e902430daf22dbd8b2f0eb4100",
    "tx_metadata": ""
  }

Can anyone help me with create and sign transfer with wallet-rpc??

1 Answer 1

2

If you call transfer or transfer_split on a hot wallet, you'll get data back in the unsigned_txset field. This was not yet present when you posted your question.

This unsigned_txset data can then be conveyed to the cold wallet, which signs it with sign_transfer, which gives you back a signed unsigned_txset field.

In turn, this is conveyed to the hot wallet, which then uses submit_transfer with that data.

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.