The transaction amount is encrypted using Pedersen commitment with a random value r.
The amount is encrypted using the shared secret
rA and committed to in a Pederson commitment.
b = n xor8 Hs(“amount”|Hs(rA|i))
n here denotes the unencrypted amount,
rA is the shared secret,
i is the output index,
| is concatenation,
Hs is hash to scalar and
b is the final encrypted amount.
Then the Pedersen commitment
y = Hs(“commitment mask”|Hs(rA|i))
C = yG + bH
So one either needs
a (private terms of the shared secret) and either
A respectively, the public terms.
rG, the tx public key and
A is the receivers public view key. Thus with
a (the receivers private key) and the tx public key
R, one can decode the amount. As can the sender as they have
A. This is because
rA == aR.
Can I see the transaction amount if I only have the public view key?
No. You need some secret information, either
What is the relationship between view key and the random r value in Pedersen commitment?