2

I'm building out an email notification system for monero. Correct me if I'm wrong or not:

  • There's no way to monitor an address by looking at transaction data, as the blockchain never reveals the addresses.
  • If you had the private view key, you could view whether the address has received funds or not. But how would one do this in the cli if you had the private view key from a paper wallet?
  • The monero address is the combination of the public view key and public send key combined, correct?

2 Answers 2

2

This is all correct.

To create a view wallet from the private view key, you can use the --generate-from-view-key option:

monero-wallet-cli --generate-from-view-key sample-view-wallet

You will be asked for address and view key, and will end up with a wallet from which you cannot spend. Note that you will not see outgoing monero, so when you see incoming funds, it might be change.

3
  • so if the pub view key has funds, there's no way to see it leave the address? i was thinking of building out a email notification system where if you wanted to monitor your address you just provide me with your address and pub view key. then i would write a cron to just check these addresses every few minutes and if there is any incoming or outgoing it would send and email. Commented Sep 27, 2017 at 15:50
  • You could monitor for potential spends, but they could turn out to be false positives. Without a key image (to generate it, you need the private spend key), it would be impossible to tell.
    – JollyMort
    Commented Sep 27, 2017 at 15:53
  • ok how about just monitor receiving funds then? Commented Sep 27, 2017 at 20:05
1

There's no way to monitor an address as looking at transaction data, it never reveals the addresses.

You can't just look up the address as it doesn't appear on the blockchain. You start from the TX data, and then check if any one-time output (one-time public key) belongs to some known address. For this, you need either:

  • private view key + public spend key + public TX key (the recipient has all, public TX key is published with the TX)
  • public view key + public spend key + private TX key (the sender has all, private TX key is generated at random for each TX the sender creates)

If you had the private view key, you can view if the address has received funds or not. But how would one do this in the cli if you had the private view key from a paper wallet?

That's right. You perform the above operation for each TX against the target private view key + address combination and look for matches. Technically, the private view key alone isn't enough, you need the public spend key as well (part of the address, anyway).

The CLI command is monero-wallet-cli --generate-from-view-key <wallet_name>, and user is prompted for address, private view key and blockchain height to start the scan from (saves scan time if known height of first received TX, as the wallet skips all data before that height).

The apparent balance will be the sum of all outputs (one-time public keys) found in the TX-es. The wallet won't know if they're spent, and will show wrong balance if anything has actually been spent.

The monero address is the combination of the public view key and public send key combined, correct?

Correct

In addition, it's possible to monitor for potential spends from the wallet. Thing is, without the key image, you won't know if the output was actually spent by someone else, or it was just used as decoy and it was not the one getting actually spent. If some tool provided such service it could stress people out if they don't understand this :)

Consider you found some outputs A, B, and C at heights T1, T2, and T3 which belong to your wallet. You perform a full scan, and your balance will be shown as A+B+C. If you spent any of them, it won't matter as the wallet can't tell whether it was spent as to subtract it from the balance.

Now, how would a transaction spending from C look like?

Input = ring of (C, X1, X2, X3, X4) + key image I Output = some new outputs O1 and O2

Thing is, one of (C, X1, X2, X3, X4) is linked to key image I, but you can't tell which one. If you use the wallet private key to reconstruct the one-time private key of output C, you would use that to generate some key image, and compare it against the one in the TX. If matching, it means the real output getting spent is C. If not, it means someone else included C in his ring and he is spending one of the remaining outputs in the ring - you can't tell which one, only that it's not yours.

So, if you monitor any appearance of C in some input of some TX, you could potentially detect spends. It's possible that you get a false positive.

However if you notice A, B and C appear in the same TX, chances are that someone did a sweep_all of your wallet. It could be a false positive, but what are the odds of someone randomly picking all of A, B and C as decoys.

2
  • thanks for confusing me more. ;).... so if i was creating an email notification service. What does the user have to give me in order for me to monitor his address for "any activity" so i can send him a notification. do i need his pub view key, pub spend key, and private view key? except for the private spend key of course. the use case is if I wanted to monitor my monero paper wallet address for any activity. Commented Sep 27, 2017 at 19:55
  • 1
    Practically address + private viewkey. From the address you extract the public spend key required for scanning.
    – JollyMort
    Commented Sep 27, 2017 at 20:02

Your Answer

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

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