Skip to content
This repository has been archived by the owner on Mar 9, 2024. It is now read-only.

view tag integration idea / untested [credits jberman] #116

Merged
merged 10 commits into from
Jun 24, 2022

Conversation

plowsof
Copy link
Contributor

@plowsof plowsof commented Apr 21, 2022

No description provided.

plowsof added 6 commits April 21, 2022 00:54
not tested / not working - just some initial ideas from Jberman implemented. I am assuming that pre hard fork transcations will have the old json structure
vt = binascii.hexlify(vt_full)[0:2]
if vt != on_chain_vt:
continue
else:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This shouldn't be an else, the rest of the function should remain unchanged :)

(When scanning, doing the rest of this for every output is slow especially scalarmult_B; view tags just short-circuit so it doesn't have to do the rest of this for ~99.6% of outputs, but it still needs to do it to check for ownership when vt == on_chain_vt)

if vout["target"]["tagged_key"]:
#post fork transaction
stealth_address = binascii.unhexlify(vout["target"]["tagged_key"]["key"])
on_chain_vt = binascii.unhexlify(vout["target"]["tagged_key"]["view_tag"])
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably need to keep this on_chain_vt a hex string for the equality check against vt downstream to work :)

Or alternatively, can keep this as is, and then instead of vt = binascii.hexlify(vt_full)[0:2] later on, grab just the first byte of vt_full in binary.. but I'm not sure how to do that in this code. That's probably the ideal approach

)
if payment:
break
outs.append(
Output(
stealth_address=vout["target"]["key"],
stealth_address=stealth_address,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like this is changing the passed in type from a hex string to binary and I would think would cause these tests to fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, good spot! hacky'd a fix to set the original type key for both 👍

@emesik emesik merged commit a9cf78d into monero-ecosystem:master Jun 24, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants