0

I am attempting to generate an integrated address from a standard address, via an RPC call to a monero-wallet-rpc instance with an unrelated wallet. It seems I always get back an integrated address from the default address in the loaded wallet.

Is is possible to generate an integrated address for a standard address that is totally unrelated to the loaded wallet?

I am running

{"jsonrpc": "2.0","i": "0","method": "make_integrated_address","params": {"standard_address":"55LTR8KniP4LQGJSPtbYDacR7dz8RBFnsfAKMaMuwUNYX6aQbBcovzDPyrQF9KXF9tVU6Xk3K8no1BywnJX6GvZX8yJsXvt", "payment_id": "5626bb63c38aec3c"}}

which returns

4DKZNCZKW2MguWaxD3AnycfqJAdRMMy17iyAVunUBKVNAKgn41PZrNkSWQybGjkpXvfL553pN5aMdWn5Bq1DkupXi1bt4GJou4g3an4XCz

and then

{"jsonrpc": "2.0","i": "0","method": "split_integrated_address","params": {"integrated_address": "4DKZNCZKW2MguWaxD3AnycfqJAdRMMy17iyAVunUBKVNAKgn41PZrNkSWQybGjkpXvfL553pN5aMdWn5Bq1DkupXi1bt4GJou4g3an4XCz"}}

which returns

43ctMPjptkqguWaxD3AnycfqJAdRMMy17iyAVunUBKVNAKgn41PZrNkSWQybGjkpXvfL553pN5aMdWn5Bq1DkupXUfpSmcn

ztnark
  • 113
  • 3

2 Answers2

0

The only way, via RPC, is to load a wallet with monero-wallet-rpc and call the make_integrated_address method. This accepts either no address or a supplied address, and a payment ID.

However, depending on your use-case and with a little code, it is fairly simple to create an integrated address from a given standard address and payment ID. The format is described in this answer.

jtgrassie
  • 19,111
  • 4
  • 14
  • 51
  • Ok thank you. In that case, what is the "standard_address" argument for? – ztnark Dec 20 '18 at 19:17
  • Yes I just corrected the answer, you can indeed pass in a standard address too. In any case, you still have to load a wallet to be able to call this method. – jtgrassie Dec 20 '18 at 19:19
  • Ok, so I have loaded a wallet, but I am supplying an argument of a standard address from a different wallet. It always returns an integrated address that relates back to the loaded wallet. Is that the expected behavior? – ztnark Dec 20 '18 at 19:21
  • No. If you are supplying a standard address as one of the parameters, the returned integrated address will be for the supplied address, not the address of the loaded wallet. Suggest you double check because I just checked the code and ran a test and works as expected. – jtgrassie Dec 20 '18 at 19:31
  • I edited my question to include my code that is malfunctioning. – ztnark Dec 20 '18 at 20:26
  • Your input address looks off. It should start with a 4. – jtgrassie Dec 20 '18 at 21:17
  • Turned out to be a version issue... Thank you for your help. – ztnark Dec 20 '18 at 21:25
0

This turned out to be a version issue. Older versions of Monero did not take the standard_address argument, will ignore it, and generate an address using the loaded wallet.

Fixed the "issue" by upgrading to 0.13.0.4

ztnark
  • 113
  • 3