Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Need more improved decoding address verification logic for integrated address #124

Closed
talentdeveloper opened this issue Jan 16, 2019 · 10 comments

Comments

@talentdeveloper
Copy link

No description provided.

@talentdeveloper
Copy link
Author

When CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX and CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX are much difference, for example h(245) and G(91), cnUtil.decode_address() doesn't work correctly.

this.decode_address = function(address) {

@talentdeveloper talentdeveloper changed the title Need more improved decoding address for integrated address Need more improved decoding address verification logic for integrated address Jan 16, 2019
@moneroexamples
Copy link
Owner

Can you provide example of what you mean that it does not work?

Also, the values of these constants correspond to these:

https://github.com/monero-project/monero/blob/d7bac99f6fd1ad8e3f3c90785a3f5b7d77e73cc5/src/cryptonote_config.h#L162-L164

@talentdeveloper
Copy link
Author

Yes, it's just monero prefix.
Btw, if I use another prefix like I said above, verify decoding logic doesn't work.
I am using forked chain, so the prefix is difference.
CRYPTONOTE_PUBLIC_ADDRESS_BASE58_PREFIX is 245 (h) and CRYPTONOTE_PUBLIC_INTEGRATED_ADDRESS_BASE58_PREFIX is 91 (G).
In this case, expectedPrefix.length is 4
You can find here.

var prefix = dec.slice(0, expectedPrefix.length);

On the other hands, expectedPrefixInt.length is 2

This is causing the error.

@moneroexamples
Copy link
Owner

Unfortunately, I don't know how it should or should not work in other chains. Probably more changes are required in other places if you change the constants used in monero.

@talentdeveloper
Copy link
Author

Ok, I see.
One more help needed.
When I try to compile openmonero with devel branch, I got compile error like below
/Work/openmonero/src/MicroCore.h:76:58: error: no matching function for call to ‘cryptonote::BlockchainDB::get_output_key(epee::span<const long unsigned int>, const std::vector<long unsigned int>&, std::vector<cryptonote::output_data_t>&)’ absolute_offsets, outputs);
Do you have any idea about this?
get_output_key declared like below
https://github.com/monero-project/monero/blob/29073f65e8816d4c32b6ffef514943a5650b8d3b/src/blockchain_db/blockchain_db.h#L1314

@talentdeveloper
Copy link
Author

P/s: it's not other chain, only the prefix is difference with Monero.

@moneroexamples
Copy link
Owner

Already made issue about this. Got the same error after most recent batch of monero's PRs.

#125

Will be looking into it now.

@moneroexamples
Copy link
Owner

moneroexamples commented Jan 17, 2019

regarding the prefix. openmonero is also using mymonero code, https://github.com/mymonero/mymonero-core-js, which makes cn_utils.js redundant in parts. The mymonero also defines the prefixes:
https://github.com/mymonero/mymonero-core-js/blob/master/cryptonote_utils/nettype.js So maybe this also needs to be adjusted?

Similar issue was raised before: #108 and I still haven't had time to clean up the legacy code which was replaced by mymonero code.

@moneroexamples
Copy link
Owner

should compile now.

@moneroexamples
Copy link
Owner

Closing as seems to be solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants