Is it possible to generate an integrated address using only the Monero address? Let's say I don't have the private keys. Can it be done with the Monero wallet or some other library?
1 Answer
Yes.
First you need to get the public spend key and public view key from the Monero address, which you do by converting it from base 58 to bytes, skipping the first byte, and then reading two 32 byte sequences which represent the public spend and public view keys.
Then to construct the integrated address, concatenate the bytes (0x13 || public spendkey || public viewkey || payment id || checksum) and then convert to base 58.
Note that Monero uses a modified base 58 encoding scheme, and that the payment ID must be a 8 byte value.
For source code, examine the Javascript source at this page: https://xmr.llcoins.net/addresstests.html