2

I'm trying to create something which involves messing with (unsigned) transaction data, using the Rust library monero-rs. All I need to do is import an unsigned transaction, access the contents, then export the modified unsigned transaction.

However, this library does not appear to have any support for importing unsigned transactions, which does make sense given that it does not have signing capabilities.

Is there any way to do this? Preferably I'd like to stay in Rust. Importing a signed transaction, modifying it, then exporting the new one would also be acceptable, but I can't find a way to make any wallet "re-sign" an already signed transaction. Any other ideas? Or if it's necessary to implement this from scratch, is there any documentation available on how unsigned transactions are encoded?

Before you say this is a stupid idea and not the intended way of creating transactions, I know, and I will be doing all experiments on stagenet. And yes, I'm also aware that manipulating transaction data will often result in corrupting the outputs and making funds inaccessible.

1 Answer 1

1

You can create an unsigned transaction using the official wallet RPC. It's fully documented under sign_transfer.

The 3rd party library you reference appears to have the necessary functions to create / load an unsigned transaction (see the blockdata tests for examples of loading), but not to actually sign or transfer.

8
  • Yes, I know how to create unsigned transactions, but there does not appear to be a way to import them into the library. The examples you linked appear to only support signed transactions. Apr 17 at 2:04
  • "The examples you linked appear..." < Have you actually tried though? I just tried an unsigned tx (using deserialize::<Transaction>("hex")), and it worked fine.
    – jtgrassie
    Apr 17 at 12:18
  • Yes, I tried and it spat out an error. Just to be clear, what RPC method are you using? Apr 17 at 21:24
  • transfer with "do_not_relay":true,"get_tx_hex":true,"get_tx_metadata":true then loading the blob into the deserialize above. But as answered, the library doesn't support signing or transferring, so limited in use for you.
    – jtgrassie
    Apr 18 at 1:05
  • tx_blob has CLSAG signatures attached: i.imgur.com/4FrOnq7.png . When using a view-only wallet, "unsigned_txset" is given, but that cannot be read by the library. Apr 19 at 2:24

Your Answer

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

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